Changeset 174 for trunk/Packages/CevoComponents/DrawDlg.pas
- Timestamp:
- Jun 16, 2019, 11:29:21 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/DrawDlg.pas
r168 r174 15 15 public 16 16 constructor Create(AOwner: TComponent); override; 17 destructor Destroy; override; 17 18 procedure SmartInvalidate; virtual; 18 19 private … … 20 21 MoveMousePos: TPoint; 21 22 MoveActive: Boolean; 23 procedure VisibleChangedHandler(Sender: TObject); 22 24 protected 23 25 TitleHeight: Integer; … … 67 69 inherited; 68 70 TitleHeight := 0; 71 MoveActive := False; 72 AddHandlerOnVisibleChanged(VisibleChangedHandler); 73 end; 74 75 destructor TDrawDlg.Destroy; 76 begin 77 RemoveHandlerOnVisibleChanging(VisibleChangedHandler); 78 inherited Destroy; 69 79 end; 70 80 … … 111 121 var 112 122 MousePosNew: TPoint; 123 NewFormPos: TPoint; 113 124 begin 114 125 inherited; 115 126 {$IFDEF LINUX} 116 127 // HitTest is not supported under Linux GTK2 so use form inside move mechanizm 117 MoveMousePos := ClientToScreen(Point(X, Y)); 118 MoveFormPos := Point(Left, Top); 119 MousePosNew := Mouse.CursorPos; 120 // Activate move only if mouse position was not changed during inherited call 121 if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin 122 MoveActive := True; 123 end; 128 NewFormPos := ScreenToClient(Mouse.CursorPos); 129 if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and 130 (NewFormPos.Y >= 0) and (NewFormPos.Y < Height) then begin 131 MoveMousePos := ClientToScreen(Point(X, Y)); 132 MoveFormPos := Point(Left, Top); 133 MousePosNew := Mouse.CursorPos; 134 // Activate move only if mouse position was not changed during inherited call 135 if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin 136 MoveActive := True; 137 end; 138 end else MoveActive := False; 124 139 {$ENDIF} 125 140 end; … … 149 164 MoveActive := False; 150 165 inherited; 166 end; 167 168 procedure TDrawDlg.VisibleChangedHandler(Sender: TObject); 169 begin 170 MoveActive := False; 151 171 end; 152 172
Note:
See TracChangeset
for help on using the changeset viewer.