LCL: AutoSize=true, no childs, no content, consider AdjustClientRect

git-svn-id: trunk@24442 -
This commit is contained in:
mattias 2010-04-05 18:25:30 +00:00
parent d00e912de8
commit c88de91a79

View File

@ -7797,7 +7797,17 @@ begin
inc(PreferredHeight,BorderSpacing.InnerBorder*2);
end;
// check AdjustClientRect
CurClientRect:=Rect(0,0,1000,1000);
AdjustedClientRect:=CurClientRect;
AdjustClientRect(AdjustedClientRect);
PreferredWidth:=Max(PreferredWidth,
AdjustedClientRect.Left+CurClientRect.Right-AdjustedClientRect.Right);
PreferredHeight:=Max(PreferredHeight,
AdjustedClientRect.Top+CurClientRect.Bottom-AdjustedClientRect.Bottom);
if ControlCount>0 then begin
// Beware: ControlCount>0 does not mean that there are visible childs
// get the size requirements for the child controls
Layout:=nil;
@ -7824,15 +7834,6 @@ begin
{$ENDIF}
PreferredWidth:=Max(PreferredWidth,NewWidth);
PreferredHeight:=Max(PreferredHeight,NewHeight);
end else begin
// check AdjustClientRect
CurClientRect:=Rect(0,0,1000,1000);
AdjustedClientRect:=CurClientRect;
AdjustClientRect(AdjustedClientRect);
PreferredWidth:=Max(PreferredWidth,
AdjustedClientRect.Left+CurClientRect.Right-AdjustedClientRect.Right);
PreferredHeight:=Max(PreferredHeight,
AdjustedClientRect.Top+CurClientRect.Bottom-AdjustedClientRect.Bottom);
end;
{$IFDEF VerboseAutoSize}
debugln('TWinControl.CalculatePreferredSize ',DbgSName(Self),