private void SetupRightClickMenu()
        {
            RightClickMenu          = new MaterialContextMenuStrip();
            RightClickMenu.AutoSize = true;
            //ToolStripMenuItem CloseAllTabs = new MaterialToolStripMenuItem();
            //ToolStripMenuItem TabPositionZurruecksetzten = new MaterialToolStripMenuItem();
            //ToolStripMenuItem CloseAllExeptCurrent = new MaterialToolStripMenuItem();
            ToolStripMenuItem OpenInNewWindow = new MaterialToolStripMenuItem();

            //CloseAllTabs.Text = "Close all tabs";
            //CloseAllTabs.Click += CloseAllTabs_Click;
            //RightClickMenu.Items.Add(CloseAllTabs);

            //CloseAllExeptCurrent.Text = "Close all other tabs";
            //CloseAllExeptCurrent.Click += CloseAllExeptCurrent_Click;
            //RightClickMenu.Items.Add(CloseAllExeptCurrent);

            //TabPositionZurruecksetzten.Text = "Reset tab positions";
            //TabPositionZurruecksetzten.Click += TabPositionZurruecksetzten_Click;
            //RightClickMenu.Items.Add(TabPositionZurruecksetzten);

            OpenInNewWindow.Text   = "Open tab in new window";
            OpenInNewWindow.Click += OpenInNewWindow_Click;
            RightClickMenu.Items.Add(OpenInNewWindow);
        }
Exemple #2
0
        private void SetupRightClickMenu()
        {
            RightClickMenu          = new MaterialContextMenuStrip();
            RightClickMenu.AutoSize = true;
            ToolStripMenuItem CloseAllTabs = new MaterialToolStripMenuItem();
            ToolStripMenuItem TabPositionZurruecksetzten = new MaterialToolStripMenuItem();
            ToolStripMenuItem CloseAllExeptCurrent       = new MaterialToolStripMenuItem();
            ToolStripMenuItem OpenInNewWindow            = new MaterialToolStripMenuItem();

            CloseAllTabs.Text   = "Alle Tabs schließen";
            CloseAllTabs.Click += CloseAllTabs_Click;
            RightClickMenu.Items.Add(CloseAllTabs);

            CloseAllExeptCurrent.Text   = "Alle anderen Tabs Schließen";
            CloseAllExeptCurrent.Click += CloseAllExeptCurrent_Click;
            RightClickMenu.Items.Add(CloseAllExeptCurrent);

            TabPositionZurruecksetzten.Text   = "Tab Positionen zurrücksetzen";
            TabPositionZurruecksetzten.Click += TabPositionZurruecksetzten_Click;
            RightClickMenu.Items.Add(TabPositionZurruecksetzten);

            OpenInNewWindow.Text   = "Tab in neuem Fenster öffnen";
            OpenInNewWindow.Click += OpenInNewWindow_Click;
            RightClickMenu.Items.Add(OpenInNewWindow);
        }
        private void initSideDrawer()
        {
            bool LastControlWasDivider = false;

            if (_SideDrawer != null)
            {
                Controls.Clear();

                foreach (ToolStripItem objMenuItem in _SideDrawer.Items)
                {
                    if (objMenuItem.GetType() == typeof(ToolStripSeparator))
                    {
                        MaterialDivider objDivider = new MaterialDivider();
                        objDivider.Size = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 2);
                        Controls.Add(objDivider);
                        LastControlWasDivider = true;
                    }
                    else
                    {
                        bool Verarbeitet = false;

                        if (objMenuItem.GetType() == typeof(MaterialToolStripMenuItem))
                        {
                            MaterialToolStripMenuItem t = (MaterialToolStripMenuItem)objMenuItem;
                            if (t.DropDownItems.Count > 0)
                            {
                                Verarbeitet = true;
                                if (Controls.Count > 0 && !LastControlWasDivider)
                                {
                                    MaterialDivider objTopDivider = new MaterialDivider();
                                    objTopDivider.Size = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 2);
                                    Controls.Add(objTopDivider);
                                    LastControlWasDivider = true;
                                }
                                MaterialLabel objLabel = new MaterialLabel();
                                objLabel.Text         = objMenuItem.Text;
                                objLabel.Tag          = objMenuItem.Tag;
                                objLabel.Margin       = new Padding(0);
                                objLabel.Font         = SkinManager.FONT_CONTROL_SMALL;
                                LastControlWasDivider = false;
                                Controls.Add(objLabel);

                                foreach (ToolStripItem objSubMenuItem in t.DropDownItems)
                                {
                                    MaterialDrawerItem objSubItem = new MaterialDrawerItem();
                                    objSubItem.Text     = objSubMenuItem.Text;
                                    objSubItem.Tag      = objSubMenuItem.Tag;
                                    objSubItem.Enabled  = objSubMenuItem.Enabled;
                                    objSubItem.AutoSize = false;
                                    objSubItem.Margin   = new Padding(10, 0, 0, 0);
                                    if (objSubMenuItem.GetType() == typeof(MaterialToolStripMenuItem))
                                    {
                                        objSubItem.IconImage = ((MaterialToolStripMenuItem)objSubMenuItem).Image;
                                    }
                                    objSubItem.MouseClick += new MouseEventHandler(DrawerItemClicked);
                                    objSubItem.Size        = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth - 10, 40);
                                    objSubItem.MouseClick -= new MouseEventHandler(DrawerItemClicked);
                                    objSubItem.MouseClick += new MouseEventHandler(DrawerItemClicked);

                                    Controls.Add(objSubItem);
                                    LastControlWasDivider = false;
                                    objSubItem.Location   = new Point(10, objSubItem.Location.Y);
                                }

                                MaterialDivider objBottomDivider = new MaterialDivider();
                                objBottomDivider.Size = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 2);
                                Controls.Add(objBottomDivider);
                                LastControlWasDivider = true;
                            }
                        }
                        if (!Verarbeitet)
                        {
                            MaterialFlatButton objItem = new MaterialFlatButton();
                            objItem.Text          = objMenuItem.Text;
                            objItem.Tag           = objMenuItem.Tag;
                            objItem.Enabled       = objMenuItem.Enabled;
                            objItem.AutoSize      = false;
                            objItem.Margin        = new Padding(0, 0, 0, 0);
                            objItem.Size          = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 40);
                            objItem.MouseClick   -= new MouseEventHandler(DrawerItemClicked);
                            objItem.MouseClick   += new MouseEventHandler(DrawerItemClicked);
                            LastControlWasDivider = false;
                            Controls.Add(objItem);
                        }
                    }
                }
            }
        }