implemented saving minimized/maximized state

git-svn-id: trunk@6468 -
This commit is contained in:
mattias 2005-01-03 12:09:24 +00:00
parent 0e75b215d0
commit c5310d1c12
2 changed files with 64 additions and 32 deletions

View File

@ -147,6 +147,8 @@ type
var Bounds: TRect) of object;
TOnApplyIDEWindowLayout = procedure(Layout: TIDEWindowLayout) of object;
{ TIDEWindowLayout }
TIDEWindowLayout = class
private
FVisible: boolean;
@ -226,6 +228,8 @@ type
property OnApply: TOnApplyIDEWindowLayout read fOnApply write fOnApply;
end;
{ TIDEWindowLayoutList }
TIDEWindowLayoutList = class(TList)
private
function GetItems(Index: Integer): TIDEWindowLayout;
@ -684,6 +688,14 @@ end;
procedure TIDEWindowLayout.ReadCurrentState;
begin
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;
procedure TIDEWindowLayout.Assign(Layout: TIDEWindowLayout);

View File

@ -11202,13 +11202,31 @@ begin
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);
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
ALayout.Form.SetBounds(
ALayout.Left,ALayout.Top,ALayout.Width,ALayout.Height)
end
else if (not (ALayout.WindowPlacement in [iwpDocked,iwpUseWindowManagerSetting]))
ALayout.Left,ALayout.Top,ALayout.Width,ALayout.Height);
exit;
end;
end;
end else if ALayout.WindowPlacement in [iwpDocked,iwpUseWindowManagerSetting]
then begin
exit;
end;
// no layout found => use default
BarBottom:=MainIDEBar.Top+MainIDEBar.Height;
// default window positions
l:=NonModalIDEFormIDToEnum(ALayout.FormID);
@ -11238,7 +11256,6 @@ begin
end;
end;
end;
end;
procedure TMainIDE.AddRecentProjectFileToEnvironment(const AFilename: string);
begin
@ -11275,6 +11292,9 @@ end.
{ =============================================================================
$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
implemented TTIProgressBar