IDE: add a new EditorFileManager to Windows menu

git-svn-id: trunk@35417 -
This commit is contained in:
juha 2012-02-17 12:41:38 +00:00
parent a21ba83d61
commit a2885ca4d0
5 changed files with 35 additions and 10 deletions

View File

@ -242,6 +242,7 @@ resourcestring
lisKMSelectPageBottom = 'Select Page Bottom';
lisMenuSelect = 'Select';
lisMenuSelectAll = 'Select All';
lisMenuUnselectAll = 'Unelect All';
lisSAMAbstractMethodsNotYetOverridden = 'Abstract Methods - not yet overridden';
lisMenuSelectToBrace = 'Select to Brace';
lisMenuSelectCodeBlock = 'Select Code Block';
@ -449,6 +450,7 @@ resourcestring
lisMenuBuildLazarus = 'Build Lazarus with Current Profile';
lisMenuBuildLazarusProf = 'Build Lazarus with Profile: %s';
lisMenuConfigureBuildLazarus = 'Configure "Build Lazarus" ...';
lisEditorFileManager = 'Editor File Manager ...';
lisSearchProjectsFrom = 'Search projects from';
lisMEOther = 'Other';
@ -461,7 +463,7 @@ resourcestring
dlgEdCodeTempl = 'Code Templates';
dlgTplFName = 'Template file name';
lisMenuCodeToolsDefinesEditor = 'CodeTools Defines Editor ...';
lisMenuOnlineHelp = 'Online Help';
lisMenuReportingBug = 'Reporting a Bug';
lisReportingBugURL = 'http://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report';
@ -921,6 +923,9 @@ resourcestring
lisCloseAllTabsTitle = 'Close Source Editor Window';
lisCloseAllTabsQuestion = 'Closing a Source Editor Window. Do you want close all files or hide the window?';
lisCloseAllTabsClose = 'Close files';
lisCloseAllChecked = 'Close All Checked';
lisSaveAllChecked = 'Save All Checked';
lisActivateSelected = 'Activate Selected';
lisCloseAllTabsHide = 'Hide window';
// hints

View File

@ -149,7 +149,7 @@ uses
NewDialog, MakeResStrDlg, DialogProcs, FindReplaceDialog, FindInFilesDlg,
CodeExplorer, BuildFileDlg, ProcedureList, ExtractProcDlg,
FindRenameIdentifier, AbstractsMethodsDlg, EmptyMethodsDlg, UnusedUnitsDlg,
UseUnitDlg, FindOverloadsDlg,
UseUnitDlg, FindOverloadsDlg, EditorFileManager,
CleanDirDlg, CodeContextForm, AboutFrm, CompatibilityRestrictions,
RestrictionBrowser, ProjectWizardDlg, IDECmdLine, IDEGuiCmdLine, CodeExplOpts,
// main ide
@ -372,6 +372,7 @@ type
procedure mnuEnvRescanFPCSrcDirClicked(Sender: TObject);
// windows menu
procedure mnuWindowManagerClicked(Sender: TObject);
// help menu
// see helpmanager.pas
@ -2662,6 +2663,9 @@ end;
procedure TMainIDE.SetupWindowsMenu;
begin
inherited SetupWindowsMenu;
with MainIDEBar do begin
itmWindowManager.OnClick := @mnuWindowManagerClicked;
end;
end;
procedure TMainIDE.SetupHelpMenu;
@ -5153,6 +5157,11 @@ begin
MainBuildBoss.RescanCompilerDefines(false,true,false,false);
end;
procedure TMainIDE.mnuWindowManagerClicked(Sender: TObject);
begin
ShowEditorFileManagerForm;
end;
procedure TMainIDE.SaveEnvironment;
begin
SaveDesktopSettings(EnvironmentOptions);

View File

@ -347,6 +347,8 @@ type
// windows menu
//mnuWindow: TIDEMenuSection;
//itmWindowManagers: TIDEMenuSection;
itmWindowManager: TIDEMenuCommand;
// help menu
//mnuHelp: TIDEMenuSection;

View File

@ -776,8 +776,16 @@ begin
end;
procedure TMainIDEBase.SetupWindowsMenu;
var
ParentMI: TIDEMenuSection;
begin
with MainIDEBar do begin
CreateMenuSeparatorSection(mnuWindow,itmWindowManagers,'itmWindowManagers');
ParentMI:=itmWindowManagers;
CreateMenuItem(ParentMI,itmWindowManager,'itmWindowManager', lisEditorFileManager, 'pkg_files');
// Populated later with a list of editor names
CreateMenuSeparatorSection(mnuWindow,itmWindowLists,'itmWindowLists');
end;
end;
procedure TMainIDEBase.SetupHelpMenu;
@ -1044,11 +1052,10 @@ const
function GetMenuItem(Index: Integer): TIDEMenuItem; inline;
begin
if mnuWindow.Count > Index then
Result := mnuWindow.Items[Index]
if itmWindowLists.Count > Index then
Result := itmWindowLists.Items[Index]
else
Result := RegisterIDEMenuCommand(mnuWindow.GetPath,
'Window'+IntToStr(Index),'');
Result := RegisterIDEMenuCommand(itmWindowLists.GetPath,'Window'+IntToStr(Index),'');
end;
var
@ -1124,8 +1131,9 @@ begin
end;
end;
// remove unused menuitems
while mnuWindow.Count > ItemCount do
mnuWindow.Items[mnuWindow.Count-1].Free;
with itmWindowLists do
while Count > ItemCount do
Items[Count-1].Free;
// clean up
WindowsList.Free;

View File

@ -366,7 +366,8 @@ var
// windows menu
mnuWindow: TIDEMenuSection;
itmDesignerWindow: TIDEMenuSection;
itmWindowManagers: TIDEMenuSection;
itmWindowLists: TIDEMenuSection;
// help menu
mnuHelp: TIDEMenuSection;