Changeset 252
- Timestamp:
- May 23, 2020, 12:45:14 AM (4 years ago)
- Location:
- branches/highdpi
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Direct.pas
r210 r252 30 30 procedure SetInfo(x: string); 31 31 procedure SetState(x: integer); 32 procedure OnGo(var m: TMessage); message WM_GO;33 procedure OnChangeClient(var m: TMessage); message WM_CHANGECLIENT;34 procedure OnNextPlayer(var m: TMessage); message WM_NEXTPLAYER;32 procedure OnGo(var Msg: TMessage); message WM_GO; 33 procedure OnChangeClient(var Msg: TMessage); message WM_CHANGECLIENT; 34 procedure OnNextPlayer(var Msg: TMessage); message WM_NEXTPLAYER; 35 35 procedure OnAIException(var Msg: TMessage); message WM_AIEXCEPTION; 36 36 end; … … 208 208 end; 209 209 210 procedure TDirectDlg.OnGo(var m: TMessage);210 procedure TDirectDlg.OnGo(var Msg: TMessage); 211 211 var 212 212 i: integer; … … 234 234 Quick := true; 235 235 DirectHelp(cHelpOnly); 236 Close 236 Close; 237 237 end; 238 238 end … … 254 254 end; 255 255 256 procedure TDirectDlg.OnChangeClient(var m: TMessage);256 procedure TDirectDlg.OnChangeClient(var Msg: TMessage); 257 257 begin 258 258 ChangeClient; 259 259 end; 260 260 261 procedure TDirectDlg.OnNextPlayer(var m: TMessage);261 procedure TDirectDlg.OnNextPlayer(var Msg: TMessage); 262 262 begin 263 263 NextPlayer; -
branches/highdpi/LocalPlayer/Help.pas
r247 r252 110 110 procedure WaterSign(x0, y0, iix: Integer); 111 111 procedure Search(SearchString: string); 112 procedure OnScroll(var m: TMessage); message WM_VSCROLL;112 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 113 113 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 114 114 public … … 342 342 end; 343 343 344 procedure THelpDlg.OnScroll(var m: TMessage);344 procedure THelpDlg.OnScroll(var Msg: TMessage); 345 345 begin 346 346 { TODO: Handled by MouseWheel event 347 if ScrollBar.Process( m) then begin347 if ScrollBar.Process(Msg) then begin 348 348 Sel := -1; 349 349 SmartUpdateContent(true) … … 357 357 Line(Canvas, Sel, false); 358 358 Sel := -1 359 end 359 end; 360 360 end; 361 361 -
branches/highdpi/LocalPlayer/Select.pas
r246 r252 59 59 function RenameCity(cix: integer): boolean; 60 60 function RenameModel(mix: integer): boolean; 61 procedure OnScroll(var m: TMessage); message WM_VSCROLL;61 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 62 62 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 63 63 public … … 133 133 end; 134 134 135 procedure TListDlg.OnScroll(var m: TMessage);135 procedure TListDlg.OnScroll(var Msg: TMessage); 136 136 begin 137 137 { TODO: Handled by MouseWheel event 138 if sb.Process( m) then begin138 if sb.Process(Msg) then begin 139 139 Sel := -2; 140 140 SmartUpdateContent(true); -
branches/highdpi/LocalPlayer/Term.pas
r251 r252 280 280 procedure LoadSettings; 281 281 procedure SaveSettings; 282 procedure OnScroll(var m: TMessage); message WM_VSCROLL;282 procedure OnScroll(var Msg: TMessage); message WM_VSCROLL; 283 283 procedure OnEOT(var Msg: TMessage); message WM_EOT; 284 284 procedure SoundPreload(Check: integer); … … 3620 3620 end; 3621 3621 3622 procedure TMainScreen.OnScroll(var m: TMessage);3623 begin 3624 if sb.Process( m) then begin3622 procedure TMainScreen.OnScroll(var Msg: TMessage); 3623 begin 3624 if sb.Process(Msg) then begin 3625 3625 PanelPaint; 3626 3626 Update; … … 3630 3630 procedure TMainScreen.OnEOT(var Msg: TMessage); 3631 3631 begin 3632 EndTurn 3632 EndTurn; 3633 3633 end; 3634 3634 … … 3638 3638 begin 3639 3639 MessgExDlg.CancelMovie; 3640 Server(sBreak, me, 0, nil^) 3640 Server(sBreak, me, 0, nil^); 3641 3641 end 3642 3642 else if ClientMode < 0 then … … 3647 3647 begin 3648 3648 Jump[pTurn] := 0; 3649 StartRunning := false 3649 StartRunning := false; 3650 3650 end 3651 3651 else 3652 EndTurn 3652 EndTurn; 3653 3653 end; 3654 3654 … … 4144 4144 end; 4145 4145 4146 {$IFDEF LINUX}4147 // Can't do scrolling of DC under Linux, then fallback into BitBlt.4148 function ScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean;4149 begin4150 Result := DpiBitCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top,4151 Canvas, lprcScroll.Left, lprcScroll.Top);4152 end;4153 {$ENDIF}4154 4155 4146 procedure TMainScreen.MainOffscreenPaint; 4156 4147 var … … 4199 4190 offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4200 4191 rec := Rect(0, 0, MapWidth, MapHeight); 4201 {$IFDEF WINDOWS} 4202 ScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4192 DpiScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, 4203 4193 rec, rec, 0, nil); 4204 {$ENDIF}4205 {$IFDEF LINUX}4206 ScrollDC(offscreen.Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,4207 rec, rec, 0, nil);4208 {$ENDIF}4209 4194 for DoInvalidate := false to FastScrolling do 4210 4195 begin … … 4212 4197 begin 4213 4198 rec.Bottom := MapHeight - overlap; 4214 {$IFDEF WINDOWS} 4215 ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec, 4199 DpiScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec, 4216 4200 rec, 0, nil); 4217 {$ENDIF}4218 {$IFDEF LINUX}4219 ScrollDC(Canvas, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt,4220 rec, rec, 0, nil);4221 {$ENDIF}4222 4201 ProcessOptions := prInvalidate; 4223 4202 end … … 5074 5053 if DpiMouse.CursorPos.x = 0 then 5075 5054 dx := -speed // scroll left 5076 else if DpiMouse.CursorPos.x = DpiScreen.width - 1 then5055 else if DpiMouse.CursorPos.x >= DpiScreen.width - 1 then 5077 5056 dx := speed; // scroll right 5078 5057 if DpiMouse.CursorPos.y = 0 then 5079 5058 dy := -speed // scroll up 5080 else if (DpiMouse.CursorPos.y = DpiScreen.height - 1) and5059 else if (DpiMouse.CursorPos.y >= DpiScreen.height - 1) and 5081 5060 (DpiMouse.CursorPos.x >= TerrainBtn.Left + TerrainBtn.width) and 5082 5061 (DpiMouse.CursorPos.x < xRightPanel + 10 - 8) then -
branches/highdpi/Packages/CevoComponents/DrawDlg.pas
r246 r252 22 22 // defines area to grip the window for moving (from top) 23 23 procedure InitButtons; 24 procedure OnEraseBkgnd(var m: TMessage); message WM_ERASEBKGND;24 procedure OnEraseBkgnd(var Msg: TMessage); message WM_ERASEBKGND; 25 25 procedure OnHitTest(var Msg: TMessage); message WM_NCHITTEST; 26 26 procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); … … 79 79 end; 80 80 81 procedure TDrawDlg.OnEraseBkgnd(var m: TMessage);81 procedure TDrawDlg.OnEraseBkgnd(var Msg: TMessage); 82 82 begin 83 83 end; … … 93 93 else 94 94 begin 95 Pos := Point(Integer(Msg.LParam and $ffff),96 Integer((Msg.LParam shr 16) and $ffff)) ;95 Pos := ScalePointFromNative(Point(Integer(Msg.LParam and $ffff), 96 Integer((Msg.LParam shr 16) and $ffff))); 97 97 if Pos.Y >= Top + TitleHeight then 98 98 Msg.Result := HTCLIENT … … 112 112 end; 113 113 end; 114 Msg.Result := HTCAPTION 114 Msg.Result := HTCAPTION; 115 115 end; 116 116 end; -
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r250 r252 902 902 function DpiBitBltCanvas(Dest: TDpiCanvas; X, Y, Width, Height: Integer; Src: TDpiCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; 903 903 function DpiCreateRectRgn(X1, Y1, X2, Y2: Integer): HRGN; 904 function DpiScrollDC(hDC:HDC; dx:longint; dy:longint; const lprcScroll:RECT; const lprcClip:RECT;hrgnUpdate:HRGN; lprcUpdate: LPRECT): WINBOOL; 904 905 function ScaleToNative(Value: Integer): Integer; 905 906 function ScaleFromNative(Value: Integer): Integer; … … 940 941 Result := CreateRectRgn(ScaleToNative(X1), ScaleToNative(Y1), ScaleToNative(X2), 941 942 ScaleToNative(Y2)); 943 end; 944 945 {$IFDEF LINUX} 946 function LinuxScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean; 947 begin 948 end; 949 {$ENDIF} 950 951 function DpiScrollDC(hDC: HDC; dx: longint; dy: longint; 952 const lprcScroll: RECT; const lprcClip: RECT; hrgnUpdate: HRGN; 953 lprcUpdate: LPRECT): WINBOOL; 954 begin 955 {$IFDEF WINDOWS} 956 Result := Windows.ScrollDC(hDC, ScaleToNative(dx), ScaleToNative(dy), 957 ScaleRectToNative(lprcScroll), ScaleRectToNative(lprcClip), 958 hrgnUpdate, lprcUpdate); 959 {$ENDIF} 960 {$IFDEF LINUX} 961 // Can't do scrolling of DC under Linux, then fallback into BitBlt. 962 Result := DpiBitCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top, 963 Canvas, lprcScroll.Left, lprcScroll.Top); 964 {$ENDIF} 942 965 end; 943 966
Note:
See TracChangeset
for help on using the changeset viewer.