lcl: always update scroll visibility when changing other params (fixes #0014494)

git-svn-id: trunk@21568 -
This commit is contained in:
paul 2009-09-04 12:29:34 +00:00
parent bc2f2aa2da
commit bbda022560
2 changed files with 4 additions and 10 deletions

View File

@ -95,7 +95,6 @@ type
FVisible: Boolean;
FOldScrollInfo: TScrollInfo;
FOldScrollInfoValid: Boolean;
FOldHandleVisible: Boolean;
protected
FControl: TWinControl;
function ControlAutoScroll: boolean; virtual;

View File

@ -309,11 +309,7 @@ begin
SetScrollInfo(FControl.Handle, IntfBarKind[Kind], ScrollInfo, FVisible);
end;
NewVisible := Visible and (ScrollInfo.nMax - ScrollInfo.nPage > 0);
if FOldHandleVisible <> NewVisible then
begin
FOldHandleVisible := NewVisible;
ShowScrollBar(FControl.Handle, IntfBarKind[Kind], NewVisible);
end;
ShowScrollBar(FControl.Handle, IntfBarKind[Kind], NewVisible);
{$IFDEF VerboseScrollingWinControl}
if DebugCondition then
DebugLn(['TControlScrollBar.UpdateScrollBar ',DbgSName(FControl),' ',DbgSName(Self),' FVisible=',FVisible,' Range=',FRange,' FPosition=',FPosition,' FPage=',FPage,' FAutoRange=',FAutoRange]);
@ -333,7 +329,7 @@ end;
procedure TControlScrollBar.InvalidateScrollInfo;
begin
FOldScrollInfoValid:=false;
FOldScrollInfoValid := False;
end;
{$ifdef VerboseScrollingWinControl}
@ -401,7 +397,7 @@ end;
function TControlScrollBar.HandleAllocated: boolean;
begin
Result := (FControl<>nil) and (FControl.HandleAllocated);
Result := (FControl <> nil) and FControl.HandleAllocated;
end;
function TControlScrollBar.ControlHandle: HWnd;
@ -421,7 +417,6 @@ begin
FRange := 0;
FSmooth := False;
FVisible := True;
FOldHandleVisible := True;
end;
procedure TControlScrollBar.Assign(Source: TPersistent);
@ -445,7 +440,7 @@ end;
function TControlScrollBar.IsScrollBarVisible: Boolean;
begin
Result := (FControl <> nil) and FControl.HandleAllocated and
(FControl.IsControlVisible) and (Self.Visible);
FControl.IsControlVisible and Visible;
end;
function TControlScrollBar.ScrollPos: Integer;