mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 11:39:13 +02:00
LCL: TLabel: do not change size in DoAutoSize, TWinControl.CreateWnd: invalidatepreferredszie of childs - needed for non TWinControl
git-svn-id: trunk@24263 -
This commit is contained in:
parent
ed6915b885
commit
1ee2beda9e
@ -476,10 +476,9 @@ begin
|
||||
BoundsOutOfBounds;
|
||||
{$IFDEF CHECK_POSITION}
|
||||
if CheckPosition(Self) then
|
||||
DebugLn('TControl.DoSetBounds ',Name,':',ClassName,
|
||||
' Old=',DbgS(Left,Top,Width,Height),
|
||||
' New=',DbgS(aLeft,aTop,aWidth,aHeight),
|
||||
'');
|
||||
DebugLn(['TControl.DoSetBounds ',DbgSName(Self),
|
||||
' Old=',Left,',',Top,',',Width,'x',Height,
|
||||
' New=',aLeft,',',aTop,',',aWidth,'x',aHeight]);
|
||||
{$ENDIF}
|
||||
FLeft := ALeft;
|
||||
FTop := ATop;
|
||||
|
@ -80,18 +80,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCustomLabel.DoAutoSize;
|
||||
{$IFDEF OldAutoSize}
|
||||
var
|
||||
NewWidth, NewHeight: integer;
|
||||
CurAnchors: TAnchors;
|
||||
{$ENDIF}
|
||||
begin
|
||||
inherited DoAutoSize;
|
||||
//debugln('TCustomLabel.DoAutoSize ',DbgSName(Self),' AutoSizing=',dbgs(AutoSizing),' AutoSize=',dbgs(AutoSize),' Parent=',DbgSName(Parent),' csLoading=',dbgs(csLoading in ComponentState),' Parnet.HandleAllocated=',dbgs((Parent<>nil) and (Parent.HandleAllocated)));
|
||||
{$IFDEF OldAutoSize}
|
||||
if OptimalFill and (not AutoSize) then
|
||||
begin
|
||||
AdjustFontForOptimalFill;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
|
||||
if AutoSizeDelayed then
|
||||
Exit;
|
||||
|
||||
@ -114,6 +117,7 @@ begin
|
||||
finally
|
||||
FInternalSetBounds := False;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TCustomLabel.SetAlignment(Value : TAlignment);
|
||||
|
@ -33,7 +33,7 @@
|
||||
{off $DEFINE CHECK_POSITION}
|
||||
{$IFDEF CHECK_POSITION}
|
||||
const CheckPostionClassName = 'xxTPage';
|
||||
const CheckPostionName = 'LazFindReplaceDialog';
|
||||
const CheckPostionName = 'PropertyStoredIdentPostfixLabel';
|
||||
const CheckPostionParentName = 'xxxEnvVarsPage';
|
||||
|
||||
function CheckPosition(AControl: TControl): boolean;
|
||||
@ -2090,8 +2090,8 @@ begin
|
||||
case CurControl.BorderSpacing.CellAlignHorizontal of
|
||||
ccaFill: NewWidth:=CellBounds.Right-CellBounds.Left;
|
||||
ccaLeftTop,ccaRightBottom:
|
||||
if (CurControl.BorderSpacing.CellAlignHorizontal=ccaLeftTop)
|
||||
<>(BidiMode=bdLeftToRight)
|
||||
if (CurControl.BorderSpacing.CellAlignHorizontal=ccaRightBottom)
|
||||
=(BidiMode=bdLeftToRight)
|
||||
then
|
||||
NewBounds.Left:=CellBounds.Right-NewWidth;
|
||||
ccaCenter: NewBounds.Left:=NewBounds.Left
|
||||
@ -2124,6 +2124,13 @@ begin
|
||||
NewBounds.Right:=NewBounds.Left+NewWidth;
|
||||
NewBounds.Bottom:=NewBounds.Top+NewHeight;
|
||||
ControlBox.NewControlBounds:=NewBounds;
|
||||
{$IFDEF CHECK_POSITION}
|
||||
if CheckPosition(CurControl) then
|
||||
DebugLn(['TAutoSizeBox.ComputeTableControlBounds ',DbgSName(CurControl),
|
||||
' CellBounds=',dbgs(CellBounds),
|
||||
' Preferred=',ControlBox.PreferredSize[asboHorizontal],'x',ControlBox.PreferredSize[asboVertical],
|
||||
' NewBounds=',dbgs(NewBounds)]);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -7142,6 +7149,9 @@ begin
|
||||
// realign childs
|
||||
ReAlign;
|
||||
{$ELSE}
|
||||
if FControls<>nil then
|
||||
for i:=0 to FControls.Count-1 do
|
||||
TControl(FControls[i]).InvalidatePreferredSize;
|
||||
// size this control
|
||||
AdjustSize;
|
||||
{$ENDIF}
|
||||
|
Loading…
Reference in New Issue
Block a user