mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 07:08:21 +02:00
MG: implemented TControlScrollBar.Size
git-svn-id: trunk@3596 -
This commit is contained in:
parent
8a926e3017
commit
678e5f14c0
@ -78,8 +78,10 @@ type
|
||||
FSmooth : Boolean;
|
||||
FVisible: Boolean;
|
||||
|
||||
function GetSize: integer;
|
||||
procedure SetPosition(Value: Integer);
|
||||
procedure SetRange(Value: Integer);
|
||||
procedure SetSize(const AValue: integer);
|
||||
procedure SetSmooth(Value: Boolean);
|
||||
procedure SetVisible(Value: Boolean);
|
||||
protected
|
||||
@ -98,6 +100,7 @@ type
|
||||
property Smooth : Boolean read FSmooth write SetSmooth;// default True
|
||||
property Position: Integer read FPosition write SetPosition default 0;
|
||||
property Range: Integer read FRange write SetRange default 0;
|
||||
property Size: integer read GetSize write SetSize stored false;
|
||||
property Visible: Boolean read FVisible write SetVisible;// default True;
|
||||
end;
|
||||
|
||||
|
@ -69,6 +69,20 @@ begin
|
||||
FControl.UpdateScrollBars;
|
||||
end;
|
||||
|
||||
function TControlScrollBar.GetSize: integer;
|
||||
var
|
||||
KindID: integer;
|
||||
begin
|
||||
if Kind=sbHorizontal then
|
||||
KindID:=SM_CXHSCROLL
|
||||
else
|
||||
KindID:=SM_CXVSCROLL;
|
||||
if (FControl<>nil) and (FControl.HandleAllocated) then
|
||||
Result:=LCLLinux.GetScrollBarSize(FControl.Handle,KindID)
|
||||
else
|
||||
Result:=GetSystemMetrics(KindID);
|
||||
end;
|
||||
|
||||
procedure TControlScrollBar.SetRange(Value: Integer);
|
||||
begin
|
||||
If Value < 0 then begin
|
||||
@ -80,6 +94,11 @@ begin
|
||||
FControl.UpdateScrollBars;
|
||||
end;
|
||||
|
||||
procedure TControlScrollBar.SetSize(const AValue: integer);
|
||||
begin
|
||||
// ToDo
|
||||
end;
|
||||
|
||||
procedure TControlScrollBar.SetVisible(Value: Boolean);
|
||||
begin
|
||||
if FVisible = Value then exit;
|
||||
@ -153,7 +172,7 @@ var
|
||||
|
||||
if Visible then begin
|
||||
If (FControl <> nil) and (FControl.HorzScrollBar.Visible) then
|
||||
SBSize := GetSystemMetrics(SM_CXHSCROLL)
|
||||
SBSize := FControl.HorzScrollBar.Size
|
||||
else
|
||||
SBSize := 0;
|
||||
FAutoRange := (Range - ClientHeight)*Shortint(Range >= ClientHeight + SBSize);
|
||||
@ -181,7 +200,7 @@ var
|
||||
|
||||
if Visible then begin
|
||||
If (FControl <> nil) and (FControl.VertScrollBar.Visible) then
|
||||
SBSize := GetSystemMetrics(SM_CYVSCROLL)
|
||||
SBSize := FControl.VertScrollBar.Size
|
||||
else
|
||||
SBSize := 0;
|
||||
FAutoRange := (Range - ClientWidth)*Shortint(Range >= ClientWidth + SBSize);
|
||||
|
Loading…
Reference in New Issue
Block a user