protected virtual void createFileMenu(MenuStrip menubar) { ComponentResourceManager resources = new ComponentResourceManager(typeof(DXWindow)); bool needSep = false; SuspendLayout(); menubar.SuspendLayout(); fileMenu = new ToolStripMenuItem(); menubar.Items.Add(fileMenu); if (DXApplication.theDXApplication.appAllowsImageRWNetFile()) { openOption = new DXToolStripMenuItem("fileOpenOption", DXApplication.theDXApplication.openFileCmd); recentOption = new CascadeAutoToolStripMenuItem(fileMenu); createFileHistoryMenu(ref recentOption, ref fileMenu); Network net = DXApplication.theDXApplication.network; saveOption = new DXToolStripMenuItem("fileSaveOption", net.getSaveCommand()); saveAsOption = new DXToolStripMenuItem("fileSaveAsOption", net.getSaveAsCommand()); fileMenu.DropDownItems.AddRange(new ToolStripItem[] { openOption, recentOption, saveOption, saveAsOption}); fileMenu.Name = "fileMenu"; saveOption.Name = "saveOption"; saveAsOption.Name = "saveAsOption"; resources.ApplyResources(fileMenu, "fileMenu"); resources.ApplyResources(openOption, "openOption"); resources.ApplyResources(recentOption, "recentOption"); resources.ApplyResources(saveOption, "saveOption"); resources.ApplyResources(saveAsOption, "saveAsOption"); needSep = true; } if (DXApplication.theDXApplication.appAllowsRWConfig()) { Command openCfgCmd = DXApplication.theDXApplication.network.getOpenCfgCommand(); Command saveCfgCmd = DXApplication.theDXApplication.network.getSaveCfgCommand(); if (openCfgCmd != null || saveCfgCmd != null) { settingsOption = new ToolStripMenuItem(); settingsOption.Name = "settingsOption"; fileMenu.DropDownItems.Add(settingsOption); resources.ApplyResources(settingsOption, "settingsOption"); needSep = true; } if (saveCfgCmd != null) { saveCfgOption = new DXToolStripMenuItem("saveCfgOption", saveCfgCmd); settingsOption.DropDownItems.Add(saveCfgOption); saveCfgOption.Name = "saveCfgOption"; resources.ApplyResources(saveCfgOption, "saveCfgOption"); } if (openCfgCmd != null) { openCfgOption = new DXToolStripMenuItem("saveCfgOption", openCfgCmd); settingsOption.DropDownItems.Add(openCfgOption); openCfgOption.Name = "openCfgOption"; resources.ApplyResources(openCfgOption, "openCfgOption"); } } if (DXApplication.theDXApplication.appAllowsImageLoad()) { if (needSep) { ToolStripSeparator sep1 = new ToolStripSeparator(); fileMenu.DropDownItems.Add(sep1); } loadMacroOption = new DXToolStripMenuItem("fileLoadMacroOption", DXApplication.theDXApplication.loadMacroCmd); loadMDFOption = new DXToolStripMenuItem("fileLoadMDFOption", DXApplication.theDXApplication.loadMDFCmd); fileMenu.DropDownItems.AddRange(new ToolStripItem[] { loadMacroOption, loadMDFOption }); needSep = true; loadMacroOption.Name = "loadMacroOption"; resources.ApplyResources(loadMacroOption, "loadMacroOption"); loadMDFOption.Name = "loadMDFOption"; resources.ApplyResources(loadMDFOption, "loadMDFOption"); } if (needSep) { ToolStripSeparator sep2 = new ToolStripSeparator(); fileMenu.DropDownItems.Add(sep2); } closeOption = new DXToolStripMenuItem("fileCloseOption", closeCmd); fileMenu.DropDownItems.Add(closeOption); closeOption.Name = "closeOption"; resources.ApplyResources(closeOption, "closeOption"); menubar.ResumeLayout(); menubar.PerformLayout(); ResumeLayout(); PerformLayout(); }
protected virtual void createWindowsMenu(MenuStrip menubar) { ComponentResourceManager resources = new ComponentResourceManager(typeof(DXWindow)); ToolStripSeparator sep1 = new ToolStripSeparator(); windowsMenu = new ToolStripMenuItem(); openVPEOption = new DXToolStripMenuItem("openVPEOption", openVPECmd); openAllControlPanelsOption = new DXToolStripMenuItem("openAllControlPanelsOption", DXApplication.theDXApplication.network.getOpenAllPanelsCommand()); openControlPanelByNameOption = new CascadeAutoToolStripMenuItem(windowsMenu); openAllColormapEditorsOption = new DXToolStripMenuItem("openAllColormapEditorsOptions", DXApplication.theDXApplication.openAllColormapCmd); messageWindowOption = new DXToolStripMenuItem("messageWindowOption", DXApplication.theDXApplication.messageWindowCmd); SuspendLayout(); menubar.SuspendLayout(); menubar.Items.Add(windowsMenu); windowsMenu.DropDownItems.AddRange(new ToolStripItem[] { openVPEOption, openAllControlPanelsOption, openControlPanelByNameOption, openAllColormapEditorsOption, messageWindowOption }); windowsMenu.Name = "windowsMenu"; resources.ApplyResources(this.windowsMenu, "windowsMenu"); openVPEOption.Name = "openVPEOption"; resources.ApplyResources(this.openVPEOption, "openVPEOption"); openAllControlPanelsOption.Name = "openAllControlPanelsOption"; resources.ApplyResources(this.openAllControlPanelsOption, "openAllControlPanelsOption"); openControlPanelByNameOption.Name = "openControlPanelByNameOption"; resources.ApplyResources(this.openControlPanelByNameOption, "openControlPanelByNameOption"); openAllColormapEditorsOption.Name = "openAllColormapEditorsOption"; resources.ApplyResources(this.openAllColormapEditorsOption, "openAllColormapEditorsOption"); messageWindowOption.Name = "messageWindowOption"; resources.ApplyResources(this.messageWindowOption, "messageWindowOption"); menubar.ResumeLayout(); menubar.PerformLayout(); ResumeLayout(); PerformLayout(); }
protected override void createFileHistoryMenu(ref CascadeAutoToolStripMenuItem menuItem, ref ToolStripMenuItem parentMenuItem) { if(DXApplication.theDXApplication.appAllowsImageRWNetFile()) base.createFileHistoryMenu(ref menuItem, ref parentMenuItem); }