Ignore:
Timestamp:
May 9, 2020, 4:02:07 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved HighDPI branch. Imported new changes from trunk branch.
File:
1 edited

Legend:

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

    r179 r210  
    44
    55uses
    6   ButtonBase, Classes, Graphics, LCLIntf, LCLType, UDpiControls;
     6  UDpiControls, ButtonBase, Classes, Graphics, LCLIntf, LCLType, ScreenTools;
    77
    88type
     
    1111  private
    1212    FIndex: Integer;
    13     procedure SetIndex(x: Integer);
     13    procedure SetIndex(Text: Integer);
    1414  published
    1515    property Visible;
     
    2222procedure Register;
    2323
     24
    2425implementation
    2526
    2627procedure Register;
    2728begin
    28   RegisterComponents('Samples', [TButtonC]);
     29  RegisterComponents('C-evo', [TButtonC]);
    2930end;
    3031
     
    4041  with Canvas do
    4142    if FGraphic <> nil then
    42       DpiBitBlt(Canvas.Handle, 0, 0, 12, 12, FGraphic.Canvas.Handle,
    43         169 + 13 * Byte(FDown), 159 + 13 * FIndex, SRCCOPY)
     43      DpiBitCanvas(Canvas, 0, 0, 12, 12, FGraphic.Canvas,
     44        169 + 13 * Byte(FDown), 159 + 13 * FIndex)
    4445    else
    4546    begin
    4647      Brush.Color := $0000FF;
    4748      FrameRect(Rect(0, 0, 12, 12))
    48     end
     49    end;
    4950end;
    5051
    51 procedure TButtonC.SetIndex(x: integer);
     52procedure TButtonC.SetIndex(Text: integer);
    5253begin
    53   if x <> FIndex then
     54  if Text <> FIndex then
    5455  begin
    55     FIndex := x;
     56    FIndex := Text;
    5657    Invalidate;
    5758  end;
Note: See TracChangeset for help on using the changeset viewer.