Changeset 178 for branches/highdpi/Packages/CevoComponents/ButtonA.pas
- Timestamp:
- Jun 23, 2019, 3:15:29 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/CevoComponents/ButtonA.pas
r165 r178 5 5 uses 6 6 ButtonBase, 7 Classes, Graphics, LCLIntf, LCLType ;7 Classes, Graphics, LCLIntf, LCLType, UDpiControls; 8 8 9 9 type … … 13 13 FCaption: string; 14 14 procedure SetCaption(x: string); 15 procedure SetFont(const x: T Font);15 procedure SetFont(const x: TDpiFont); 16 16 published 17 17 property Visible; … … 19 19 property OnClick; 20 20 public 21 property Font: T Font write SetFont;21 property Font: TDpiFont write SetFont; 22 22 protected 23 23 procedure Paint; override; … … 30 30 procedure Register; 31 31 begin 32 RegisterComponents(' C-evo', [TButtonA]);32 RegisterComponents('Samples', [TButtonA]); 33 33 end; 34 34 … … 43 43 begin 44 44 with Canvas do 45 if FGraphic <> nil then 46 begin 47 BitBlt(Canvas.Handle, 0, 0, 100, 25, Graphic.Canvas.Handle, 195, 45 if FGraphic <> nil then begin 46 DpiBitBlt(Canvas.Handle, 0, 0, 100, 25, Graphic.Canvas.Handle, 195, 48 47 243 + 26 * Byte(Down), SRCCOPY); 49 48 Canvas.Brush.Style := bsClear; 50 Text out(50 - (TextWidth(FCaption) + 1) div 2, 12 - textheight(FCaption)49 TextOut(50 - (TextWidth(FCaption) + 1) div 2, 12 - TextHeight(FCaption) 51 50 div 2, FCaption); 52 end 53 else 54 begin 51 end else begin 55 52 Brush.Color := $0000FF; 56 53 FrameRect(Rect(0, 0, 100, 25)) … … 67 64 end; 68 65 69 procedure TButtonA.SetFont(const x: T Font);66 procedure TButtonA.SetFont(const x: TDpiFont); 70 67 begin 71 68 Canvas.Font.Assign(x);
Note:
See TracChangeset
for help on using the changeset viewer.