mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 23:26:32 +02:00
TForm.AutoSize: using Monitor.WorkAreaRect as maximum for AutoSize when akRight,akBottom are set
git-svn-id: trunk@26278 -
This commit is contained in:
parent
8c4f53f514
commit
ee8a253eab
@ -533,6 +533,8 @@ type
|
|||||||
procedure Notification(AComponent: TComponent; Operation : TOperation);override;
|
procedure Notification(AComponent: TComponent; Operation : TOperation);override;
|
||||||
procedure PaintWindow(dc : Hdc); override;
|
procedure PaintWindow(dc : Hdc); override;
|
||||||
procedure RequestAlign; override;
|
procedure RequestAlign; override;
|
||||||
|
procedure CalculatePreferredSize(var PreferredWidth,
|
||||||
|
PreferredHeight: integer; WithThemeSpace: Boolean); override;
|
||||||
procedure SetZOrder(Topmost: Boolean); override;
|
procedure SetZOrder(Topmost: Boolean); override;
|
||||||
procedure SetParent(NewParent: TWinControl); override;
|
procedure SetParent(NewParent: TWinControl); override;
|
||||||
procedure MoveToDefaultPosition; virtual;
|
procedure MoveToDefaultPosition; virtual;
|
||||||
|
@ -1042,6 +1042,23 @@ Begin
|
|||||||
inherited RequestAlign;
|
inherited RequestAlign;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomForm.CalculatePreferredSize(var PreferredWidth,
|
||||||
|
PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||||
|
var
|
||||||
|
WorkArea: TRect;
|
||||||
|
begin
|
||||||
|
inherited CalculatePreferredSize(PreferredWidth, PreferredHeight,
|
||||||
|
WithThemeSpace);
|
||||||
|
if Anchors*[akRight,akBottom]<>[] then begin
|
||||||
|
// do size bigger than the monitor workarea
|
||||||
|
WorkArea:=Monitor.WorkareaRect;
|
||||||
|
if akRight in Anchors then
|
||||||
|
PreferredWidth:=min(PreferredWidth,WorkArea.Right-WorkArea.Left);
|
||||||
|
if akBottom in Anchors then
|
||||||
|
PreferredHeight:=min(PreferredHeight,WorkArea.Bottom-WorkArea.Top);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TCustomForm SetDesigner
|
TCustomForm SetDesigner
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
Loading…
Reference in New Issue
Block a user