public RibbonTextEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonItem item, Rectangle bounds, string text, StringFormat format) : base(owner, g, clip, item, bounds) { Text = text; Style = FontStyle.Regular; Format = format; Color = Color.Empty; }
public RibbonTextEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonItem item, Rectangle bounds, string text, FontStyle style) : base(owner, g, clip, item, bounds) { Text = text; Style = style; Format = new StringFormat(); Color = Color.Empty; }
public RibbonTextEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonItem item, Rectangle bounds, string text, Color color, FontStyle style, StringFormat format) : base(owner, g, clip, item, bounds) { Text = text; Style = style; Format = format; Color = color; }
/// <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) { CheckRestrictions(item as RibbonButton); item.SetOwner(Owner); item.SetOwnerPanel(OwnerPanel); item.SetOwnerTab(OwnerTab); item.SetOwnerItem(OwnerList); base.Insert(index, 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); }
public RibbonItemRenderEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonItem item) : base(owner, g, clip) { Item = 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; item.SetOwnerGroup(OwnerGroup); base.Insert(index, item); }
/// <summary> /// Adds the specified item to the collection /// </summary> public new void Add(RibbonItem item) { item.MaxSizeMode = RibbonElementSizeMode.Compact; item.SetOwnerGroup(OwnerGroup); base.Add(item); }
/// <summary> /// Updates the bounds of child elements when flow is to bottom /// </summary> private void UpdateRegionsFlowsToRight(Graphics g, RibbonElementSizeMode mode) { int curLeft = ContentBounds.Left; int curTop = ContentBounds.Top; int padding = mode == RibbonElementSizeMode.Medium ? 7 : 0; int maxBottom = 0; #region Sorts from larger to smaller RibbonItem[] array = Items.ToArray(); for (int i = (array.Length - 1); i >= 0; i--) { for (int j = 1; j <= i; j++) { if (array[j - 1].LastMeasuredSize.Width < array[j].LastMeasuredSize.Width) { RibbonItem temp = array[j - 1]; array[j - 1] = array[j]; array[j] = temp; } } } #endregion List <RibbonItem> list = new List <RibbonItem>(array); ///Attend elements, deleting every attended element from the list while (list.Count > 0) { ///Extract item and delete it RibbonItem item = list[0]; list.Remove(item); ///If not enough space left, reset left and advance top if (curLeft + item.LastMeasuredSize.Width > ContentBounds.Right) { curLeft = ContentBounds.Left; curTop = maxBottom + Owner.ItemPadding.Vertical + 1 + padding; } ///Set item's bounds item.SetBounds(new Rectangle(new Point(curLeft, curTop), item.LastMeasuredSize)); ///Increment reminders curLeft += item.Bounds.Width + Owner.ItemPadding.Horizontal; maxBottom = Math.Max(maxBottom, item.Bounds.Bottom); ///Check available space after placing item int spaceAvailable = ContentBounds.Right - curLeft; ///Check for elements that fit on available space for (int i = 0; i < list.Count; i++) { ///If item fits on the available space if (list[i].LastMeasuredSize.Width < spaceAvailable) { ///Place the item there and reset the counter to check for further items list[i].SetBounds(new Rectangle(new Point(curLeft, curTop), list[i].LastMeasuredSize)); curLeft += list[i].Bounds.Width + Owner.ItemPadding.Horizontal; maxBottom = Math.Max(maxBottom, list[i].Bounds.Bottom); spaceAvailable = ContentBounds.Right - curLeft; list.RemoveAt(i); i = 0; } } } }
public RibbonItemBoundsEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonItem item, Rectangle bounds) : base(owner, g, clip, item) { Bounds = bounds; }