lcl: newautosize: fixed beginformupdate

git-svn-id: trunk@23851 -
This commit is contained in:
mattias 2010-03-06 23:29:14 +00:00
parent b4dee09450
commit 108c4be5b8
3 changed files with 16 additions and 3 deletions

View File

@ -3176,10 +3176,14 @@ procedure TControl.FormEndUpdated;
// called when control is on a form and EndFormUpdate reached 0 // called when control is on a form and EndFormUpdate reached 0
// it is called recursively // it is called recursively
begin begin
{$IFDEF NewAutoSize}
{$ELSE}
if cfOnResizeNeeded in FControlFlags then if cfOnResizeNeeded in FControlFlags then
Resize; Resize;
if cfOnChangeBoundsNeeded in FControlFlags then if cfOnChangeBoundsNeeded in FControlFlags then
CheckOnChangeBounds; CheckOnChangeBounds;
{$ENDIF}
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -4779,7 +4783,10 @@ begin
if FAutoSizingLockCount=1 then if FAutoSizingLockCount=1 then
begin begin
if Parent<>nil then if Parent<>nil then
begin
DebugLn(['TControl.DisableAutoSizing ',DbgSName(Self),' disable Parent=',DbgSName(Parent)]);
Parent.DisableAutoSizing; Parent.DisableAutoSizing;
end;
end; end;
{$ELSE} {$ELSE}
inc(FAutoSizingLockCount); inc(FAutoSizingLockCount);
@ -4787,6 +4794,7 @@ begin
end; end;
procedure TControl.EnableAutoSizing; procedure TControl.EnableAutoSizing;
{$IFNDEF NewAutoSize} {$IFNDEF NewAutoSize}
procedure AdjustSizeRecursive(AControl: TControl); procedure AdjustSizeRecursive(AControl: TControl);
var var
@ -4812,8 +4820,10 @@ begin
if (FAutoSizingLockCount=0) then if (FAutoSizingLockCount=0) then
begin begin
if (Parent<>nil) then if (Parent<>nil) then
Parent.EnableAutoSizing begin
else DebugLn(['TControl.EnableAutoSizing ',DbgSName(Self),' enable Parent ',DbgSName(Parent)]);
Parent.EnableAutoSizing;
end else
DoAllAutoSize; DoAllAutoSize;
end; end;
{$ELSE} {$ELSE}

View File

@ -2219,7 +2219,8 @@ procedure TCustomForm.BeginFormUpdate;
begin begin
inc(FFormUpdateCount); inc(FFormUpdateCount);
{$IFDEF NewAutoSize} {$IFDEF NewAutoSize}
DisableAutoSizing; if FFormUpdateCount=1 then
DisableAutoSizing;
{$ENDIF} {$ENDIF}
end; end;

View File

@ -5830,6 +5830,7 @@ begin
if AControl.FAutoSizingLockCount>0 then if AControl.FAutoSizingLockCount>0 then
begin begin
// the AControl has disabled autosizing => disable it for the parent=self too // the AControl has disabled autosizing => disable it for the parent=self too
DebugLn(['TWinControl.Insert ',DbgSName(Self),' Control=',DbgSName(AControl),' disable Parent']);
DisableAutoSizing; DisableAutoSizing;
end; end;
{$ENDIF} {$ENDIF}
@ -5879,6 +5880,7 @@ begin
begin begin
// AControl has disabled autosizing and thus for its parent=Self too // AControl has disabled autosizing and thus for its parent=Self too
// end disable autosize for parent=self // end disable autosize for parent=self
DebugLn(['TWinControl.Remove ',DbgSName(Self),' Control=',DbgSName(AControl),' enable Parent']);
EnableAutoSizing; EnableAutoSizing;
end; end;
{$ENDIF} {$ENDIF}