MG: implemented TControlScrollBar.Size

git-svn-id: trunk@3596 -
This commit is contained in:
lazarus 2002-10-31 21:29:47 +00:00
parent 8a926e3017
commit 678e5f14c0
2 changed files with 24 additions and 2 deletions

View File

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

View File

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