Changeset 431 for trunk/Packages


Ignore:
Timestamp:
Apr 28, 2022, 10:40:37 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Changed WindowMode numerical constants to enumeration.
Location:
trunk/Packages/CevoComponents
Files:
4 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
  • trunk/Packages/CevoComponents/ButtonA.pas

    r315 r431  
    5454    end else begin
    5555      Brush.Color := $0000FF;
    56       FrameRect(Rect(0, 0, 100, 25))
     56      FrameRect(Rect(0, 0, 100, 25));
    5757    end;
    5858end;
  • trunk/Packages/CevoComponents/ButtonBase.pas

    r355 r431  
    99  TButtonBase = class(TGraphicControl)
    1010  protected
    11     FDown, FPermanent: boolean;
     11    FDown: Boolean;
     12    FPermanent: Boolean;
    1213    FGraphic: TBitmap;
    1314    // FDownSound, FUpSound: string;
     
    5960begin
    6061  Active := true;
    61   MouseMove(Shift, x, y)
     62  MouseMove(Shift, x, y);
    6263end;
    6364
     
    9394        DownChangedProc(self);
    9495    end;
    95   end
     96  end;
    9697end;
    9798
  • trunk/Packages/CevoComponents/ButtonC.pas

    r290 r431  
    4646    begin
    4747      Brush.Color := $0000FF;
    48       FrameRect(Rect(0, 0, 12, 12))
     48      FrameRect(Rect(0, 0, 12, 12));
    4949    end;
    5050end;
Note: See TracChangeset for help on using the changeset viewer.