mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 03:48:27 +02:00
LCL: debugging ifdefs
git-svn-id: trunk@45054 -
This commit is contained in:
parent
5992cb80f4
commit
fe40c7c022
@ -2837,9 +2837,9 @@ procedure TControl.DoAllAutoSize;
|
||||
end;
|
||||
|
||||
function CallAllOnResize(AControl: TControl): boolean;
|
||||
// the OnResize event is called for Delphi compatibility after child resizes
|
||||
// call all OnResize events so they will probably only invoke one more
|
||||
// loop, instead of one per OnResize
|
||||
// The OnResize event is called for Delphi compatibility after child resizes.
|
||||
// Call all OnResize events so they will hopefully only invoke one more
|
||||
// loop, instead of one per OnResize.
|
||||
var
|
||||
AWinControl: TWinControl;
|
||||
i: Integer;
|
||||
@ -2852,6 +2852,9 @@ procedure TControl.DoAllAutoSize;
|
||||
for i := 0 to AWinControl.ControlCount - 1 do
|
||||
if AWinControl.Controls[i].IsControlVisible and not CallAllOnResize(AWinControl.Controls[i]) then Exit;
|
||||
end;
|
||||
{$IFDEF VerboseOnResize}
|
||||
debugln(['TControl.DoAllAutoSize ',DbgSName(AControl),' calling Resize ...']);
|
||||
{$ENDIF}
|
||||
AControl.Resize;
|
||||
Result := True;
|
||||
end;
|
||||
@ -3594,6 +3597,9 @@ procedure TControl.LoadedAll;
|
||||
begin
|
||||
AdjustSize;
|
||||
|
||||
{$IFDEF VerboseOnResize}
|
||||
debugln(['TControl.LoadedAll ',DbgSName(Self),' calling Resize ...']);
|
||||
{$ENDIF}
|
||||
Resize;
|
||||
CheckOnChangeBounds;
|
||||
end;
|
||||
|
@ -3658,10 +3658,9 @@ begin
|
||||
if not CompareRect(@R, @FAdjustClientRectRealized) then
|
||||
begin
|
||||
// client rect changed since last AlignControl
|
||||
{$IF defined(VerboseAllAutoSize) or defined(VerboseClientRectBugFix) or defined(VerboseIntfSizing)}
|
||||
DebugLn('TWinControl.DoAdjustClientRectChange ClientRect changed ',Name,':',ClassName,
|
||||
' Old=',Dbgs(FAdjustClientRectRealized.Right),'x',DbgS(FAdjustClientRectRealized.Bottom),
|
||||
' New=',DbgS(r.Right),'x',DbgS(r.Bottom));
|
||||
{$IF defined(VerboseAllAutoSize) or defined(VerboseClientRectBugFix) or defined(VerboseIntfSizing) or defined(VerboseOnResize)}
|
||||
DebugLn(['TWinControl.DoAdjustClientRectChange ClientRect changed ',DbgSName(Self),
|
||||
' Old=',Dbgs(FAdjustClientRectRealized),' New=',DbgS(R)]);
|
||||
{$ENDIF}
|
||||
FAdjustClientRectRealized := R;
|
||||
AdjustSize;
|
||||
@ -7499,6 +7498,9 @@ begin
|
||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InitializeWnd'){$ENDIF};
|
||||
end;
|
||||
// send pending OnResize
|
||||
{$IFDEF VerboseOnResize}
|
||||
debugln(['TWinControl.InitializeWnd ',DbgSName(Self),' calling Resize ...']);
|
||||
{$ENDIF}
|
||||
Resize;
|
||||
end;
|
||||
|
||||
@ -8270,22 +8272,26 @@ begin
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF VerboseIntfSizing}
|
||||
if (Visible) then begin
|
||||
if Visible then begin
|
||||
DebugLn('[TWinControl.DoSendBoundsToInterface] A ',DbgSName(Self),
|
||||
' OldRelBounds=',dbgs(FBoundsRealized),
|
||||
' -> NewBounds=',dbgs(NewBounds));
|
||||
end;
|
||||
{$ENDIF}
|
||||
FBoundsRealized := NewBounds;
|
||||
OldClientRect := ClientRect;
|
||||
OldClientRect := ClientRect; // during a resize this is the anticipated new ClientRect
|
||||
Include(FWinControlFlags, wcfBoundsRealized); // Note: set before calling widgetset, because used in WMSize
|
||||
//if Parent=nil then DebugLn(['TWinControl.DoSendBoundsToInterface ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
||||
// this can trigger WMSize messages
|
||||
TWSWinControlClass(WidgetSetClass).SetBounds(Self, Left, Top, Width, Height);
|
||||
NewClientRect := ClientRect;
|
||||
if not CompareRect(@OldClientRect,@NewClientRect) then
|
||||
if Visible and (not CompareRect(@OldClientRect,@NewClientRect)) then
|
||||
begin
|
||||
// the widgetset has changed the clientrect
|
||||
// the widgetset has changed the clientrect in an unexpected way
|
||||
{$IFDEF VerboseIntfSizing}
|
||||
debugln(['TWinControl.DoSendBoundsToInterface WS has changed ClientRect in an unexpected way: ',
|
||||
DbgSName(Self),' Bounds=',dbgs(BoundsRect),' ExpectedClientRect=',dbgs(OldClientRect),' New=',dbgs(NewClientRect)]);
|
||||
{$ENDIF}
|
||||
//DebugLn(['TWinControl.DoSendBoundsToInterface ',DbgSName(Self),' Bounds=',dbgs(BoundsRect),' OldClientRect=',dbgs(OldClientRect),' NewClientRect=',dbgs(NewClientRect)]);
|
||||
AdjustSize;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user