- Timestamp:
- Apr 15, 2024, 8:39:16 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r534 r535 315 315 Panel: TBitmap; 316 316 TopBar: TBitmap; 317 sb: TPVScrollbar;317 VerticalScrollBar: TPVScrollbar; 318 318 Closable: Boolean; 319 319 RepaintOnResize: Boolean; … … 1740 1740 StartRunning := False; 1741 1741 1742 sb:= TPVScrollbar.Create(Self);1743 sb.OnUpdate := ScrollBarUpdate;1742 VerticalScrollBar := TPVScrollbar.Create(Self); 1743 VerticalScrollBar.OnUpdate := ScrollBarUpdate; 1744 1744 end; 1745 1745 … … 2795 2795 if Controls[I] is TButtonC then 2796 2796 Controls[I].Visible := False; 2797 sb.Init(0, 1);2797 VerticalScrollBar.Init(0, 1); 2798 2798 for p1 := 0 to nPl - 1 do 2799 2799 if Tribe[p1] <> nil then … … 3602 3602 3603 3603 MainFormKeyDown := nil; 3604 FreeAndNil( sb);3604 FreeAndNil(VerticalScrollBar); 3605 3605 FreeAndNil(TopBar); 3606 3606 FreeAndNil(MiniMap); … … 3623 3623 if (MousePos.Y > ClientHeight - MidPanelHeight) and 3624 3624 (MousePos.Y < ClientHeight) then begin 3625 if sb.ProcessMouseWheel(WheelDelta) then begin3625 if VerticalScrollBar.ProcessMouseWheel(WheelDelta) then begin 3626 3626 PanelPaint; 3627 3627 Update; … … 4218 4218 procedure TMainScreen.OnScroll(var Msg: TMessage); 4219 4219 begin 4220 if sb.Process(Msg) then begin4220 if VerticalScrollBar.Process(Msg) then begin 4221 4221 PanelPaint; 4222 4222 Update; … … 4921 4921 for I := 0 to nBrushTypes - 1 do 4922 4922 begin // display terrain types 4923 if (Count >= TrRow * sb.Position) and (Count < TrRow * (sb.Position + 1))4923 if (Count >= TrRow * VerticalScrollBar.Position) and (Count < TrRow * (VerticalScrollBar.Position + 1)) 4924 4924 then 4925 4925 begin 4926 trix[Count - TrRow * sb.Position] := BrushTypes[I];4927 X := (Count - TrRow * sb.Position) * TrPitch;4926 trix[Count - TrRow * VerticalScrollBar.Position] := BrushTypes[I]; 4927 X := (Count - TrRow * VerticalScrollBar.Position) * TrPitch; 4928 4928 xSrcBase := -1; 4929 4929 case BrushTypes[I] of … … 5155 5155 if unx.Loc = TroopLoc then 5156 5156 begin 5157 if (Count >= TrRow * sb.Position) and5158 (Count < TrRow * ( sb.Position + 1)) then5157 if (Count >= TrRow * VerticalScrollBar.Position) and 5158 (Count < TrRow * (VerticalScrollBar.Position + 1)) then 5159 5159 begin 5160 trix[Count - TrRow * sb.Position] := uix;5160 trix[Count - TrRow * VerticalScrollBar.Position] := uix; 5161 5161 MakeUnitInfo(Me, unx, UnitInfo); 5162 X := (Count - TrRow * sb.Position) * TrPitch;5162 X := (Count - TrRow * VerticalScrollBar.Position) * TrPitch; 5163 5163 if uix = UnFocus then 5164 5164 begin … … 5209 5209 Server(sGetUnits, Me, TroopLoc, Count); 5210 5210 for I := 0 to Count - 1 do 5211 if (I >= TrRow * sb.Position) and (I < TrRow * (sb.Position + 1)) then5211 if (I >= TrRow * VerticalScrollBar.Position) and (I < TrRow * (VerticalScrollBar.Position + 1)) then 5212 5212 begin // display enemy units 5213 trix[I - TrRow * sb.Position] := I;5214 X := (I - TrRow * sb.Position) * TrPitch;5213 trix[I - TrRow * VerticalScrollBar.Position] := I; 5214 X := (I - TrRow * VerticalScrollBar.Position) * TrPitch; 5215 5215 NoMapPanel.SetOutput(Panel); 5216 5216 NoMapPanel.PaintUnit(xTroop + 2 + X, yTroop + 1, … … 6871 6871 Server(sGetUnits, Me, Loc, TrCnt); 6872 6872 if TrCnt = 0 then 6873 sb.Init(0, 1)6873 VerticalScrollBar.Init(0, 1) 6874 6874 else 6875 6875 begin 6876 sb.Init((TrCnt + TrRow - 1) div TrRow - 1, 1);6877 if ( sb.Max >= sb.PageSize) and (trixFocus >= 0) then6878 sb.Position := trixFocus div TrRow;6876 VerticalScrollBar.Init((TrCnt + TrRow - 1) div TrRow - 1, 1); 6877 if (VerticalScrollBar.Max >= VerticalScrollBar.PageSize) and (trixFocus >= 0) then 6878 VerticalScrollBar.Position := trixFocus div TrRow; 6879 6879 end; 6880 6880 end; … … 7013 7013 procedure TMainScreen.SetFullScreen(Active: Boolean); 7014 7014 begin 7015 if Active and (CurrentWindowState <> TWindowState.wsFullScreen) then begin 7016 PrevWindowState := WindowState; 7017 CurrentWindowState := TWindowState.wsFullScreen; 7015 if Active and (CurrentWindowState <> TWindowState.wsFullScreen) then begin 7016 PrevWindowState := WindowState; 7017 CurrentWindowState := TWindowState.wsFullScreen; 7018 WindowState := CurrentWindowState; 7019 {$IFDEF WINDOWS} 7020 BorderStyle := TBorderStyle.bsNone; 7021 {$ENDIF} 7022 BorderIcons := []; 7023 end else 7024 if not Active and (CurrentWindowState = TWindowState.wsFullScreen) then begin 7025 if PrevWindowState = TWindowState.wsMaximized then begin 7026 CurrentWindowState := TWindowState.wsNormal; 7018 7027 WindowState := CurrentWindowState; 7019 {$IFDEF WINDOWS} 7020 BorderStyle := TBorderStyle.bsNone; 7021 {$ENDIF} 7022 BorderIcons := []; 7023 end else 7024 if not Active and (CurrentWindowState = TWindowState.wsFullScreen) then begin 7025 if PrevWindowState = TWindowState.wsMaximized then begin 7026 CurrentWindowState := TWindowState.wsNormal; 7027 WindowState := CurrentWindowState; 7028 end else begin 7029 CurrentWindowState := PrevWindowState; 7030 WindowState := CurrentWindowState; 7031 WindowState := TWindowState.wsFullScreen; 7032 WindowState := CurrentWindowState; 7033 end; 7034 {$IFDEF WINDOWS} 7035 BorderStyle := TBorderStyle.bsSizeable; 7036 {$ENDIF} 7037 BorderIcons := [TBorderIcon.biSystemMenu, TBorderIcon.biMinimize, 7038 TBorderIcon.biMaximize]; 7039 end; 7028 end else begin 7029 CurrentWindowState := PrevWindowState; 7030 WindowState := CurrentWindowState; 7031 WindowState := TWindowState.wsFullScreen; 7032 WindowState := CurrentWindowState; 7033 end; 7034 {$IFDEF WINDOWS} 7035 BorderStyle := TBorderStyle.bsSizeable; 7036 {$ENDIF} 7037 BorderIcons := [TBorderIcon.biSystemMenu, TBorderIcon.biMinimize, 7038 TBorderIcon.biMaximize]; 7039 if Left < 0 then Left := 0; 7040 if Top < 0 then Top := 0; 7041 end; 7040 7042 end; 7041 7043 … … 8319 8321 EOT.Top := Height - 64; 8320 8322 EOT.Left := Width - 62; 8321 sb.SetBorderSpacing(Height - yTroop - 24, Width - xRightPanel + 8, 8);8322 SetWindowPos( sb.ScrollBar.Handle, 0, xRightPanel + 10 - 14 - GetSystemMetrics(SM_CXVSCROLL),8323 VerticalScrollBar.SetBorderSpacing(Height - yTroop - 24, Width - xRightPanel + 8, 8); 8324 SetWindowPos(VerticalScrollBar.ScrollBar.Handle, 0, xRightPanel + 10 - 14 - GetSystemMetrics(SM_CXVSCROLL), 8323 8325 Height - MidPanelHeight + 8, 0, 0, SWP_NOSIZE or SWP_NOZORDER); 8324 8326 MapBtn0.Left := xMini + G.lx - 44;
Note:
See TracChangeset
for help on using the changeset viewer.