Changeset 463 for branches/highdpi/Packages/CevoComponents/EOTButton.pas
- Timestamp:
- Nov 29, 2023, 2:35:44 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/CevoComponents/EOTButton.pas
r349 r463 19 19 constructor Create(aOwner: TComponent); override; 20 20 destructor Destroy; override; 21 procedure SetButtonIndexFast( x: integer);22 procedure SetBack(ca: TDpiCanvas; x, y: integer);21 procedure SetButtonIndexFast(X: Integer); 22 procedure SetBack(ca: TDpiCanvas; X, Y: Integer); 23 23 private 24 24 FTemplate: TDpiBitmap; 25 FIndex: integer;26 procedure SetIndex( x: integer);25 FIndex: Integer; 26 procedure SetIndex(X: Integer); 27 27 public 28 28 property Template: TDpiBitmap read FTemplate write FTemplate; 29 29 published 30 30 property Visible; 31 property ButtonIndex: integer read FIndex write SetIndex;31 property ButtonIndex: Integer read FIndex write SetIndex; 32 32 property OnClick; 33 33 protected … … 60 60 Back.SetSize(48, 48); 61 61 Back.Canvas.FillRect(0, 0, Back.Width, Back.Height); 62 ShowHint := true;62 ShowHint := True; 63 63 SetBounds(0, 0, 48, 48); 64 64 end; … … 76 76 if FGraphic <> nil then begin 77 77 UnshareBitmap(Buffer); 78 DpiBit Canvas(Buffer.Canvas, 0, 0, 48, 48, Back.Canvas, 0, 0);78 DpiBitBltCanvas(Buffer.Canvas, 0, 0, 48, 48, Back.Canvas, 0, 0); 79 79 ImageOp_CBC(Buffer, Template, 0, 0, 133, 149 + 48 * Byte(FDown), 48, 48, 80 80 $000000, $FFFFFF); … … 82 82 ImageOp_CBC(Buffer, Template, 8, 8, 1 + 32 * Byte(FIndex), 246, 32, 32, 83 83 $000000, $FFFFFF); 84 DpiBit Canvas(Canvas, 0, 0, 48, 48, Buffer.Canvas, 0, 0);84 DpiBitBltCanvas(Canvas, 0, 0, 48, 48, Buffer.Canvas, 0, 0); 85 85 end else begin 86 86 Brush.Color := $0000FF; … … 89 89 end; 90 90 91 procedure TEOTButton.SetIndex( x: integer);91 procedure TEOTButton.SetIndex(X: Integer); 92 92 begin 93 if x<> FIndex then begin94 FIndex := x;93 if X <> FIndex then begin 94 FIndex := X; 95 95 Invalidate; 96 96 end; 97 97 end; 98 98 99 procedure TEOTButton.SetButtonIndexFast( x: integer);99 procedure TEOTButton.SetButtonIndexFast(X: Integer); 100 100 begin 101 if Visible and ( x<> FIndex) then begin102 FIndex := x;101 if Visible and (X <> FIndex) then begin 102 FIndex := X; 103 103 try 104 104 Paint; … … 108 108 end; 109 109 110 procedure TEOTButton.SetBack(ca: TDpiCanvas; x, y: integer);110 procedure TEOTButton.SetBack(ca: TDpiCanvas; X, Y: Integer); 111 111 begin 112 DpiBit Canvas(Back.Canvas, 0, 0, 48, 48, ca, x, y);112 DpiBitBltCanvas(Back.Canvas, 0, 0, 48, 48, ca, X, Y); 113 113 end; 114 114
Note:
See TracChangeset
for help on using the changeset viewer.