/// <summary>
        /// Creates an item of the specified type and adds it to the specified collection
        /// </summary>
        /// <param name="ribbon"></param>
        /// <param name="collection"></param>
        /// <param name="t"></param>
        protected virtual void CreateItem(Ribbon ribbon, RibbonItemCollection collection, Type t)
        {
            IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost;

            if (host != null && collection != null && ribbon != null)
            {
                DesignerTransaction transaction = host.CreateTransaction("AddRibbonItem_" + Component.Site.Name);

                MemberDescriptor member = TypeDescriptor.GetProperties(Component)["Items"];
                base.RaiseComponentChanging(member);

                RibbonItem item = host.CreateComponent(t) as RibbonItem;

                if (!(item is RibbonSeparator))
                {
                    item.Text = item.Site.Name;
                }

                collection.Add(item);
                ribbon.OnRegionsChanged();

                base.RaiseComponentChanged(member, null, null);
                transaction.Commit();
            }
        }
Example #2
0
        private void CreateOrbItem(string collectionName, RibbonItemCollection collection, Type t)
        {
            if (Ribbon == null)
            {
                return;
            }

            IDesignerHost       host        = GetService(typeof(IDesignerHost)) as IDesignerHost;
            DesignerTransaction transaction = host.CreateTransaction("AddRibbonOrbItem_" + Component.Site.Name);
            MemberDescriptor    member      = TypeDescriptor.GetProperties(Ribbon.OrbDropDown)[collectionName];

            RaiseComponentChanging(member);

            RibbonItem item = host.CreateComponent(t) as RibbonItem;

            if (!(item is RibbonSeparator))
            {
                item.Text = item.Site.Name;
            }

            collection.Add(item);
            Ribbon.OrbDropDown.OnRegionsChanged();

            RaiseComponentChanged(member, null, null);
            transaction.Commit();

            Ribbon.OrbDropDown.SelectOnDesigner(item);
            Ribbon.OrbDropDown.WrappedDropDown.Size = Ribbon.OrbDropDown.Size;
        }
Example #3
0
 /// <summary>
 /// Creates a new button
 /// </summary>
 /// <param name="image">Image of the button (32 x 32 suggested)</param>
 /// <param name="smallImage">Image of the button when in medium of compact mode (16 x 16 suggested)</param>
 /// <param name="style">Style of the button</param>
 /// <param name="text">Text of the button</param>
 public RibbonButton()
 {
     _dropDownItems          = new RibbonItemCollection();
     _dropDownArrowSize      = new Size(5, 3);
     _dropDownMargin         = new Padding(6);
     _DropDownArrowDirection = RibbonArrowDirection.Down;
     Image      = CreateImage(32);
     SmallImage = CreateImage(16);
 }
Example #4
0
 /// <summary>
 /// Creates a new RibbonPanel
 /// </summary>
 public RibbonPanel()
 {
     _items             = new RibbonItemCollection();
     _sizeMode          = RibbonElementSizeMode.None;
     _flowsTo           = RibbonPanelFlowDirection.Bottom;
     _buttonMoreEnabled = true;
     _buttonMoreVisible = true;
     _items.SetOwnerPanel(this);
     _enabled = true;
 }
Example #5
0
        public RibbonButtonList()
        {
            _buttons       = new RibbonButtonCollection(this);
            _dropDownItems = new RibbonItemCollection();

            _controlButtonsWidth  = 16;
            _itemsInLargeMode     = 7;
            _itemsInMediumMode    = 3;
            _ItemsInDropwDownMode = new Size(7, 5);
            _buttonsSizeMode      = RibbonElementSizeMode.Large;
            _scrollType           = ListScrollType.UpDownButtons;
        }
Example #6
0
        internal RibbonOrbDropDown(Ribbon ribbon)
            : base()
        {
            DoubleBuffered = true;
            _ribbon        = ribbon;
            _menuItems     = new RibbonItemCollection();
            _recentItems   = new RibbonItemCollection();
            _optionItems   = new RibbonItemCollection();

            _menuItems.SetOwner(Ribbon);
            _recentItems.SetOwner(Ribbon);
            _optionItems.SetOwner(Ribbon);

            _optionsPadding = 6;
            Size            = new System.Drawing.Size(527, 447);
            BorderRoundness = 8;
        }
Example #7
0
 public RibbonComboBox()
 {
     _dropDownItems   = new RibbonItemCollection();
     _dropDownVisible = true;
     _allowTextEdit   = true;
 }