예제 #1
0
        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();
        }
예제 #2
0
        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();
        }
예제 #3
0
        protected virtual void createBaseHelpMenu(MenuStrip menu,
            bool add_standard_options, bool addAboutApp)
        {
            Debug.Assert(menu != null);

            Debug.Assert(menuBar != null);

            ComponentResourceManager resources = new ComponentResourceManager(typeof(MainWindow));

            this.helpAboutAppCmd = new HelpMenuCommand("helpAboutApp", null, true, HelpMenuCommand.HelpType.AboutApp);
            this.helpTechSupportCmd = new HelpMenuCommand("helpTechSupport", null, true,
                HelpMenuCommand.HelpType.TechSupport);

            helpToolStripMenuItem = new ToolStripMenuItem();
            onWindowOption = new DXToolStripMenuItem("onWindowOption", this.helpOnWindowCmd);
            onManualOption = new DXToolStripMenuItem("onManualOption", DXApplication.theDXApplication.genericHelpCmd);
            onHelpOption = new DXToolStripMenuItem("onHelpOption", DXApplication.theDXApplication.genericHelpCmd);
            aboutAppOption = new DXToolStripMenuItem("aboutAppOption", this.helpAboutAppCmd);
            sep1 = new ToolStripSeparator();
            techSupportOption = new DXToolStripMenuItem("techSupportOption", this.helpTechSupportCmd);

            menuBar.SuspendLayout();
            SuspendLayout();
            menuBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            helpToolStripMenuItem});

            helpToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {
            onWindowOption,
            onManualOption,
            onHelpOption });

            helpToolStripMenuItem.Name = "helpToolStripMenuItem";
            resources.ApplyResources(this.helpToolStripMenuItem, "helpToolStripMenuItem");

            //
            // onWindowOption
            //
            onWindowOption.Name = "onWindowOption";
            //onWindowOption.Click += new EventHandler(Help.helpOn);
            resources.ApplyResources(this.onWindowOption, "onWindowOption");

            //
            // onManualOption
            //
            onManualOption.Name = "onManualOption";
            //onManualOption.Click += new EventHandler(Help.helpOn);
            resources.ApplyResources(this.onManualOption, "onManualOption");

            //
            // onHelpOption
            //
            onHelpOption.Name = "onHelpOption";
            //onHelpOption.Click += new EventHandler(Help.helpOn);
            resources.ApplyResources(this.onHelpOption, "onHelpOption");

            if (addAboutApp)
            {
                helpToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {
                    sep1, aboutAppOption, techSupportOption });
                //
                // sep1
                //
                sep1.Name = "sep1";
                //
                // aboutAppOption
                //
                aboutAppOption.Name = "aboutAppOption";
                //aboutAppOption.Click += new EventHandler(Help.helpOn);
                resources.ApplyResources(this.aboutAppOption, "aboutAppOption");

                //
                // techSupportOption
                //
                techSupportOption.Name = "techSupportOption";
                //techSupportOption.Click += new EventHandler(Help.helpOn);
                resources.ApplyResources(this.techSupportOption, "techSupportOption");

            }
            menuBar.ResumeLayout();
            menuBar.PerformLayout();
            ResumeLayout();
            PerformLayout();
        }