LCL: fixed updating pending AutoSize requests after EableAutoSizing

git-svn-id: trunk@12681 -
This commit is contained in:
mattias 2007-11-01 15:42:48 +00:00
parent 1a09783017
commit e258ad4d35
2 changed files with 19 additions and 4 deletions

View File

@ -297,6 +297,7 @@ begin
end;
end;
inherited WSSetText(AText);
//DebugLn(['TCustomButton.WSSetText ',dbgsName(Self),' Caption="',Caption,'" AutoSizeCanStart=',AutoSizeCanStart,' AutoSizeDelayed=',AutoSizeDelayed]);
AdjustSize;
end;

View File

@ -4242,13 +4242,27 @@ begin
end;
procedure TControl.EnableAutoSizing;
procedure AdjustSizeRecursive(AControl: TControl);
var
AWinControl: TWinControl;
i: Integer;
begin
if cfAutoSizeNeeded in AControl.FControlFlags then
AControl.AdjustSize;
if AControl is TWinControl then begin
AWinControl:=TWinControl(AControl);
if AWincontrol.FWinControls<>nil then
for i:=0 to AWincontrol.FWinControls.Count-1 do
AdjustSizeRecursive(TControl(AWincontrol.FWinControls[i]));
end;
end;
begin
if FAutoSizingLockCount<=0 then RaiseGDBException('TControl.EnableAutoSizing');
dec(FAutoSizingLockCount);
if FAutoSizingLockCount=0 then begin
if cfAutoSizeNeeded in FControlFlags then
AdjustSize;
end;
if FAutoSizingLockCount=0 then
AdjustSizeRecursive(Self);
end;
procedure TControl.EndAutoSizing;