internal RibbonDropDown( RibbonItem parentItem, IEnumerable <RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize) : this() { _items = items; _ownerRibbon = ownerRibbon; _sizingGripHeight = 12; _parentItem = parentItem; _sensor = new RibbonSensor(this, OwnerRibbon, items); _MeasuringSize = measuringSize; if (Items != null) { foreach (RibbonItem item in Items) { item.SetSizeMode(RibbonElementSizeMode.DropDown); item.SetCanvas(this); } } UpdateSize(); UpdateItemsBounds(); }
/// <summary> /// Refreshes the sensor /// </summary> private void UpdateSensor() { if (_sensor != null) { _sensor.Dispose(); } _sensor = new RibbonSensor(this, Ribbon, AllItems); }
internal RibbonQuickAccessToolbar(Ribbon ownerRibbon) { if (ownerRibbon == null) { throw new ArgumentNullException("ownerRibbon"); } SetOwner(ownerRibbon); _dropDownButton = new RibbonButton(); _dropDownButton.SetOwner(ownerRibbon); _dropDownButton.SmallImage = CreateDropDownButtonImage(); _margin = new Padding(9); _padding = new Padding(3, 0, 0, 0); _items = new RibbonQuickAccessToolbarItemCollection(this); _sensor = new RibbonSensor(ownerRibbon, ownerRibbon, Items); _DropDownButtonVisible = true; }
internal RibbonPanelPopup(RibbonPanel panel) { DoubleBuffered = true; _sensor = new RibbonSensor(this, panel.Owner, panel.OwnerTab); _sensor.PanelLimit = panel; _panel = panel; _panel.PopUp = this; using (Graphics g = CreateGraphics()) { Size s = panel.MeasureSize(this, new RibbonElementMeasureSizeEventArgs(g, GetSizeMode(panel))); //s.Width+=3; s.Height+=3; Size = s; panel.SetBounds(new Rectangle(0, 0, Size.Width, Size.Height)); panel.UpdateItemsRegions(g, GetSizeMode(panel)); } foreach (RibbonItem item in panel.Items) { item.SetCanvas(this); } }