Ignore:
Timestamp:
Mar 9, 2021, 9:19:49 AM (4 years ago)
Author:
chronos
Message:
  • Modified: Synced code with current trunk version.
File:
1 edited

Legend:

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

    r252 r303  
    1818    MoveActive: Boolean;
    1919    procedure VisibleChangedHandler(Sender: TObject);
     20    procedure DoDeactivate(Sender: TObject);
    2021  protected
    2122    TitleHeight: Integer;
     
    2930    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
    3031    procedure MouseLeave; override;
     32    procedure KeyDown(var Key: Word; Shift: TShiftState); override;
    3133  public
    3234    constructor Create(AOwner: TComponent); override;
     
    7173  MoveActive := False;
    7274  AddHandlerOnVisibleChanged(VisibleChangedHandler);
     75  {$IFDEF LINUX}
     76  OnDeactivate := DoDeactivate;
     77  {$ENDIF}
    7378end;
    7479
     
    7681begin
    7782  RemoveHandlerOnVisibleChanged(VisibleChangedHandler);
    78   inherited Destroy;
     83  inherited;
    7984end;
    8085
     
    171176end;
    172177
     178procedure TDrawDlg.KeyDown(var Key: Word; Shift: TShiftState);
     179begin
     180  if Key = VK_ESCAPE then Close;
     181  inherited;
     182end;
     183
    173184procedure TDrawDlg.VisibleChangedHandler(Sender: TObject);
     185begin
     186  MoveActive := False;
     187end;
     188
     189procedure TDrawDlg.DoDeactivate(Sender: TObject);
    174190begin
    175191  MoveActive := False;
Note: See TracChangeset for help on using the changeset viewer.