mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-12 19:20:49 +01:00
implemented saving minimized/maximized state
git-svn-id: trunk@6468 -
This commit is contained in:
parent
0e75b215d0
commit
c5310d1c12
@ -147,6 +147,8 @@ type
|
|||||||
var Bounds: TRect) of object;
|
var Bounds: TRect) of object;
|
||||||
TOnApplyIDEWindowLayout = procedure(Layout: TIDEWindowLayout) of object;
|
TOnApplyIDEWindowLayout = procedure(Layout: TIDEWindowLayout) of object;
|
||||||
|
|
||||||
|
{ TIDEWindowLayout }
|
||||||
|
|
||||||
TIDEWindowLayout = class
|
TIDEWindowLayout = class
|
||||||
private
|
private
|
||||||
FVisible: boolean;
|
FVisible: boolean;
|
||||||
@ -226,6 +228,8 @@ type
|
|||||||
property OnApply: TOnApplyIDEWindowLayout read fOnApply write fOnApply;
|
property OnApply: TOnApplyIDEWindowLayout read fOnApply write fOnApply;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TIDEWindowLayoutList }
|
||||||
|
|
||||||
TIDEWindowLayoutList = class(TList)
|
TIDEWindowLayoutList = class(TList)
|
||||||
private
|
private
|
||||||
function GetItems(Index: Integer): TIDEWindowLayout;
|
function GetItems(Index: Integer): TIDEWindowLayout;
|
||||||
@ -684,6 +688,14 @@ end;
|
|||||||
procedure TIDEWindowLayout.ReadCurrentState;
|
procedure TIDEWindowLayout.ReadCurrentState;
|
||||||
begin
|
begin
|
||||||
Visible:=(Form<>nil) and Form.Visible;
|
Visible:=(Form<>nil) and Form.Visible;
|
||||||
|
if Form<>nil then begin
|
||||||
|
case Form.WindowState of
|
||||||
|
wsMinimized: fWindowState:=iwsMinimized;
|
||||||
|
wsMaximized: fWindowState:=iwsMaximized;
|
||||||
|
else
|
||||||
|
fWindowState:=iwsNormal;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIDEWindowLayout.Assign(Layout: TIDEWindowLayout);
|
procedure TIDEWindowLayout.Assign(Layout: TIDEWindowLayout);
|
||||||
|
|||||||
30
ide/main.pp
30
ide/main.pp
@ -11202,13 +11202,31 @@ begin
|
|||||||
if (ALayout=nil) or (ALayout.Form=nil) then exit;
|
if (ALayout=nil) or (ALayout.Form=nil) then exit;
|
||||||
// writeln('AAA TMainIDE.OnApplyWindowLayout ',ALayout.Form.Name,' ',ALayout.Form.Classname,' ',IDEWindowPlacementNames[ALayout.WindowPlacement],' ',ALayout.CustomCoordinatesAreValid,' ',ALayout.Left,' ',ALayout.Top,' ',ALayout.Width,' ',ALayout.Height);
|
// writeln('AAA TMainIDE.OnApplyWindowLayout ',ALayout.Form.Name,' ',ALayout.Form.Classname,' ',IDEWindowPlacementNames[ALayout.WindowPlacement],' ',ALayout.CustomCoordinatesAreValid,' ',ALayout.Left,' ',ALayout.Top,' ',ALayout.Width,' ',ALayout.Height);
|
||||||
if (ALayout.WindowPlacement in [iwpCustomPosition,iwpRestoreWindowGeometry])
|
if (ALayout.WindowPlacement in [iwpCustomPosition,iwpRestoreWindowGeometry])
|
||||||
and (ALayout.CustomCoordinatesAreValid) then begin
|
then begin
|
||||||
|
case ALayout.WindowState of
|
||||||
|
iwsMinimized:
|
||||||
|
begin
|
||||||
|
ALayout.Form.WindowState:=wsMinimized;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
iwsMaximized:
|
||||||
|
begin
|
||||||
|
ALayout.Form.WindowState:=wsMaximized;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
if (ALayout.CustomCoordinatesAreValid) then begin
|
||||||
// explicit position
|
// explicit position
|
||||||
ALayout.Form.SetBounds(
|
ALayout.Form.SetBounds(
|
||||||
ALayout.Left,ALayout.Top,ALayout.Width,ALayout.Height)
|
ALayout.Left,ALayout.Top,ALayout.Width,ALayout.Height);
|
||||||
end
|
exit;
|
||||||
else if (not (ALayout.WindowPlacement in [iwpDocked,iwpUseWindowManagerSetting]))
|
end;
|
||||||
|
end;
|
||||||
|
end else if ALayout.WindowPlacement in [iwpDocked,iwpUseWindowManagerSetting]
|
||||||
then begin
|
then begin
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// no layout found => use default
|
||||||
BarBottom:=MainIDEBar.Top+MainIDEBar.Height;
|
BarBottom:=MainIDEBar.Top+MainIDEBar.Height;
|
||||||
// default window positions
|
// default window positions
|
||||||
l:=NonModalIDEFormIDToEnum(ALayout.FormID);
|
l:=NonModalIDEFormIDToEnum(ALayout.FormID);
|
||||||
@ -11238,7 +11256,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMainIDE.AddRecentProjectFileToEnvironment(const AFilename: string);
|
procedure TMainIDE.AddRecentProjectFileToEnvironment(const AFilename: string);
|
||||||
begin
|
begin
|
||||||
@ -11275,6 +11292,9 @@ end.
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.818 2005/01/03 12:09:24 mattias
|
||||||
|
implemented saving minimized/maximized state
|
||||||
|
|
||||||
Revision 1.817 2005/01/01 18:56:46 mattias
|
Revision 1.817 2005/01/01 18:56:46 mattias
|
||||||
implemented TTIProgressBar
|
implemented TTIProgressBar
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user