mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 08:30:58 +02:00
lcl: newautosize: fixed beginformupdate
git-svn-id: trunk@23851 -
This commit is contained in:
parent
b4dee09450
commit
108c4be5b8
@ -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}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user