Changeset 246 for branches/highdpi/Packages/CevoComponents/DrawDlg.pas
- Timestamp:
- May 21, 2020, 8:17:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/CevoComponents/DrawDlg.pas
r212 r246 13 13 14 14 TDrawDlg = class(TDpiForm) 15 public16 constructor Create(AOwner: TComponent); override;17 destructor Destroy; override;18 procedure SmartInvalidate; virtual;19 15 private 20 16 MoveFormPos: TPoint; … … 33 29 procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; 34 30 procedure MouseLeave; override; 31 public 32 constructor Create(AOwner: TComponent); override; 33 destructor Destroy; override; 34 procedure SmartInvalidate; virtual; 35 35 end; 36 36 … … 127 127 inherited; 128 128 {$IFDEF LINUX} 129 // HitTest is not supported under Linux GTK2 so use form inside move mechanizm 130 NewFormPos := ScreenToClient(DpiMouse.CursorPos); 131 if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and 132 (NewFormPos.Y >= 0) and (NewFormPos.Y < Height) then begin 133 MoveMousePos := ClientToScreen(Point(X, Y)); 134 MoveFormPos := Point(Left, Top); 135 MousePosNew := DpiMouse.CursorPos; 136 // Activate move only if mouse position was not changed during inherited call 137 if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin 138 MoveActive := True; 139 end; 140 end else MoveActive := False; 129 // Only if client is not doing own mouse move handling 130 if not Assigned(OnMouseDown) or not Assigned(OnMouseMove) or not Assigned(OnMouseUp) then begin 131 // HitTest is not supported under Linux GTK2 so use form inside move mechanizm 132 NewFormPos := ScreenToClient(DpiMouse.CursorPos); 133 if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and 134 (NewFormPos.Y >= 0) and (NewFormPos.Y < Height) then begin 135 MoveMousePos := ClientToScreen(Point(X, Y)); 136 MoveFormPos := Point(Left, Top); 137 MousePosNew := DpiMouse.CursorPos; 138 // Activate move only if mouse position was not changed during inherited call 139 if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin 140 MoveActive := True; 141 end; 142 end else MoveActive := False; 143 end; 141 144 {$ENDIF} 142 145 end;
Note:
See TracChangeset
for help on using the changeset viewer.