/// <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)
        {
            if (GetService(typeof(IDesignerHost)) is IDesignerHost host && collection != null && ribbon != null)
            {
                DesignerTransaction transaction = host.CreateTransaction("AddRibbonItem_" + Component.Site.Name);

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

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

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

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

                RaiseComponentChanged(member, null, null);
                transaction.Commit();
            }
        }
예제 #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;
        }
예제 #3
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;

            AutoSizeContentButtons     = DefaultAutoSizeContentButtons;
            ContentButtonsMinWidth     = DefaultContentButtonsMinWidth;
            ContentRecentItemsMinWidth = DefaultContentRecentItemsMinWidth;

            //if (!(Site != null && Site.DesignMode))
            //{
            //   _keyboardHook = new GlobalHook(GlobalHook.HookTypes.Keyboard);
            //   _keyboardHook.KeyUp += new KeyEventHandler(_keyboardHook_KeyUp);
            //}
        }
예제 #4
0
 public RibbonComboBox()
 {
     _dropDownItems     = new RibbonItemCollection();
     _dropDownVisible   = true;
     AllowTextEdit      = true;
     _iconsBar          = true;
     _dropDownMaxHeight = 0;
 }
예제 #5
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);
     Image      = CreateImage(32);
     SmallImage = CreateImage(16);
 }
예제 #6
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;
 }
예제 #7
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();
     _dropDownItems.SetOwnerItem(this);
     _dropDownArrowSize = new Size(5, 3);
     _dropDownMargin    = new Padding(6);
     Image      = CreateImage(32);
     SmallImage = CreateImage(16);
     _iconsBar  = true;
 }
예제 #8
0
 public RibbonComboBox()
 {
     _dropDownItems = new RibbonItemCollection();
     _dropDownItems.SetOwnerItem(this);
     _dropDownVisible      = false;
     AllowTextEdit         = true;
     _iconsBar             = true;
     _dropDownMaxHeight    = 0;
     _disableTextboxCursor = true;
 }
예제 #9
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);
     _iconsBar  = true;
 }
예제 #10
0
        public RibbonButtonList()
        {
            _buttons       = new RibbonButtonCollection(this);
            _dropDownItems = new RibbonItemCollection();

            _controlButtonsWidth  = 16;
            _itemsInLargeMode     = 7;
            _itemsInMediumMode    = 3;
            _ItemsInDropwDownMode = new Size(7, 5);
            _buttonsSizeMode      = RibbonElementSizeMode.Large;
        }
        public RibbonButtonList()
        {
            Buttons       = new RibbonButtonCollection(this);
            DropDownItems = new RibbonItemCollection();
            DropDownItems.SetOwnerItem(this);

            _controlButtonsWidth  = 16;
            _itemsInLargeMode     = 7;
            _itemsInMediumMode    = 3;
            _ItemsInDropwDownMode = new Size(7, 5);
            _buttonsSizeMode      = RibbonElementSizeMode.Large;
            ScrollType            = ListScrollType.UpDownButtons;
        }
예제 #12
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()
 {
     _style = RibbonButtonStyle.Normal;
     _dropDownArrowDirection = RibbonArrowDirection.Down;
     _assignedHandlers       = new Set <RibbonItem>();
     DropDownItems           = new RibbonItemCollection();
     DropDownItems.SetOwnerItem(this);
     _dropDownArrowSize = new Size(5, 3);
     _dropDownMargin    = new Padding(6);
     Image                = CreateImage(32);
     SmallImage           = CreateImage(16);
     DrawDropDownIconsBar = true;
 }
예제 #13
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);
        }
예제 #14
0
        internal RibbonOrbDropDown(Ribbon ribbon)
        {
            DoubleBuffered = true;
            Ribbon         = ribbon;
            MenuItems      = new RibbonItemCollection();
            RecentItems    = new RibbonItemCollection();
            OptionItems    = new RibbonItemCollection();

            MenuItems.SetOwner(Ribbon);
            RecentItems.SetOwner(Ribbon);
            OptionItems.SetOwner(Ribbon);

            OptionItemsPadding = 6;
            Size            = new Size(527, 447);
            BorderRoundness = 8;

            //if (!(Site != null && Site.DesignMode))
            //{
            //   _keyboardHook = new GlobalHook(GlobalHook.HookTypes.Keyboard);
            //   _keyboardHook.KeyUp += new KeyEventHandler(_keyboardHook_KeyUp);
            //}
        }
예제 #15
0
 public RibbonComboBox()
 {
     _dropDownItems = new RibbonItemCollection();
     _allowTextEdit = true;
 }