Ignore:
Timestamp:
May 21, 2020, 8:17:38 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Update from trunk rev 245.
  • Modified: Vcl prefix/suffix changed to Native.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/DrawDlg.pas

    r212 r246  
    1313
    1414  TDrawDlg = class(TDpiForm)
    15   public
    16     constructor Create(AOwner: TComponent); override;
    17     destructor Destroy; override;
    18     procedure SmartInvalidate; virtual;
    1915  private
    2016    MoveFormPos: TPoint;
     
    3329    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    3430    procedure MouseLeave; override;
     31  public
     32    constructor Create(AOwner: TComponent); override;
     33    destructor Destroy; override;
     34    procedure SmartInvalidate; virtual;
    3535  end;
    3636
     
    127127  inherited;
    128128  {$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;
    141144  {$ENDIF}
    142145end;
Note: See TracChangeset for help on using the changeset viewer.