diff --git a/lcl/include/control.inc b/lcl/include/control.inc index ba8b8e5cf4..db2975fcc7 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -3176,10 +3176,14 @@ procedure TControl.FormEndUpdated; // called when control is on a form and EndFormUpdate reached 0 // it is called recursively begin + {$IFDEF NewAutoSize} + + {$ELSE} if cfOnResizeNeeded in FControlFlags then Resize; if cfOnChangeBoundsNeeded in FControlFlags then CheckOnChangeBounds; + {$ENDIF} end; {------------------------------------------------------------------------------ @@ -4779,7 +4783,10 @@ begin if FAutoSizingLockCount=1 then begin if Parent<>nil then + begin + DebugLn(['TControl.DisableAutoSizing ',DbgSName(Self),' disable Parent=',DbgSName(Parent)]); Parent.DisableAutoSizing; + end; end; {$ELSE} inc(FAutoSizingLockCount); @@ -4787,6 +4794,7 @@ begin end; procedure TControl.EnableAutoSizing; + {$IFNDEF NewAutoSize} procedure AdjustSizeRecursive(AControl: TControl); var @@ -4812,8 +4820,10 @@ begin if (FAutoSizingLockCount=0) then begin if (Parent<>nil) then - Parent.EnableAutoSizing - else + begin + DebugLn(['TControl.EnableAutoSizing ',DbgSName(Self),' enable Parent ',DbgSName(Parent)]); + Parent.EnableAutoSizing; + end else DoAllAutoSize; end; {$ELSE} diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index baf4357780..174f533bb9 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -2219,7 +2219,8 @@ procedure TCustomForm.BeginFormUpdate; begin inc(FFormUpdateCount); {$IFDEF NewAutoSize} - DisableAutoSizing; + if FFormUpdateCount=1 then + DisableAutoSizing; {$ENDIF} end; diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index a88c6663e5..f644ed185e 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -5830,6 +5830,7 @@ begin if AControl.FAutoSizingLockCount>0 then begin // the AControl has disabled autosizing => disable it for the parent=self too + DebugLn(['TWinControl.Insert ',DbgSName(Self),' Control=',DbgSName(AControl),' disable Parent']); DisableAutoSizing; end; {$ENDIF} @@ -5879,6 +5880,7 @@ begin begin // AControl has disabled autosizing and thus for its parent=Self too // end disable autosize for parent=self + DebugLn(['TWinControl.Remove ',DbgSName(Self),' Control=',DbgSName(AControl),' enable Parent']); EnableAutoSizing; end; {$ENDIF}