LCL: don't switch width and height when loading the scrolbar (bug #7993)

git-svn-id: trunk@10348 -
This commit is contained in:
vincents 2006-12-22 10:33:15 +00:00
parent e2cfe24165
commit 18f0b57565

View File

@ -83,22 +83,18 @@ var
begin
if FKind <> Value then begin
FKind := Value;
// switch width and height
OldWidth:=Width;
OldHeight:=Height;
if csLoading in ComponentState then begin
if ReadBounds.Right>ReadBounds.Left then
OldWidth:=ReadBounds.Right-ReadBounds.Left;
if ReadBounds.Bottom>ReadBounds.Top then
OldHeight:=ReadBounds.Bottom-ReadBounds.Top;
//debugln('TCustomScrollBar.SetKind ',DbgSName(Self),' ',dbgs(ReadBounds),' OldWidth=',dbgs(OldWidth),' OldHeight=',dbgs(OldHeight));
// switch width and height, but not when loading, because we assume that
// the lfm contains a consistent combination of kind and (width, height)
if not (csLoading in ComponentState) then begin
OldWidth:=Width;
OldHeight:=Height;
// TODO: Remove RecreateWnd
if HandleAllocated then
RecreateWnd(Self)
else
Constraints.UpdateInterfaceConstraints;
SetBounds(Left,Top,OldHeight,OldWidth);
end;
// TODO: Remove RecreateWnd
if HandleAllocated then
RecreateWnd(Self)
else
Constraints.UpdateInterfaceConstraints;
SetBounds(Left,Top,OldHeight,OldWidth);
end;
end;