Example #1
0
        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);
        }
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;
        }
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);
        }
Example #7
0
 public RibbonComboBox()
 {
     _dropDownItems   = new RibbonItemCollection();
     _dropDownVisible = true;
     _allowTextEdit   = true;
 }