mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 10:18:15 +02:00
LCL: newautosize: removed debugging
git-svn-id: trunk@23942 -
This commit is contained in:
parent
6a25fc9f94
commit
44d0f22378
@ -2401,18 +2401,24 @@ begin
|
|||||||
if AutoSizingAll then exit;
|
if AutoSizingAll then exit;
|
||||||
fAutoSizingAll:=true;
|
fAutoSizingAll:=true;
|
||||||
if not (Self is TWinControl) then exit;
|
if not (Self is TWinControl) then exit;
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TControl.DoAllAutoSize START ',DbgSName(Self)]);
|
DebugLn(['TControl.DoAllAutoSize START ',DbgSName(Self)]);
|
||||||
|
{$ENDIF}
|
||||||
//writeln(GetStackTrace(true));
|
//writeln(GetStackTrace(true));
|
||||||
try
|
try
|
||||||
while (not AutoSizeDelayed)
|
while (not AutoSizeDelayed)
|
||||||
and (cfAutoSizeNeeded in FControlFlags) do begin
|
and (cfAutoSizeNeeded in FControlFlags) do begin
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TControl.DoAllAutoSize LOOP ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
DebugLn(['TControl.DoAllAutoSize LOOP ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
||||||
|
{$ENDIF}
|
||||||
AutoSizeControl(Self);
|
AutoSizeControl(Self);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
fAutoSizingAll:=false;
|
fAutoSizingAll:=false;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TControl.DoAllAutoSize END ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
DebugLn(['TControl.DoAllAutoSize END ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
@ -3302,9 +3302,13 @@ var
|
|||||||
OldChildBounds: TRect;
|
OldChildBounds: TRect;
|
||||||
begin
|
begin
|
||||||
{$IFDEF NewAutoSize}
|
{$IFDEF NewAutoSize}
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
debugln('TWinControl.DoAutoSize ',DbgSName(Self));
|
debugln('TWinControl.DoAutoSize ',DbgSName(Self));
|
||||||
|
{$ENDIF}
|
||||||
if (not AutoSizeCanStart) or (AutoSizePhase<>caspComputingBounds) then begin
|
if (not AutoSizeCanStart) or (AutoSizePhase<>caspComputingBounds) then begin
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.DoAutoSize DELAYED AutoSizeCanStart=',AutoSizeCanStart,' AutoSizeDelayed=',AutoSizeDelayed,' AutoSizePhase=',AutoSizePhaseNames[AutoSizePhase]]);
|
DebugLn(['TWinControl.DoAutoSize DELAYED AutoSizeCanStart=',AutoSizeCanStart,' AutoSizeDelayed=',AutoSizeDelayed,' AutoSizePhase=',AutoSizePhaseNames[AutoSizePhase]]);
|
||||||
|
{$ENDIF}
|
||||||
Include(FControlFlags,cfAutoSizeNeeded);
|
Include(FControlFlags,cfAutoSizeNeeded);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -3401,8 +3405,8 @@ begin
|
|||||||
PreferredHeight:=Constraints.MinMaxHeight(Height);
|
PreferredHeight:=Constraints.MinMaxHeight(Height);
|
||||||
|
|
||||||
// set new size
|
// set new size
|
||||||
{$IF defined(VerboseAutoSize) or defined(NewAutoSize)}
|
{$IF defined(VerboseAutoSize) or defined(VerboseAllAutoSize)}
|
||||||
debugln(['DoAutoSize A ',DbgSName(Self),' Cur=',Width,'x',Height,' Prefer=',PreferredWidth,'x',PreferredHeight,' WidgetClass=',WidgetSetClass.ClassName,' Fixed=',WidthIsFixed,'x',HeightIsFixed]);
|
debugln(['TWinControl.DoAutoSize A ',DbgSName(Self),' Cur=',Width,'x',Height,' Prefer=',PreferredWidth,'x',PreferredHeight,' WidgetClass=',WidgetSetClass.ClassName,' Fixed=',WidthIsFixed,'x',HeightIsFixed]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if (PreferredWidth<>Width) or (PreferredHeight<>Height) then begin
|
if (PreferredWidth<>Width) or (PreferredHeight<>Height) then begin
|
||||||
// adjust Left/Top as well to reduce auto sizing overhead
|
// adjust Left/Top as well to reduce auto sizing overhead
|
||||||
@ -3451,10 +3455,14 @@ begin
|
|||||||
if wcfAllAutoSizing in FWinControlFlags then exit;
|
if wcfAllAutoSizing in FWinControlFlags then exit;
|
||||||
if AutoSizeDelayed then exit;
|
if AutoSizeDelayed then exit;
|
||||||
|
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.DoAllAutoSize START ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
DebugLn(['TWinControl.DoAllAutoSize START ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
||||||
|
{$ENDIF}
|
||||||
// create needed handles
|
// create needed handles
|
||||||
if HandleObjectShouldBeVisible and (not HandleAllocated) then begin
|
if HandleObjectShouldBeVisible and (not HandleAllocated) then begin
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.DoAllAutoSize CREATE HANDLE ',DbgSName(Self)]);
|
DebugLn(['TWinControl.DoAllAutoSize CREATE HANDLE ',DbgSName(Self)]);
|
||||||
|
{$ENDIF}
|
||||||
HandleNeeded;
|
HandleNeeded;
|
||||||
// creating the handle called DisableAutoSizing/EnableAutoSizing
|
// creating the handle called DisableAutoSizing/EnableAutoSizing
|
||||||
// so after handle creation the autosizing was done
|
// so after handle creation the autosizing was done
|
||||||
@ -3467,19 +3475,27 @@ begin
|
|||||||
while (cfAutoSizeNeeded in FControlFlags)
|
while (cfAutoSizeNeeded in FControlFlags)
|
||||||
and (not AutoSizeDelayed) do begin
|
and (not AutoSizeDelayed) do begin
|
||||||
// compute all sizes for LCL objects without touching the widgetset
|
// compute all sizes for LCL objects without touching the widgetset
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.DoAllAutoSize COMPUTE BOUNDS ',DbgSName(Self),' old=',dbgs(BoundsRect)]);
|
DebugLn(['TWinControl.DoAllAutoSize COMPUTE BOUNDS ',DbgSName(Self),' old=',dbgs(BoundsRect)]);
|
||||||
|
{$ENDIF}
|
||||||
inherited DoAllAutoSize;
|
inherited DoAllAutoSize;
|
||||||
if cfAutoSizeNeeded in FControlFlags then RaiseGDBException('');
|
if cfAutoSizeNeeded in FControlFlags then RaiseGDBException('');
|
||||||
// send all new bounds to widgetset
|
// send all new bounds to widgetset
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.DoAllAutoSize REALIZE BOUNDS ',DbgSName(Self),' lclbounds=',dbgs(BoundsRect)]);
|
DebugLn(['TWinControl.DoAllAutoSize REALIZE BOUNDS ',DbgSName(Self),' lclbounds=',dbgs(BoundsRect)]);
|
||||||
|
{$ENDIF}
|
||||||
RealizeBoundsRecursive;
|
RealizeBoundsRecursive;
|
||||||
// make handles visible
|
// make handles visible
|
||||||
if not (cfAutoSizeNeeded in FControlFlags) then begin
|
if not (cfAutoSizeNeeded in FControlFlags) then begin
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.DoAllAutoSize UPDATESHOWING ',DbgSName(Self),' lclbounds=',dbgs(BoundsRect)]);
|
DebugLn(['TWinControl.DoAllAutoSize UPDATESHOWING ',DbgSName(Self),' lclbounds=',dbgs(BoundsRect)]);
|
||||||
|
{$ENDIF}
|
||||||
UpdateShowingRecursive(Self);
|
UpdateShowingRecursive(Self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.DoAllAutoSize END ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
DebugLn(['TWinControl.DoAllAutoSize END ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
||||||
|
{$ENDIF}
|
||||||
finally
|
finally
|
||||||
Exclude(FWinControlFlags,wcfAllAutoSizing);
|
Exclude(FWinControlFlags,wcfAllAutoSizing);
|
||||||
end;
|
end;
|
||||||
@ -3583,8 +3599,8 @@ begin
|
|||||||
if not CompareRect(@R, @FAdjustClientRectRealized) then
|
if not CompareRect(@R, @FAdjustClientRectRealized) then
|
||||||
begin
|
begin
|
||||||
// client rect changed since last AlignControl
|
// client rect changed since last AlignControl
|
||||||
{$IFDEF NewAutoSize}
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn('UUU TWinControl.DoAdjustClientRectChange ClientRect changed ',Name,':',ClassName,
|
DebugLn('TWinControl.DoAdjustClientRectChange ClientRect changed ',Name,':',ClassName,
|
||||||
' Old=',Dbgs(FAdjustClientRectRealized.Right),'x',DbgS(FAdjustClientRectRealized.Bottom),
|
' Old=',Dbgs(FAdjustClientRectRealized.Right),'x',DbgS(FAdjustClientRectRealized.Bottom),
|
||||||
' New=',DbgS(r.Right),'x',DbgS(r.Bottom));
|
' New=',DbgS(r.Right),'x',DbgS(r.Bottom));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -6632,7 +6648,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// interface widget has resized
|
// interface widget has resized
|
||||||
// -> update position and realized bounds
|
// -> update position and realized bounds
|
||||||
{$IFDEF NewAutoSize}
|
{$IFDEF VerboseAllAutoSize}
|
||||||
DebugLn(['TWinControl.WMSize A ',dbgsname(Self),' Message=',Message.Width,',',Message.Height,
|
DebugLn(['TWinControl.WMSize A ',dbgsname(Self),' Message=',Message.Width,',',Message.Height,
|
||||||
' BoundsRealized=',dbgs(FBoundsRealized),' FromIntf=',(Message.SizeType and Size_SourceIsInterface)>0,
|
' BoundsRealized=',dbgs(FBoundsRealized),' FromIntf=',(Message.SizeType and Size_SourceIsInterface)>0,
|
||||||
' wcfClientRectNeedsUpdate=',wcfClientRectNeedsUpdate in FWinControlFlags]);
|
' wcfClientRectNeedsUpdate=',wcfClientRectNeedsUpdate in FWinControlFlags]);
|
||||||
@ -7703,7 +7719,7 @@ begin
|
|||||||
NewWidth:=Width-OldClientRect.Right+NewClientWidth;
|
NewWidth:=Width-OldClientRect.Right+NewClientWidth;
|
||||||
NewHeight:=Height-OldClientRect.Bottom+NewClientHeight;
|
NewHeight:=Height-OldClientRect.Bottom+NewClientHeight;
|
||||||
|
|
||||||
{$IF defined(VerboseAutoSize) or defined(NewAutoSize)}
|
{$IF defined(VerboseAutoSize) or defined(VerboseAllAutoSize)}
|
||||||
debugln(['TWinControl.CalculatePreferredSize ',DbgSName(Self),
|
debugln(['TWinControl.CalculatePreferredSize ',DbgSName(Self),
|
||||||
' HandleAllocated=',HandleAllocated,
|
' HandleAllocated=',HandleAllocated,
|
||||||
' Cur=',Width,'x',Height,
|
' Cur=',Width,'x',Height,
|
||||||
|
Loading…
Reference in New Issue
Block a user