mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 05:18:00 +02:00
LCL: enabled autosize for controls without parent, TForm will not autosize if minimized/maximized, once painted
git-svn-id: trunk@12483 -
This commit is contained in:
parent
2a5042eef4
commit
029946b537
@ -6088,7 +6088,7 @@ begin
|
||||
with ButtonPanel do begin
|
||||
Name:='ButtonPanel';
|
||||
Align:=alBottom;
|
||||
Anchors:=Anchors-[akTop];
|
||||
AnchorToNeighbour(akTop,0,Edit1);
|
||||
AutoSize:=true;
|
||||
BevelOuter:=bvNone;
|
||||
Caption:='';
|
||||
|
@ -336,7 +336,8 @@ type
|
||||
fsCreatedMDIChild,
|
||||
fsBorderStyleChanged,
|
||||
fsFormStyleChanged,
|
||||
fsFirstShow // form is shown for the first time
|
||||
fsFirstShow, // form is shown for the first time
|
||||
fsDisableAutoSize
|
||||
);
|
||||
TFormState = set of TFormStateType;
|
||||
|
||||
@ -466,6 +467,7 @@ type
|
||||
function VisibleIsStored: boolean;
|
||||
function ColorIsStored: boolean; override;
|
||||
procedure DoSendBoundsToInterface; override;
|
||||
procedure DoAutoSize; override;
|
||||
class function GetControlClassDefaultSize: TPoint; override;
|
||||
protected
|
||||
// drag and dock
|
||||
|
@ -519,6 +519,7 @@ end;
|
||||
procedure TCustomForm.WMPaint(var Message: TLMPaint);
|
||||
begin
|
||||
//DebugLn('[TCustomForm.WMPaint] ',Name,':',ClassName);
|
||||
Include(FFormState,fsDisableAutoSize);
|
||||
inherited WMPaint(Message);
|
||||
//DebugLn('[TCustomForm.WMPaint] END ',Name,':',ClassName);
|
||||
end;
|
||||
@ -971,6 +972,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomForm.DoAutoSize;
|
||||
begin
|
||||
if (WindowState=wsNormal) and (not (fsDisableAutoSize in FFormState)) then
|
||||
inherited DoAutoSize;
|
||||
end;
|
||||
|
||||
class function TCustomForm.GetControlClassDefaultSize: TPoint;
|
||||
begin
|
||||
Result.X:=320;
|
||||
|
@ -2728,7 +2728,7 @@ var
|
||||
function WidthDependsOnParent: boolean;
|
||||
begin
|
||||
if Parent=nil then
|
||||
Result:=true // top level controls depend on the window manager
|
||||
Result:=false
|
||||
else
|
||||
Result:=Parent.ChildSizing.Layout<>cclNone;
|
||||
end;
|
||||
@ -2749,7 +2749,7 @@ var
|
||||
function HeightDependsOnParent: boolean;
|
||||
begin
|
||||
if Parent=nil then
|
||||
Result:=true // top level controls depend on the window manager
|
||||
Result:=false
|
||||
else
|
||||
Result:=Parent.ChildSizing.Layout<>cclNone;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user