lcl: fix wrong scrollbar height calculation

git-svn-id: trunk@51460 -
This commit is contained in:
ondrej 2016-01-30 19:31:46 +00:00
parent 95534c8596
commit eecbb6f2ed
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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;