private AccessibleObject GetQuickAccessBarAccesibleObject(int index) { if (index < this.ribbonBar.QuickAccessToolBarItems.Count) { RadItem item = this.ribbonBar.QuickAccessToolBarItems[index]; if (item is RadDropDownButtonElement) { return(new RadDropDownButtonElementAccessibleObject(item as RadDropDownButtonElement)); } else if (item is RadButtonElement) { return(new RadButtonElementAccessibleObject(item as RadButtonElement)); } return(new AccessibleObject()); } else if (index == this.ribbonBar.QuickAccessToolBarItems.Count) { RadToolStripOverFlowButtonElement overFlowButton = this.ribbonBar.RibbonBarElement.QuickAccessToolBar.OverflowButtonElement as RadToolStripOverFlowButtonElement; return(new RadDropDownButtonElementAccessibleObject(overFlowButton)); } return(null); }
/// <summary> /// Initializes the overflow drop down button with the ToolStripItem owner of the /// ToolStripItemsOverFlow instance and the parent element. /// </summary> public void InitializeOverflowDropDown(RadToolStripItem toolStripItem) { this.items = toolStripItem.Items; this.toolStripItem = toolStripItem; this.dropDownButton = new RadToolStripOverFlowButtonElement(); this.DropDownButton.Click += new EventHandler(DropDownButton_Click); this.DropDownButton.ZIndex = 10000; this.DropDownButton.SetValue(ToolStripItemLayout.IsOverFlowButtonElementProperty, true); this.DropDownButton.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); this.DropDownButton.Alignment = ContentAlignment.TopLeft; this.lastParent = this.toolStripItem.ParentToolStripElement; this.hiddenItems = new Stack <RadItem>(); this.hiddenItemsList = new ArrayList(); this.fakeItemsList = new ArrayList(); }
protected override void CreateChildElements() { this.quickAccessItemsPanel = new InnerItem(); this.quickAccessItemsPanel.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren; this.baseLayout = new StackLayoutPanel(); this.baseLayout.Orientation = Orientation.Horizontal; this.baseLayout.EqualChildrenHeight = true; this.baseLayout.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren; this.baseLayout.Class = "QuickAccessToolBarBaseStripLayout"; this.overFlowButton = new RadToolStripOverFlowButtonElement(); this.overFlowButton.Class = "QuickAccessToolBarOverFlow"; this.overFlowButton.Click += new EventHandler(overFlowButton_Click); this.overFlowButton.Margin = new Padding(3, 0, 0, 0); this.overFlowButton.Visibility = ElementVisibility.Collapsed; this.overFlowButton.MaxSize = new Size(0, 16); this.overFlowButton.OverFlowPrimitive.Alignment = ContentAlignment.MiddleCenter; this.overFlowButton.Alignment = ContentAlignment.MiddleLeft; this.overFlowButton.ThemeRole = "QuickAccessOverflowButton"; this.stripFill = new FillPrimitive(); this.stripFill.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren; this.stripFill.Class = "QuickAccessToolBarFill"; this.border = new BorderPrimitive(); this.border.Class = "QuickAccesstBorder"; this.border.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren; this.baseLayout.Children.Add(this.quickAccessItemsPanel); this.baseLayout.Children.Add(this.overFlowButton); this.Children.Add(this.stripFill); this.Children.Add(this.baseLayout); this.Children.Add(this.border); this.items.Owner = quickAccessItemsPanel.StripLayout; this.RefreshItems(); }