Changeset 611 for trunk/LocalPlayer


Ignore:
Timestamp:
Sep 13, 2024, 8:35:17 PM (2 months ago)
Author:
chronos
Message:
  • Modified: Scroll just by single row with mouse wheel in tile units list.
Location:
trunk/LocalPlayer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/PVSB.pas

    r610 r611  
    2727  public
    2828    ScrollBar: TScrollBar;
     29    WheelSteps: Integer;
    2930    constructor Create(Parent: TWinControl);
    3031    destructor Destroy; override;
     
    106107  NewPos: Integer;
    107108begin
    108     if Max < ScrollBar.PageSize then Result := False
    109     else begin
    110       NewPos := ScrollBar.Position - Delta div 30;
    111       if NewPos < 0 then NewPos := 0;
    112       if NewPos > Max - ScrollBar.PageSize + 1 then
    113         NewPos := Max - ScrollBar.PageSize + 1;
    114       Result := NewPos <> ScrollBar.Position;
    115       if NewPos <> ScrollBar.Position then begin
    116         ScrollBar.Position := NewPos;
    117       end;
     109  if Max < ScrollBar.PageSize then Result := False
     110  else begin
     111    NewPos := ScrollBar.Position - Delta div (120 div WheelSteps);
     112    if NewPos < 0 then NewPos := 0;
     113    if NewPos > Max - ScrollBar.PageSize + 1 then
     114      NewPos := Max - ScrollBar.PageSize + 1;
     115    Result := NewPos <> ScrollBar.Position;
     116    if NewPos <> ScrollBar.Position then begin
     117      ScrollBar.Position := NewPos;
    118118    end;
     119  end;
    119120end;
    120121
     
    190191  ScrollBar.Parent := Parent;
    191192  ScrollBar.Width := 16;
     193  WheelSteps := 4;
    192194end;
    193195
  • trunk/LocalPlayer/Term.pas

    r610 r611  
    17441744
    17451745  VerticalScrollBar := TPVScrollbar.Create(Self);
     1746  VerticalScrollBar.WheelSteps := 1;
    17461747  VerticalScrollBar.OnUpdate := ScrollBarUpdate;
    17471748end;
Note: See TracChangeset for help on using the changeset viewer.