internal RibbonPanelPopup(RibbonPanel panel) { DoubleBuffered = true; _sensor = new RibbonMouseSensor(this, panel.Owner, panel.Items); _sensor.PanelLimit = panel; _panel = panel; _panel.PopUp = this; panel.Owner.SuspendSensor(); using (Graphics g = CreateGraphics()) { panel.overflowBoundsBuffer = panel.Bounds; Size s = panel.SwitchToSize(this, g, GetSizeMode(panel)); s.Width += 100; s.Height += 100; Size = s; } foreach (RibbonItem item in panel.Items) { item.SetCanvas(this); } }
internal RibbonPanelPopup(RibbonPanel panel) { SetStyle(ControlStyles.Opaque, false); DoubleBuffered = true; Sensor = new RibbonMouseSensor(this, panel.Owner, panel.Items) { PanelLimit = panel }; Panel = panel; Panel.PopUp = this; panel.Owner.SuspendSensor(); using (Graphics g = CreateGraphics()) { panel.overflowBoundsBuffer = panel.Bounds; Size s = panel.SwitchToSize(this, g, GetSizeMode(panel)); //s.Width += 100; //s.Height += 100; Size = s; } foreach (RibbonItem item in panel.Items) { item.SetCanvas(this); } }
internal RibbonDropDown(RibbonItem parentItem, IEnumerable <RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize) : this() { _items = items; _ownerRibbon = ownerRibbon; _sizingGripHeight = 12; _parentItem = parentItem; _sensor = new RibbonMouseSensor(this, OwnerRibbon, items); _MeasuringSize = measuringSize; _scrollBarSize = 16; if (Items != null) { foreach (RibbonItem item in Items) { item.SetSizeMode(RibbonElementSizeMode.DropDown); item.SetCanvas(this); //If item is a RibbonHost, the MouseSensor will not detect the mouse move event, so manually hook into the event. if (item is RibbonHost) { ((RibbonHost)item).ClientMouseMove += new MouseEventHandler(OnRibbonHostMouseMove); } } } UpdateSize(); }
/// <summary> /// Refreshes the sensor /// </summary> private void UpdateSensor() { if (_sensor != null) { _sensor.Dispose(); } _sensor = new RibbonMouseSensor(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 RibbonMouseSensor(ownerRibbon, ownerRibbon, Items); _DropDownButtonVisible = true; }
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 RibbonMouseSensor(ownerRibbon, ownerRibbon, Items); _DropDownButtonVisible = true; }
/// <summary> /// Drops out the old sensor and creates a new one /// </summary> private void RenewSensor() { if (ActiveTab == null) { return; } if (Sensor != null) { Sensor.Dispose(); } _sensor = new RibbonMouseSensor(this, this, ActiveTab); if (CaptionButtonsVisible) { Sensor.Items.AddRange(new RibbonItem[] { CloseButton, MaximizeRestoreButton, MinimizeButton }); } }
internal RibbonDropDown(RibbonItem parentItem, IEnumerable<RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize) : this() { _items = items; _ownerRibbon = ownerRibbon; _sizingGripHeight = 12; _parentItem = parentItem; _sensor = new RibbonMouseSensor(this, OwnerRibbon, items); _MeasuringSize = measuringSize; if (Items != null) foreach (RibbonItem item in Items) { item.SetSizeMode(RibbonElementSizeMode.DropDown); item.SetCanvas(this); } UpdateSize(); }
internal RibbonDropDown(RibbonItem parentItem, IEnumerable <RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize) : this() { _items = items; _ownerRibbon = ownerRibbon; _sizingGripHeight = 12; _parentItem = parentItem; _sensor = new RibbonMouseSensor(this, OwnerRibbon, items); _MeasuringSize = measuringSize; if (Items != null) { foreach (RibbonItem item in Items) { item.SetSizeMode(RibbonElementSizeMode.DropDown); item.SetCanvas(this); } } UpdateSize(); }
internal RibbonPanelPopup(RibbonPanel panel) { DoubleBuffered = true; _sensor = new RibbonMouseSensor(this, panel.Owner, panel.Items); _sensor.PanelLimit = panel; _panel = panel; _panel.PopUp = this; panel.Owner.SuspendSensor(); using (Graphics g = CreateGraphics()) { panel.overflowBoundsBuffer = panel.Bounds; Size s = panel.SwitchToSize(this, g, GetSizeMode(panel)); Size = s; } foreach (RibbonItem item in panel.Items) { item.SetCanvas(this); } }
/// <summary> /// Drops out the old sensor and creates a new one /// </summary> private void RenewSensor() { if (ActiveTab == null) { return; } if (Sensor != null) Sensor.Dispose(); _sensor = new RibbonMouseSensor(this, this, ActiveTab); if (CaptionButtonsVisible) { Sensor.Items.AddRange(new RibbonItem[] { CloseButton, MaximizeRestoreButton, MinimizeButton }); } }
internal RibbonDropDown(RibbonItem parentItem, IEnumerable<RibbonItem> items, Ribbon ownerRibbon, RibbonElementSizeMode measuringSize) : this() { _items = items; _ownerRibbon = ownerRibbon; _sizingGripHeight = 12; _parentItem = parentItem; _sensor = new RibbonMouseSensor(this, OwnerRibbon, items); _MeasuringSize = measuringSize; _scrollBarSize = 16; if (Items != null) foreach (RibbonItem item in Items) { item.SetSizeMode(RibbonElementSizeMode.DropDown); item.SetCanvas(this); //If item is a RibbonHost, the MouseSensor will not detect the mouse move event, so manually hook into the event. if (item is RibbonHost) { ((RibbonHost)item).ClientMouseMove += new MouseEventHandler(OnRibbonHostMouseMove); } } UpdateSize(); }