IDE: restore window layout only once

git-svn-id: trunk@26113 -
This commit is contained in:
mattias 2010-06-14 13:22:20 +00:00
parent b86bdbe6bf
commit 73e5c20887
2 changed files with 7 additions and 5 deletions

View File

@ -1140,10 +1140,7 @@ begin
end; end;
procedure TAnchorDockLayoutTreeNode.CheckConsistency; procedure TAnchorDockLayoutTreeNode.CheckConsistency;
{ ToDo: check that all childs are connected { ToDo: check for topological sort }
check for topological sort
check for not overlapping (the bounds can overlap because of constraints)
}
procedure CheckCornerIsUnique(Side1: TAnchorKind; Side1AnchorName: string; procedure CheckCornerIsUnique(Side1: TAnchorKind; Side1AnchorName: string;
Side2: TAnchorKind; Side2AnchorName: string); Side2: TAnchorKind; Side2AnchorName: string);

View File

@ -173,6 +173,7 @@ type
TSimpleWindowLayout = class(TComponent) TSimpleWindowLayout = class(TComponent)
private private
FApplied: boolean;
FFormCaption: string; FFormCaption: string;
FVisible: boolean; FVisible: boolean;
fWindowPlacement: TIDEWindowPlacement; fWindowPlacement: TIDEWindowPlacement;
@ -225,6 +226,7 @@ type
read fWindowState write SetWindowState; read fWindowState write SetWindowState;
property Form: TCustomForm read fForm write SetForm; property Form: TCustomForm read fForm write SetForm;
property Visible: boolean read FVisible write SetVisible; property Visible: boolean read FVisible write SetVisible;
property Applied: boolean read FApplied write FApplied;
end; end;
{ TSimpleWindowLayoutList } { TSimpleWindowLayoutList }
@ -593,6 +595,7 @@ end;
procedure TSimpleWindowLayout.Assign(Layout: TSimpleWindowLayout); procedure TSimpleWindowLayout.Assign(Layout: TSimpleWindowLayout);
begin begin
Clear; Clear;
FApplied:=Layout.Applied;
Form:=Layout.Form; Form:=Layout.Form;
fWindowPlacement:=Layout.fWindowPlacement; fWindowPlacement:=Layout.fWindowPlacement;
fLeft:=Layout.fLeft; fLeft:=Layout.fLeft;
@ -741,6 +744,9 @@ begin
if ALayout<>nil then if ALayout<>nil then
begin begin
ALayout.Form:=AForm; ALayout.Form:=AForm;
if ALayout.Applied then exit;
ALayout.Applied:=true;
debugln(['TSimpleWindowLayoutList.ApplyAndShow restore']);
WindowType:=NonModalIDEFormIDToEnum(ALayout.FormID); WindowType:=NonModalIDEFormIDToEnum(ALayout.FormID);
SubIndex := -1; SubIndex := -1;
@ -790,7 +796,6 @@ begin
exit; exit;
end; end;
end; end;
end; end;
// no layout found => use default // no layout found => use default