* Fixed setting height of vertical scrollbar after loading when handle is not yet created

git-svn-id: trunk@17534 -
This commit is contained in:
marc 2008-11-23 02:21:15 +00:00
parent 62a3b51538
commit b9211d6127

View File

@ -80,21 +80,24 @@ var
OldWidth: Integer; OldWidth: Integer;
OldHeight: Integer; OldHeight: Integer;
begin begin
if FKind <> Value then begin if FKind = Value then Exit;
FKind := Value;
// switch width and height, but not when loading, because we assume that FKind := Value;
// the lfm contains a consistent combination of kind and (width, height)
if not (csLoading in ComponentState) then begin // the InterfaceConstraints need to get updated, even when loading
OldWidth:=Width; OldWidth:=Width;
OldHeight:=Height; OldHeight:=Height;
// TODO: Remove RecreateWnd Constraints.UpdateInterfaceConstraints;
if HandleAllocated then
RecreateWnd(Self) // switch width and height, but not when loading, because we assume that
else // the lfm contains a consistent combination of kind and (width, height)
Constraints.UpdateInterfaceConstraints; if csLoading in ComponentState then Exit;
SetBounds(Left,Top,OldHeight,OldWidth);
end; // TODO: Remove RecreateWnd
end; if HandleAllocated
then RecreateWnd(Self);
SetBounds(Left,Top,OldHeight,OldWidth);
end; end;
procedure TCustomScrollBar.SetParams(APosition, AMin, AMax, APageSize: Integer); procedure TCustomScrollBar.SetParams(APosition, AMin, AMax, APageSize: Integer);