Ignore:
Timestamp:
Nov 29, 2023, 2:35:44 PM (12 months ago)
Author:
chronos
Message:
  • Modified: HighDpi branch updated to trunk version.
File:
1 edited

Legend:

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

    r361 r463  
    99  TButtonBase = class(TDpiGraphicControl)
    1010  protected
    11     FDown, FPermanent: boolean;
     11    FDown: Boolean;
     12    FPermanent: Boolean;
    1213    FGraphic: TDpiBitmap;
    1314    // FDownSound, FUpSound: string;
    1415    ClickProc: TNotifyEvent;
    1516    DownChangedProc: TNotifyEvent;
    16     procedure SetDown(x: boolean);
     17    procedure SetDown(X: Boolean);
    1718    // procedure PlayDownSound;
    1819    // procedure PlayUpSound;
    1920    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
    20       x, y: integer); override;
     21      X, Y: Integer); override;
    2122    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
    22       x, y: integer); override;
    23     procedure MouseMove(Shift: TShiftState; x, y: integer); override;
     23      X, Y: Integer); override;
     24    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
    2425  private
    25     Active: boolean;
     26    Active: Boolean;
    2627  public
    2728    constructor Create(aOwner: TComponent); override;
     
    3132  published
    3233    property Visible;
    33     property Down: boolean read FDown write SetDown;
    34     property Permanent: boolean read FPermanent write FPermanent;
     34    property Down: Boolean read FDown write SetDown;
     35    property Permanent: Boolean read FPermanent write FPermanent;
    3536    property OnClick: TNotifyEvent read ClickProc write ClickProc;
    3637    property OnDownChanged: TNotifyEvent read DownChangedProc
     
    4950  // FUpSound:='';
    5051  FGraphic := nil;
    51   Active := false;
    52   FDown := false;
    53   FPermanent := false;
     52  Active := False;
     53  FDown := False;
     54  FPermanent := False;
    5455  ClickProc := nil;
    5556end;
    5657
    5758procedure TButtonBase.MouseDown(Button: TMouseButton; Shift: TShiftState;
    58   x, y: integer);
     59  X, Y: Integer);
    5960begin
    60   Active := true;
    61   MouseMove(Shift, x, y)
     61  Active := True;
     62  MouseMove(Shift, X, Y);
    6263end;
    6364
    6465procedure TButtonBase.MouseUp(Button: TMouseButton; Shift: TShiftState;
    65   x, y: integer);
     66  X, Y: Integer);
    6667begin
    6768  if ssLeft in Shift then
    68     exit;
    69   MouseMove(Shift, x, y);
     69    Exit;
     70  MouseMove(Shift, X, Y);
    7071  if Active and FDown then
    7172  begin
    7273    // PlayUpSound;
    73     Active := false;
     74    Active := False;
    7475    if FDown <> FPermanent then
    7576    begin
     
    8586  begin
    8687    // if FDown then PlayUpSound;
    87     Active := false;
     88    Active := False;
    8889    if FDown then
    8990    begin
    90       FDown := false;
     91      FDown := False;
    9192      Invalidate;
    9293      if @DownChangedProc <> nil then
    9394        DownChangedProc(self);
    9495    end;
    95   end
     96  end;
    9697end;
    9798
    98 procedure TButtonBase.MouseMove(Shift: TShiftState; x, y: integer);
     99procedure TButtonBase.MouseMove(Shift: TShiftState; X, Y: Integer);
    99100begin
    100101  if Active then
    101     if (x >= 0) and (x < Width) and (y >= 0) and (y < Height) then
     102    if (X >= 0) and (X < Width) and (Y >= 0) and (Y < Height) then
    102103      if (ssLeft in Shift) and not FDown then
    103104      begin
    104105        { PlayDownSound; }
    105         FDown := true;
     106        FDown := True;
    106107        Paint;
    107108        if @DownChangedProc <> nil then
     
    112113    begin
    113114      { PlayUpSound; }
    114       FDown := false;
     115      FDown := False;
    115116      Paint;
    116117      if @DownChangedProc <> nil then
     
    119120end;
    120121
    121 procedure TButtonBase.SetDown(x: boolean);
     122procedure TButtonBase.SetDown(X: Boolean);
    122123begin
    123   FDown := x;
     124  FDown := X;
    124125  Invalidate;
    125126end;
Note: See TracChangeset for help on using the changeset viewer.