Ignore:
Timestamp:
Apr 28, 2022, 10:40:37 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Changed WindowMode numerical constants to enumeration.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/BaseWin.pas

    r408 r431  
    88
    99type
    10   TShowNewContent = procedure (NewMode: Integer; HelpContext: string) of object;
     10  TWindowMode = (wmNone, wmModal, wmPersistent, wmSubmodal);
     11  TShowNewContent = procedure (NewMode: TWindowMode; HelpContext: string) of object;
    1112
    1213  { TBufferedDrawDlg }
     
    2526    procedure StayOnTop_Workaround;
    2627  protected
    27     FWindowMode: Integer;
     28    FWindowMode: TWindowMode;
    2829    ModalFrameIndent: Integer;
    2930    HelpContext: string;
    30     procedure ShowNewContent(NewMode: Integer; ForceClose: Boolean = False);
     31    procedure ShowNewContent(NewMode: TWindowMode; ForceClose: Boolean = False);
    3132    procedure MarkUsedOffscreen(xMax, yMax: Integer);
    3233    procedure OffscreenPaint; virtual;
     
    3738    Offscreen: TBitmap;
    3839    OffscreenUser: TForm;
    39     property WindowMode: integer read FWindowMode;
     40    property WindowMode: TWindowMode read FWindowMode;
    4041  end;
    4142
     
    6465
    6566const
    66   // window modes
    67   wmNone = 0;
    68   wmModal = $1;
    69   wmPersistent = $2;
    70   wmSubmodal = $3;
    71 
    7267  yUnused = 161;
    7368  NarrowFrame = 11;
     
    7671
    7772procedure CreateOffscreen(var Offscreen: TBitmap);
     73function WindowModePersistent(Mode: TWindowMode): TWindowMode;
    7874procedure Register;
    7975
     
    8379uses
    8480  ButtonBase, Area;
     81
     82function WindowModeMakePersistent(Mode: TWindowMode): TWindowMode;
     83begin
     84  if Mode = wmModal then Result := wmSubmodal
     85    else Result := wmPersistent;
     86end;
    8587
    8688procedure Register;
     
    142144  if Key = VK_F1 then begin
    143145    if Assigned(ShowNewContentProc) then
    144       ShowNewContentProc(FWindowMode or wmPersistent, HelpContext);
     146      ShowNewContentProc(WindowModePersistent(FWindowMode), HelpContext);
    145147  end else
    146148  if FWindowMode = wmPersistent then begin
     
    168170end;
    169171
    170 procedure TBufferedDrawDlg.ShowNewContent(NewMode: Integer;
     172procedure TBufferedDrawDlg.ShowNewContent(NewMode: TWindowMode;
    171173  ForceClose: Boolean);
    172174begin
Note: See TracChangeset for help on using the changeset viewer.