public FontSizeComboBox(AbstractCommand command)
            : base(command)
        {
            AllowTextEdit = false;

            var rbl = new List<RibbonButton>
                          {
                              new RibbonButton("8", Properties.Resources.Heading1),
                              new RibbonButton("10", Properties.Resources.Heading2),
                              new RibbonButton("12", Properties.Resources.Heading3),
                              new RibbonButton("14", Properties.Resources.Heading4),
                              new RibbonButton("18", Properties.Resources.Heading5),
                              new RibbonButton("24", Properties.Resources.Heading6),
                              new RibbonButton("28", Properties.Resources.Heading7)
                          };

            foreach (var rb in rbl)
            {
                rb.MouseUp += rb_MouseUp;
                DropDownItems.Add(rb);
            }

            //TextBoxText = "12";

            FontSizeChanged += FontSizeComboBox_FontSizeChanged;
        }
        public static void AddOrbOptionButton(Utils.Controls.Ribbon.Ribbon ribbon, AbstractCommand command)
        {
            var oob = new RibbonOrbOptionButtonEx(command);
            ribbon.OrbDropDown.OptionItems.Add(oob);

            CommandManager.Instance.Register(command);
        }
 public RibbonComboBoxEx(AbstractCommand command)
 {
     this.command = command;
     Update();
     command.StateChanged += (s, e) => Update();
     TextBoxTextChanged += RibbonComboBoxEx_TextBoxTextChanged;
 }
 public void Register(AbstractCommand command)
 {
     if (commands.ContainsKey(command.Name))
     {
         commands[command.Name] = command;
     }
     else
     {
         commands.Add(command.Name, command);
     }
 }
        public static void AddButton(RibbonQuickAccessToolbar toolbar, AbstractCommand command)
        {
            if (toolbar.IsNull() ||
                command.IsNull())
            {
                throw new ArgumentNullException();
            }

            toolbar.Items.Add(new RibbonButtonEx(command));

            CommandManager.Instance.Register(command);
        }
        public RibbonOrbOptionButtonEx(AbstractCommand command)
        {
            this.command = command;
            Text = command.Text;

            if (command.Image != null)
            {
                Image = SmallImage = command.Image;
            }

            Update();
            command.StateChanged += (s, e) => Update();
        }
        public RibbonContextMenuItemEx(AbstractCommand command)
        {
            this.command = command;
            Text = command.Text;

            if (command.Image != null)
            {
                Image = command.Image;
            }

            Update();
            command.StateChanged += (s, e) => Update();
        }
        public static void AddOrbMenuItem(Utils.Controls.Ribbon.Ribbon ribbon, AbstractCommand command)
        {
            if (ribbon.IsNull() ||
                command.IsNull())
            {
                throw new ArgumentNullException();
            }

            var orbMenuItem = new RibbonOrbMenuItemEx(command);
            ribbon.OrbDropDown.MenuItems.Add(orbMenuItem);

            CommandManager.Instance.Register(command);
        }
        public FontNameComboBox(AbstractCommand command)
            : base(command)
        {
            AllowTextEdit = false;
            var rbl = new List<RibbonButton>
                          {
                              new RibbonButton("Algerian", Properties.Resources.FontTT),
                              new RibbonButton("Arial", Properties.Resources.FontTT),
                              new RibbonButton("Arial Black", Properties.Resources.FontTT),
                              new RibbonButton("Broadway", Properties.Resources.FontTT),
                              new RibbonButton("Calibri", Properties.Resources.FontTT),
                              new RibbonButton("Cambria", Properties.Resources.FontTT),
                              new RibbonButton("Cambria Math", Properties.Resources.FontTT),
                              new RibbonButton("Comic Sans MS", Properties.Resources.FontTT),
                              new RibbonButton("Consolas", Properties.Resources.FontTT),
                              new RibbonButton("Corbel", Properties.Resources.FontTT),
                              new RibbonButton("Courier New", Properties.Resources.FontTT),
                              new RibbonButton("Microsoft Sans Serif", Properties.Resources.FontTT),
                              new RibbonButton("Symbol", Properties.Resources.FontTT),
                              new RibbonButton("Tahoma", Properties.Resources.FontTT),
                              new RibbonButton("Times New Roman", Properties.Resources.FontTT),
                              new RibbonButton("Verdana", Properties.Resources.FontTT),
                              new RibbonButton("Vivaldi", Properties.Resources.FontTT),
                              new RibbonButton("Webdings", Properties.Resources.FontTT)
                          };

            foreach (var rb in rbl)
            {
                rb.MouseUp += rb_MouseUp;
                DropDownItems.Add(rb);
            }

            //TextBoxText = "Times New Roman";

            FontNameChanged += FontNameComboBox_FontNameChanged;
        }
 public RibbonOrbRecentButtonEx(AbstractCommand command)
 {
     this.command = command;
     Update();
     command.StateChanged += (s, e) => Update();
 }
        public static RibbonButtonEx AddButton(RibbonPanel ribbonPanel, AbstractCommand command)
        {
            var button = new RibbonButtonEx(command);
            ribbonPanel.Items.Add(button);

            CommandManager.Instance.Register(command);

            return button;
        }
 public static void AddButton(ToolStripItemCollection itemCollection, AbstractCommand command)
 {
     itemCollection.Add(new RibbonContextMenuItemEx(command));
 }
 public static void AddButton(RibbonContextMenu contextMenu, AbstractCommand command)
 {
     contextMenu.Items.Add(new RibbonContextMenuItemEx(command));
 }
 public static void AddButton(RibbonButton button, AbstractCommand command)
 {
     button.DropDownItems.Add(new RibbonButtonEx(command));
 }
        public static RibbonComboBoxEx AddComboBox(RibbonItemGroup rig, AbstractCommand command, Type t)
        {
            RibbonComboBoxEx cb = null;

            if (t == typeof(FontNameComboBox))
            {
                cb = new FontNameComboBox(command);
            }

            if (t == typeof(FontSizeComboBox))
            {
                cb = new FontSizeComboBox(command);
            }
            
            if (t == typeof(HintFontNameComboBox))
            {
                cb = new HintFontNameComboBox(command);
            }

            if (t == typeof(HintFontSizeComboBox))
            {
                cb = new HintFontSizeComboBox(command);
            }

            rig.Items.Add(cb);

            CommandManager.Instance.Register(command);

            return cb;
        }