Exemplo n.º 1
0
        public ToolStripEx AddToolStripEx(string name, string caption, string headerName)
        {
            ToolStripTabItem item = GetHeaderItem(headerName);
            ToolStripEx      stripEx;

            for (int i = 0; i < item.Panel.Controls.Count; i++)
            {
                Control control = item.Panel.Controls[i];
                if (control.Name == name)
                {
                    return(control as ToolStripEx);
                }
            }
            ToolStripEx ex = new ToolStripEx();

            ex.Name        = name;
            ex.Text        = caption;
            ex.AutoSize    = true;
            ex.CanOverflow = true;
            ex.Stretch     = true;
            ex.Dock        = DockStyle.None;
            ex.LayoutStyle = ToolStripLayoutStyle.HorizontalStackWithOverflow;
            item.Panel.Controls.Add(ex);
            return(ex);
        }
Exemplo n.º 2
0
        public static ToolStripTabItem AddTab(this RibbonControlAdv control, string text)
        {
            var item = new ToolStripTabItem();

            item.Text = text;
            item.Font = Appearances.DefaultFont;
            control.Header.AddMainItem(item);
            return(item);
        }
Exemplo n.º 3
0
        public static ToolStripEx AddGroup(this ToolStripTabItem parent, string text = null)
        {
            var item = new ToolStripEx();

            item.AutoSize    = true;
            item.GripStyle   = ToolStripGripStyle.Hidden;
            item.CaptionFont = Appearances.DefaultFont;
            item.Font        = Appearances.DefaultFont;
            item.Text        = text;
            parent.Panel.Controls.Add(item);
            return(item);
        }
Exemplo n.º 4
0
        public ToolStripEx GetToolStripEx(string name, string headerName)
        {
            ToolStripTabItem item = GetHeaderItem(headerName);
            ToolStripEx      stripEx;

            for (int i = 0; i < item.Panel.Controls.Count; i++)
            {
                Control control = item.Panel.Controls[i];
                if (control.Name == name)
                {
                    return(control as ToolStripEx);
                }
            }
            return(null);
        }
Exemplo n.º 5
0
        public ToolStripTabItem AddHeaderTab(string name, string caption)
        {
            ToolStripTabItem item = GetHeaderItem(name);

            if (item != null)
            {
                return(item);
            }
            item                      = new ToolStripTabItem();
            item.Name                 = name;
            item.Text                 = caption;
            item.Panel.Name           = name + "_panel";
            item.Panel.ScrollPosition = 0;
            _control.Header.AddMainItem(item);
            return(item);
        }
Exemplo n.º 6
0
        private void ToolStripTabItem_Click(object sender, EventArgs e)
        {
            ToolStripTabItem toolStripTabItem = sender as ToolStripTabItem;

            if (toolStripTabItem == this.toolStripTabItem4)
            {
                this.gradientPanel1.Visible = true;
                this.richTextBox1.Visible   = false;
            }
            else if (toolStripTabItem == this.toolStripTabItem9)
            {
                this.gradientPanel1.Visible = false;
                this.richTextBox1.Visible   = true;
                this.richTextBox1.Dock      = DockStyle.Fill;
            }
            else
            {
                this.gradientPanel1.Visible = false;
                this.richTextBox1.Visible   = false;
            }
        }
Exemplo n.º 7
0
 protected override IDropDownMenuItem AddDropDown(string text, string key, Bitmap icon, PluginIdentity identity, bool isFirst = false)
 {
     if (!isFirst)
     {
         var item = new ParentBarItem(text)
         {
             Padding = new Point(TOOLBAR_ITEM_PADDING_X, TOOLBAR_ITEM_PADDING_Y)
         };
         var menuItem = AddItem(item, identity, key) as IDropDownMenuItem;
         MenuIcon.AssignIcon(menuItem, icon);
         return(menuItem);
     }
     else
     {
         var item = new ToolStripTabItem()
         {
             Text = text, Name = key, Image = icon,
         };
         var menuItem = AddItem(item, identity, key) as IDropDownMenuItem;
         MenuIcon.AssignIcon(menuItem, icon);
         return(menuItem);
     }
 }
Exemplo n.º 8
0
 protected IMenuItem AddItem(ToolStripTabItem item, PluginIdentity identity, string key)
 {
     item.Tag = new MenuItemMetadata(identity, key);
     return(AddItemCore(item, key, false, false));
 }