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/ButtonN.pas

    r303 r463  
    1010    constructor Create(aOwner: TComponent); override;
    1111  private
    12     FPossible, FLit: boolean;
     12    FPossible, FLit: Boolean;
    1313    FGraphic, FMask, FBackGraphic: TDpiBitmap;
    14     FIndex, BackIndex: integer;
     14    FIndex, BackIndex: Integer;
    1515    FSmartHint: string;
    1616    ChangeProc: TNotifyEvent;
    17     procedure SetPossible(x: boolean);
    18     procedure SetLit(x: boolean);
    19     procedure SetIndex(x: integer);
    20     procedure SetSmartHint(x: string);
     17    procedure SetPossible(X: Boolean);
     18    procedure SetLit(X: Boolean);
     19    procedure SetIndex(X: Integer);
     20    procedure SetSmartHint(X: string);
    2121  published
    22     property Possible: boolean read FPossible write SetPossible;
    23     property Lit: boolean read FLit write SetLit;
     22    property Possible: Boolean read FPossible write SetPossible;
     23    property Lit: Boolean read FLit write SetLit;
    2424    property SmartHint: string read FSmartHint write SetSmartHint;
    2525    property Graphic: TDpiBitmap read FGraphic write FGraphic;
    2626    property Mask: TDpiBitmap read FMask write FMask;
    2727    property BackGraphic: TDpiBitmap read FBackGraphic write FBackGraphic;
    28     property ButtonIndex: integer read FIndex write SetIndex;
     28    property ButtonIndex: Integer read FIndex write SetIndex;
    2929    property OnClick: TNotifyEvent read ChangeProc write ChangeProc;
    3030  protected
    3131    procedure Paint; override;
    3232    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
    33       x, y: integer); override;
     33      X, Y: Integer); override;
    3434  end;
    3535
     
    4646begin
    4747  inherited;
    48   ShowHint := true;
     48  ShowHint := True;
    4949  FGraphic := nil;
    5050  FBackGraphic := nil;
    51   FPossible := true;
    52   FLit := false;
     51  FPossible := True;
     52  FLit := False;
    5353  FIndex := -1;
    5454  ChangeProc := nil;
     
    6262    if FGraphic <> nil then
    6363    begin
    64       DpiBitCanvas(Canvas, 1, 1, 40, 40, FBackGraphic.Canvas,
    65         1 + 80 * BackIndex + 40 * byte(FPossible and FLit), 176);
     64      DpiBitBltCanvas(Canvas, 1, 1, 40, 40, FBackGraphic.Canvas,
     65        1 + 80 * BackIndex + 40 * Byte(FPossible and FLit), 176);
    6666      if FPossible then
    6767      begin
    68         DpiBitCanvas(Canvas, 3, 3, 36, 36, FMask.Canvas,
     68        DpiBitBltCanvas(Canvas, 3, 3, 36, 36, FMask.Canvas,
    6969          195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCAND);
    70         DpiBitCanvas(Canvas, 3, 3, 36, 36, FGraphic.Canvas,
     70        DpiBitBltCanvas(Canvas, 3, 3, 36, 36, FGraphic.Canvas,
    7171          195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCPAINT);
    7272      end;
     
    8383
    8484procedure TButtonN.MouseDown(Button: TMouseButton; Shift: TShiftState;
    85   x, y: integer);
     85  X, Y: Integer);
    8686begin
    8787  if FPossible and (Button = mbLeft) and (@ChangeProc <> nil) then
     
    8989end;
    9090
    91 procedure TButtonN.SetPossible(x: boolean);
     91procedure TButtonN.SetPossible(X: Boolean);
    9292begin
    93   if x <> FPossible then
     93  if X <> FPossible then
    9494  begin
    95     FPossible := x;
    96     if x then
     95    FPossible := X;
     96    if X then
    9797      Hint := FSmartHint
    9898    else
     
    102102end;
    103103
    104 procedure TButtonN.SetLit(x: boolean);
     104procedure TButtonN.SetLit(X: Boolean);
    105105begin
    106   if x <> FLit then
     106  if X <> FLit then
    107107  begin
    108     FLit := x;
     108    FLit := X;
    109109    Invalidate;
    110110  end;
    111111end;
    112112
    113 procedure TButtonN.SetIndex(x: integer);
     113procedure TButtonN.SetIndex(X: Integer);
    114114begin
    115   if x <> FIndex then
     115  if X <> FIndex then
    116116  begin
    117     FIndex := x;
    118     if x < 6 then
     117    FIndex := X;
     118    if X < 6 then
    119119      BackIndex := 1
    120120    else
     
    124124end;
    125125
    126 procedure TButtonN.SetSmartHint(x: string);
     126procedure TButtonN.SetSmartHint(X: string);
    127127begin
    128   if x <> FSmartHint then
     128  if X <> FSmartHint then
    129129  begin
    130     FSmartHint := x;
     130    FSmartHint := X;
    131131    if FPossible then
    132       Hint := x;
     132      Hint := X;
    133133  end;
    134134end;
Note: See TracChangeset for help on using the changeset viewer.