mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-07 11:57:15 +01:00
lcl: fix wrong scrollbar height calculation
git-svn-id: trunk@51460 -
This commit is contained in:
parent
95534c8596
commit
eecbb6f2ed
@ -131,6 +131,7 @@ type
|
||||
property Kind: TScrollBarKind read FKind;
|
||||
function GetOtherScrollBar: TControlScrollBar;
|
||||
property Size: integer read GetSize stored False;
|
||||
function ControlSize: integer; // return for vertical scrollbar the control width
|
||||
function ClientSize: integer; // return for vertical scrollbar the clientwidth
|
||||
function ClientSizeWithBar: integer; // return for vertical scrollbar the clientwidth with the bar, even if Visible=false
|
||||
function ClientSizeWithoutBar: integer; // return for vertical scrollbar the clientwidth without the bar, even if Visible=true
|
||||
|
||||
@ -373,6 +373,14 @@ begin
|
||||
Result := FControl.Handle;
|
||||
end;
|
||||
|
||||
function TControlScrollBar.ControlSize: integer;
|
||||
begin
|
||||
if Kind = sbVertical then
|
||||
Result := FControl.Width
|
||||
else
|
||||
Result := FControl.Height;
|
||||
end;
|
||||
|
||||
constructor TControlScrollBar.Create(AControl: TWinControl;
|
||||
AKind: TScrollBarKind);
|
||||
begin
|
||||
@ -448,7 +456,7 @@ function TControlScrollBar.ClientSizeWithoutBar: integer;
|
||||
begin
|
||||
Result:=ClientSize;
|
||||
if IsScrollBarVisible then
|
||||
Result := Min(FControl.Width, Result+GetSize+GetSystemMetrics(SM_SWSCROLLBARSPACING));
|
||||
Result := Min(ControlSize, Result+GetSize+GetSystemMetrics(SM_SWSCROLLBARSPACING));
|
||||
end;
|
||||
|
||||
function TControlScrollBar.GetHorzScrollBar: TControlScrollBar;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user