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/LocalPlayer/PVSB.pas

    r172 r178  
    99  {$ENDIF}
    1010  Classes, Controls, Forms, LCLIntf, LCLType, LMessages, Messages, SysUtils,
    11   StdCtrls, Math;
     11  StdCtrls, Math, UDpiControls;
    1212
    1313type
     
    1818  private
    1919    FOnUpdate: TNotifyEvent;
    20     ScrollBar: TScrollBar;
     20    ScrollBar: TDpiScrollBar;
    2121    FMax: Integer;
    2222    function GetMax: Integer;
     
    2828    procedure SetPosition(AValue: Integer);
    2929  public
    30     constructor Create(Parent: TWinControl);
     30    constructor Create(Parent: TDpiWinControl);
    3131    destructor Destroy; override;
    3232    procedure Init(Max, PageSize: Integer);
     
    109109    if Max < ScrollBar.PageSize then Result := False
    110110    else begin
    111       NewPos := ScrollBar.Position - Delta div 30;
     111      NewPos := ScrollBar.Position - Delta div 300;
    112112      if NewPos < 0 then NewPos := 0;
    113113      if NewPos > Max - ScrollBar.PageSize + 1 then
     
    153153begin
    154154  FMax := AValue;
    155   ScrollBar.Max := Math.Max(0, FMax);
     155  ScrollBar.Max := Math.Max(0, Max{$IFDEF LINUX} - PageSize + 1{$ENDIF});
    156156end;
    157157
     
    181181end;
    182182
    183 constructor TPVScrollBar.Create(Parent: TWinControl);
     183constructor TPVScrollBar.Create(Parent: TDpiWinControl);
    184184begin
    185185  Inc(Count);
    186   ScrollBar := TScrollBar.Create(Parent);
     186  ScrollBar := TDpiScrollBar.Create(Parent);
    187187  ScrollBar.Kind := sbVertical;
    188188  ScrollBar.Name := 'PVSB' + IntToStr(Count);
Note: See TracChangeset for help on using the changeset viewer.