main menu, files, add close all + close all the others

This commit is contained in:
Basile Burg 2017-01-18 19:55:40 +01:00
parent fc95a91d0d
commit 0a4bd3064d
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
2 changed files with 53 additions and 0 deletions

View File

@ -1709,6 +1709,12 @@ object CEMainForm: TCEMainForm
ADFFB0B0AEEA000000000000000000000000FFFFFF00FFFFFF00
}
end
object MenuItem107: TMenuItem
Action = actFileCloseAll
end
object MenuItem106: TMenuItem
Action = actFileCloseAllOthers
end
object MenuItem6: TMenuItem
Caption = '-'
end
@ -5235,6 +5241,20 @@ object CEMainForm: TCEMainForm
ImageIndex = 35
OnExecute = actFileMetricsHalsteadExecute
end
object actFileCloseAllOthers: TAction
Category = 'File'
Caption = 'Close all the others files'
ImageIndex = 27
OnExecute = actFileCloseAllOthersExecute
OnUpdate = updateDocumentBasedAction
end
object actFileCloseAll: TAction
Category = 'File'
Caption = 'Close all the files'
ImageIndex = 27
OnExecute = actFileCloseAllExecute
OnUpdate = updateDocumentBasedAction
end
end
object imgList: TImageList
left = 64

View File

@ -103,6 +103,8 @@ type
actFileRunDubOut: TAction;
actFileNewDubScript: TAction;
actFileMetricsHalstead: TAction;
actFileCloseAllOthers: TAction;
actFileCloseAll: TAction;
actProjGroupCompileCustomSync: TAction;
actProjGroupClose: TAction;
actProjGroupCompileSync: TAction;
@ -151,6 +153,8 @@ type
MenuItem103: TMenuItem;
MenuItem104: TMenuItem;
MenuItem105: TMenuItem;
MenuItem106: TMenuItem;
MenuItem107: TMenuItem;
MenuItem77: TMenuItem;
mnuOpts: TMenuItem;
mnuItemMruGroup: TMenuItem;
@ -254,6 +258,8 @@ type
MenuItem7: TMenuItem;
MenuItem8: TMenuItem;
MenuItem9: TMenuItem;
procedure actFileCloseAllExecute(Sender: TObject);
procedure actFileCloseAllOthersExecute(Sender: TObject);
procedure actFileCompileExecute(Sender: TObject);
procedure actFileDscannerExecute(Sender: TObject);
procedure actFileMetricsHalsteadExecute(Sender: TObject);
@ -2818,6 +2824,33 @@ begin
compileRunnable(false);
end;
procedure TCEMainForm.actFileCloseAllOthersExecute(Sender: TObject);
var
i: integer;
d: TCESynMemo;
c: TCESynMemo;
begin
if fDoc.isNil then
exit;
c := fDoc;
for i := fMultidoc.documentCount-1 downto 0 do
begin
d := fMultidoc.document[i];
if not d.Equals(c) then
fMultidoc.closeDocument(d);
end;
end;
procedure TCEMainForm.actFileCloseAllExecute(Sender: TObject);
var
i: integer;
begin
if fDoc.isNil then
exit;
for i := fMultidoc.documentCount-1 downto 0 do
fMultidoc.closeDocument(i);
end;
procedure TCEMainForm.actFileDscannerExecute(Sender: TObject);
var
lst: TStringList;