Пример #1
0
        private void FillMenu()
        {
            Items.Clear();

            // MainMenu
            Items.Add(_fileBtn);
            Items.Add(_figureBtn);
            Items.Add(_viewBtn);
            Items.Add(_tabBtn);
            Items.Add(_pagesBtn);
            Items.Add(_languageBtn);
            Items.Add(_figurePluginsBtn);
            Items.Add(_formatPluginsBtn);
            Items.Add(_cloudBtn);
            Items.Add(_skinsBtn);
            Items.Add(_helpBtn);


            // MainMenu: FileItems
            _fileBtn.DropDownItems.Add(_saveBtn);
            _fileBtn.DropDownItems.Add(_openBtn);
            _fileBtn.DropDownItems.Add(_exitBtn);

            // MainMenu: Figure
            _figureBtn.DropDownItems.Add(_typeBtn);
            _figureBtn.DropDownItems.Add(_colorBtn);
            _figureBtn.DropDownItems.Add(_widthBtn);

            // MainMenu: Figure: Type
            _typeBtn.DropDownItems.Add(_lineBtn);
            _typeBtn.DropDownItems.Add(_rectangleBtn);
            _typeBtn.DropDownItems.Add(_roundedRectangleBtn);
            _typeBtn.DropDownItems.Add(_ellipseBtn);
            _lineBtn.Checked = true;

            // MainMenu: Figure: Width
            _widthBtn.DropDownItems.Add(_width1Btn);
            _widthBtn.DropDownItems.Add(_width5Btn);
            _widthBtn.DropDownItems.Add(_width10Btn);
            _widthBtn.DropDownItems.Add(_width15Btn);
            _widthBtn.DropDownItems.Add(_width20Btn);
            _width1Btn.Checked = true;

            // MainMenu: View
            _viewBtn.DropDownItems.Add(_toolBarBtn);
            _viewBtn.DropDownItems.Add(_propertiesBtn);
            _toolBarBtn.Checked    = true; //?
            _propertiesBtn.Checked = true; //?

            // MainMenu: Tab
            _tabBtn.DropDownItems.Add(_newTabBtn);
            _tabBtn.DropDownItems.Add(_renameTabBtn);
            _tabBtn.DropDownItems.Add(_closeTabBtn);

            // MainMenu: Pages

            // MainMenu: Language
            _languageBtn.DropDownItems.Add(_russianBtn);
            _languageBtn.DropDownItems.Add(_englishBtn);
            _languageBtn.DropDownItems.Add(_ukrainianBtn);
            _englishBtn.Checked = true;

            // MainMenu: Figure Plugins
            _figurePluginsBtn.DropDownItems.Add(_simpleFigureBtn);
            _simpleFigureBtn.Checked = true;
            foreach (IPluginFigure plugin in _xCommand.FigurePlugins)
            {
                var toolStripMenuItem = new ToolStripMenuItem(plugin.Name, null, delegate { _xCommand.TogglePlugin(plugin); });
                toolStripMenuItem.CheckOnClick = true;
                _figurePluginsBtn.DropDownItems.Add(toolStripMenuItem);
            }

            // MainMenu: Format Plugins
            foreach (IPluginFile plugin in _xCommand.FilePlugins)
            {
                _formatPluginsBtn.DropDownItems.Add(plugin.Name);
            }

            // MainMenu: Cloud
            _cloudBtn.DropDownItems.Add(_saveInCloudBtn);
            _cloudBtn.DropDownItems.Add(_loadFromCloudBtn);

            // MainMenu: Skins
            _skinsBtn.DropDownItems.Add(_skin1Btn);
            _skinsBtn.DropDownItems.Add(_skin2Btn);
            _skinsBtn.DropDownItems.Add(_skin3Btn);
            _skin1Btn.Checked = true;

            // MainMenu: HelpItems
            _helpBtn.DropDownItems.Add(_faqBtn);
            _helpBtn.DropDownItems.Add(_aboutBtn);
        }