Ignore:
Timestamp:
Jun 23, 2019, 3:15:29 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Use DpiControls package for High DPI support.
File:
1 edited

Legend:

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

    r165 r178  
    55uses
    66  ButtonBase,
    7   Classes, Graphics, LCLIntf, LCLType;
     7  Classes, Graphics, LCLIntf, LCLType, UDpiControls;
    88
    99type
     
    1313    FCaption: string;
    1414    procedure SetCaption(x: string);
    15     procedure SetFont(const x: TFont);
     15    procedure SetFont(const x: TDpiFont);
    1616  published
    1717    property Visible;
     
    1919    property OnClick;
    2020  public
    21     property Font: TFont write SetFont;
     21    property Font: TDpiFont write SetFont;
    2222  protected
    2323    procedure Paint; override;
     
    3030procedure Register;
    3131begin
    32   RegisterComponents('C-evo', [TButtonA]);
     32  RegisterComponents('Samples', [TButtonA]);
    3333end;
    3434
     
    4343begin
    4444  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,
    4847        243 + 26 * Byte(Down), SRCCOPY);
    4948      Canvas.Brush.Style := bsClear;
    50       Textout(50 - (TextWidth(FCaption) + 1) div 2, 12 - textheight(FCaption)
     49      TextOut(50 - (TextWidth(FCaption) + 1) div 2, 12 - TextHeight(FCaption)
    5150        div 2, FCaption);
    52     end
    53     else
    54     begin
     51    end else begin
    5552      Brush.Color := $0000FF;
    5653      FrameRect(Rect(0, 0, 100, 25))
     
    6764end;
    6865
    69 procedure TButtonA.SetFont(const x: TFont);
     66procedure TButtonA.SetFont(const x: TDpiFont);
    7067begin
    7168  Canvas.Font.Assign(x);
Note: See TracChangeset for help on using the changeset viewer.