public RibbonItemBoundsEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonItem item, Rectangle bounds) : base(owner, g, clip, item) { Bounds = bounds; }
/// <summary> /// Sets the value of the OwnerList property /// </summary> /// <param name="ownerList"></param> internal virtual void SetOwnerGroup(RibbonItemGroup ownerGroup) { _ownerItem = ownerGroup; }
/// <summary> /// Sets the value of the <see cref="OwnerItem"/> property /// </summary> /// <param name="item"></param> internal virtual void SetOwnerItem(RibbonItem item) { _ownerItem = item; }
/// <summary> /// Inserts the specified item at the desired index /// </summary> /// <param name="index">Desired index of the item</param> /// <param name="item">Item to insert</param> public new void Insert(int index, RibbonItem item) { item.MaxSizeMode = RibbonElementSizeMode.Compact; base.Insert(index, item); }
/// <summary> /// Adds the specified item to the collection /// </summary> public new void Add(RibbonItem item) { item.MaxSizeMode = RibbonElementSizeMode.Compact; base.Add(item); }
private void HitOn(int x, int y) { if (Ribbon.Tabs.Count == 0 || Ribbon.ActiveTab == null) { SelectRibbon(); return; } if (Ribbon != null) { if (Ribbon.TabHitTest(x, y)) { SelectedElement = Ribbon.ActiveTab; } else { #region Tab ScrollTest if (Ribbon.ActiveTab.TabContentBounds.Contains(x, y)) { if (Ribbon.ActiveTab.ScrollLeftBounds.Contains(x, y) && Ribbon.ActiveTab.ScrollLeftVisible) { Ribbon.ActiveTab.ScrollLeft(); SelectedElement = Ribbon.ActiveTab; return; } if (Ribbon.ActiveTab.ScrollRightBounds.Contains(x, y) && Ribbon.ActiveTab.ScrollRightVisible) { Ribbon.ActiveTab.ScrollRight(); SelectedElement = Ribbon.ActiveTab; return; } } #endregion //Check Panel if (Ribbon.ActiveTab.TabContentBounds.Contains(x, y)) { RibbonPanel hittedPanel = null; foreach (RibbonPanel panel in Ribbon.ActiveTab.Panels) { if (panel.Bounds.Contains(x, y)) { hittedPanel = panel; break; } } if (hittedPanel != null) { //Check item RibbonItem hittedItem = null; foreach (RibbonItem item in hittedPanel.Items) { if (item.Bounds.Contains(x, y)) { hittedItem = item; break; } } if (hittedItem != null && hittedItem is IContainsSelectableRibbonItems) { //Check subitem RibbonItem hittedSubItem = null; foreach (RibbonItem subItem in (hittedItem as IContainsSelectableRibbonItems).GetItems()) { if (subItem.Bounds.Contains(x, y)) { hittedSubItem = subItem; break; } } if (hittedSubItem != null) { SelectedElement = hittedSubItem; } else { SelectedElement = hittedItem; } } else if (hittedItem != null) { SelectedElement = hittedItem; } else { SelectedElement = hittedPanel; } } else { SelectedElement = Ribbon.ActiveTab; } } else if (Ribbon.QuickAcessToolbar.SuperBounds.Contains(x, y)) { bool itemHitted = false; foreach (RibbonItem item in Ribbon.QuickAcessToolbar.Items) { if (item.Bounds.Contains(x, y)) { itemHitted = true; SelectedElement = item; break; } } if (!itemHitted) { SelectedElement = Ribbon.QuickAcessToolbar; } } else if (Ribbon.OrbBounds.Contains(x, y)) { Ribbon.OrbMouseDown(); } else { SelectRibbon(); Ribbon.ForceOrbMenu = false; if (Ribbon.OrbDropDown.Visible) { Ribbon.OrbDropDown.Close(); } } } } }