LCL: debg DisableAutoSizing

git-svn-id: trunk@53655 -
This commit is contained in:
mattias 2016-12-12 19:40:31 +00:00
parent b442564a2a
commit 90b9fc6c74
3 changed files with 42 additions and 31 deletions

View File

@ -885,7 +885,9 @@ begin
NewHeight:=Result.Height-Result.ClientHeight+NewClientHeight; NewHeight:=Result.Height-Result.ClientHeight+NewClientHeight;
Result.SetBounds(Bounds.Left,Bounds.Top,NewWidth,NewHeight); Result.SetBounds(Bounds.Left,Bounds.Top,NewWidth,NewHeight);
Result.SetClientSize(Point(NewClientWidth,NewClientHeight)); Result.SetClientSize(Point(NewClientWidth,NewClientHeight));
{$IFDEF DebugDisableAutoSizing}
debugln('TControl.CreateFloatingDockSite A ',DbgSName(Self),' ',DbgSName(Result),' ',dbgs(Result.BoundsRect)); debugln('TControl.CreateFloatingDockSite A ',DbgSName(Self),' ',DbgSName(Result),' ',dbgs(Result.BoundsRect));
{$ENDIF}
Result.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.CreateFloatingDockSite'){$ENDIF}; Result.EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.CreateFloatingDockSite'){$ENDIF};
end; end;
end; end;
@ -3828,7 +3830,8 @@ var
begin begin
if FAlign = Value then exit; if FAlign = Value then exit;
//DebugLn(['TControl.SetAlign ',DbgSName(Self),' Old=',DbgS(FAlign),' New=',DbgS(Value),' ',Anchors<>AnchorAlign[FAlign]]); //DebugLn(['TControl.SetAlign ',DbgSName(Self),' Old=',DbgS(FAlign),' New=',DbgS(Value),' ',Anchors<>AnchorAlign[FAlign]]);
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.setalign'){$ENDIF}; DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetAlign'){$ENDIF};
try
OldBaseBounds:=BaseBounds; OldBaseBounds:=BaseBounds;
OldAlign := FAlign; OldAlign := FAlign;
FAlign := Value; FAlign := Value;
@ -3852,7 +3855,9 @@ begin
if not (csLoading in ComponentState) then if not (csLoading in ComponentState) then
BoundsRect:=OldBaseBounds; BoundsRect:=OldBaseBounds;
//DebugLn(['TControl.SetAlign ',DbgSName(Self),' Cur=',DbgS(FAlign),' New=',DbgS(Value),' ',Anchors<>AnchorAlign[FAlign],' Anchors=',dbgs(Anchors)]); //DebugLn(['TControl.SetAlign ',DbgSName(Self),' Cur=',DbgS(FAlign),' New=',DbgS(Value),' ',Anchors<>AnchorAlign[FAlign],' Anchors=',dbgs(Anchors)]);
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.setalign'){$ENDIF}; finally
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TControl.SetAlign'){$ENDIF};
end;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------

View File

@ -96,9 +96,12 @@ var bR2L: Boolean;
begin begin
bR2L := IsRightToLeft; bR2L := IsRightToLeft;
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.AlignControlsToBands'){$ENDIF}; DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.AlignControlsToBands'){$ENDIF};
try
for aBand in FVisiBands do for aBand in FVisiBands do
AlignControlToBand(aBand, bR2L); AlignControlToBand(aBand, bR2L);
finally
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.AlignControlsToBands'){$ENDIF}; EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.AlignControlsToBands'){$ENDIF};
end;
end; end;
procedure TCustomControlBar.AlignControlToBand(ABand: TCtrlBand; ARightToLeft: Boolean); procedure TCustomControlBar.AlignControlToBand(ABand: TCtrlBand; ARightToLeft: Boolean);
@ -218,9 +221,12 @@ begin
inherited CMBiDiModeChanged(Message); inherited CMBiDiModeChanged(Message);
aWidth := Width; aWidth := Width;
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.CMBiDiModeChanged'){$ENDIF}; DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.CMBiDiModeChanged'){$ENDIF};
try
for i := 0 to FBands.Count - 1 do for i := 0 to FBands.Count - 1 do
FBands[i].Left := abs(FBands[i].Left - aWidth) - FBands[i].Width; FBands[i].Left := abs(FBands[i].Left - aWidth) - FBands[i].Width;
finally
EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.CMBiDiModeChanged'){$ENDIF}; EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomControlBar.CMBiDiModeChanged'){$ENDIF};
end;
end; end;
procedure TCustomControlBar.CMBorderChanged(var Message: TLMessage); procedure TCustomControlBar.CMBorderChanged(var Message: TLMessage);

View File

@ -6155,13 +6155,13 @@ var
i: Integer; i: Integer;
begin begin
// scroll inner controls // scroll inner controls
DisableAutoSizing; DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.ScrollBy'){$ENDIF};
try try
for i := 0 to ControlCount - 1 do for i := 0 to ControlCount - 1 do
with Controls[i] do with Controls[i] do
SetBounds(Left + DeltaX, Top + DeltaY, Width, Height); SetBounds(Left + DeltaX, Top + DeltaY, Width, Height);
finally finally
EnableAutoSizing; EnableAutoSizing{$IFDEF DebugDisableAutoSizing}('TWinControl.ScrollBy'){$ENDIF};
end; end;
end; end;