mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 12:39:23 +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;
|
end;
|
||||||
|
|
||||||
function CallAllOnResize(AControl: TControl): boolean;
|
function CallAllOnResize(AControl: TControl): boolean;
|
||||||
// the OnResize event is called for Delphi compatibility after child resizes
|
// The OnResize event is called for Delphi compatibility after child resizes.
|
||||||
// call all OnResize events so they will probably only invoke one more
|
// Call all OnResize events so they will hopefully only invoke one more
|
||||||
// loop, instead of one per OnResize
|
// loop, instead of one per OnResize.
|
||||||
var
|
var
|
||||||
AWinControl: TWinControl;
|
AWinControl: TWinControl;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -2852,6 +2852,9 @@ procedure TControl.DoAllAutoSize;
|
|||||||
for i := 0 to AWinControl.ControlCount - 1 do
|
for i := 0 to AWinControl.ControlCount - 1 do
|
||||||
if AWinControl.Controls[i].IsControlVisible and not CallAllOnResize(AWinControl.Controls[i]) then Exit;
|
if AWinControl.Controls[i].IsControlVisible and not CallAllOnResize(AWinControl.Controls[i]) then Exit;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF VerboseOnResize}
|
||||||
|
debugln(['TControl.DoAllAutoSize ',DbgSName(AControl),' calling Resize ...']);
|
||||||
|
{$ENDIF}
|
||||||
AControl.Resize;
|
AControl.Resize;
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -3594,6 +3597,9 @@ procedure TControl.LoadedAll;
|
|||||||
begin
|
begin
|
||||||
AdjustSize;
|
AdjustSize;
|
||||||
|
|
||||||
|
{$IFDEF VerboseOnResize}
|
||||||
|
debugln(['TControl.LoadedAll ',DbgSName(Self),' calling Resize ...']);
|
||||||
|
{$ENDIF}
|
||||||
Resize;
|
Resize;
|
||||||
CheckOnChangeBounds;
|
CheckOnChangeBounds;
|
||||||
end;
|
end;
|
||||||
|
@ -3658,10 +3658,9 @@ 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
|
||||||
{$IF defined(VerboseAllAutoSize) or defined(VerboseClientRectBugFix) or defined(VerboseIntfSizing)}
|
{$IF defined(VerboseAllAutoSize) or defined(VerboseClientRectBugFix) or defined(VerboseIntfSizing) or defined(VerboseOnResize)}
|
||||||
DebugLn('TWinControl.DoAdjustClientRectChange ClientRect changed ',Name,':',ClassName,
|
DebugLn(['TWinControl.DoAdjustClientRectChange ClientRect changed ',DbgSName(Self),
|
||||||
' Old=',Dbgs(FAdjustClientRectRealized.Right),'x',DbgS(FAdjustClientRectRealized.Bottom),
|
' Old=',Dbgs(FAdjustClientRectRealized),' New=',DbgS(R)]);
|
||||||
' New=',DbgS(r.Right),'x',DbgS(r.Bottom));
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FAdjustClientRectRealized := R;
|
FAdjustClientRectRealized := R;
|
||||||
AdjustSize;
|
AdjustSize;
|
||||||
@ -7499,6 +7498,9 @@ begin
|
|||||||
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InitializeWnd'){$ENDIF};
|
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.InitializeWnd'){$ENDIF};
|
||||||
end;
|
end;
|
||||||
// send pending OnResize
|
// send pending OnResize
|
||||||
|
{$IFDEF VerboseOnResize}
|
||||||
|
debugln(['TWinControl.InitializeWnd ',DbgSName(Self),' calling Resize ...']);
|
||||||
|
{$ENDIF}
|
||||||
Resize;
|
Resize;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -8270,22 +8272,26 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
{$IFDEF VerboseIntfSizing}
|
{$IFDEF VerboseIntfSizing}
|
||||||
if (Visible) then begin
|
if Visible then begin
|
||||||
DebugLn('[TWinControl.DoSendBoundsToInterface] A ',DbgSName(Self),
|
DebugLn('[TWinControl.DoSendBoundsToInterface] A ',DbgSName(Self),
|
||||||
' OldRelBounds=',dbgs(FBoundsRealized),
|
' OldRelBounds=',dbgs(FBoundsRealized),
|
||||||
' -> NewBounds=',dbgs(NewBounds));
|
' -> NewBounds=',dbgs(NewBounds));
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FBoundsRealized := NewBounds;
|
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
|
Include(FWinControlFlags, wcfBoundsRealized); // Note: set before calling widgetset, because used in WMSize
|
||||||
//if Parent=nil then DebugLn(['TWinControl.DoSendBoundsToInterface ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
//if Parent=nil then DebugLn(['TWinControl.DoSendBoundsToInterface ',DbgSName(Self),' ',dbgs(BoundsRect)]);
|
||||||
// this can trigger WMSize messages
|
// this can trigger WMSize messages
|
||||||
TWSWinControlClass(WidgetSetClass).SetBounds(Self, Left, Top, Width, Height);
|
TWSWinControlClass(WidgetSetClass).SetBounds(Self, Left, Top, Width, Height);
|
||||||
NewClientRect := ClientRect;
|
NewClientRect := ClientRect;
|
||||||
if not CompareRect(@OldClientRect,@NewClientRect) then
|
if Visible and (not CompareRect(@OldClientRect,@NewClientRect)) then
|
||||||
begin
|
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)]);
|
//DebugLn(['TWinControl.DoSendBoundsToInterface ',DbgSName(Self),' Bounds=',dbgs(BoundsRect),' OldClientRect=',dbgs(OldClientRect),' NewClientRect=',dbgs(NewClientRect)]);
|
||||||
AdjustSize;
|
AdjustSize;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user