Ignore:
Timestamp:
May 9, 2020, 4:02:07 PM (4 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/ButtonN.pas

    r180 r210  
    44
    55uses
    6   Classes, Graphics, Controls, LCLIntf, LCLType, UDpiControls;
     6  UDpiControls, Classes, Graphics, Controls, LCLIntf, LCLType, ScreenTools;
    77
    88type
    9   TButtonN = class(TGraphicControl)
     9  TButtonN = class(TDpiGraphicControl)
    1010    constructor Create(aOwner: TComponent); override;
    1111  private
     
    4040procedure Register;
    4141begin
    42   RegisterComponents('Samples', [TButtonN]);
     42  RegisterComponents('C-evo', [TButtonN]);
    4343end;
    4444
     
    6262    if FGraphic <> nil then
    6363    begin
    64       DpiBitBlt(Canvas.Handle, 1, 1, 40, 40, FBackGraphic.Canvas.Handle,
    65         1 + 80 * BackIndex + 40 * byte(FPossible and FLit), 176, SRCCOPY);
     64      DpiBitCanvas(Canvas, 1, 1, 40, 40, FBackGraphic.Canvas,
     65        1 + 80 * BackIndex + 40 * byte(FPossible and FLit), 176);
    6666      if FPossible then
    6767      begin
    68         DpiBitBlt(Canvas.Handle, 3, 3, 36, 36, FMask.Canvas.Handle,
     68        DpiBitCanvas(Canvas, 3, 3, 36, 36, FMask.Canvas,
    6969          195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCAND);
    70         DpiBitBlt(Canvas.Handle, 3, 3, 36, 36, FGraphic.Canvas.Handle,
     70        DpiBitCanvas(Canvas, 3, 3, 36, 36, FGraphic.Canvas,
    7171          195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCPAINT);
    72       end
     72      end;
    7373    end;
    7474    MoveTo(0, 41);
     
    7979    LineTo(41, 41);
    8080    LineTo(0, 41);
    81   end
     81  end;
    8282end;
    8383
     
    8686begin
    8787  if FPossible and (Button = mbLeft) and (@ChangeProc <> nil) then
    88     ChangeProc(Self)
     88    ChangeProc(Self);
    8989end;
    9090
     
    9898    else
    9999      Hint := '';
    100     Invalidate
    101   end
     100    Invalidate;
     101  end;
    102102end;
    103103
     
    107107  begin
    108108    FLit := x;
    109     Invalidate
    110   end
     109    Invalidate;
     110  end;
    111111end;
    112112
     
    120120    else
    121121      BackIndex := 0;
    122     Invalidate
    123   end
     122    Invalidate;
     123  end;
    124124end;
    125125
     
    131131    if FPossible then
    132132      Hint := x;
    133   end
     133  end;
    134134end;
    135135
Note: See TracChangeset for help on using the changeset viewer.