/// <summary> /// Adds a group menu item. /// </summary> /// <param name="name">The name for the instance.</param> /// <param name="text">The text to show on the instance.</param> /// <returns>The group menu item.</returns> public MenuContainer AddGroup(string name, string text) { // create a sub menu that will be shown when this button is pressed, users can add items to this menu var menuVertical = new MenuBarVertical(name + "-Menu") { ConfigExpanded = false }; // create the button var menuBarButton = new MenuItemButton(name + "-Button") { ConfigText = text, Tag = menuVertical }; menuBarButton.MouseClicked += this.OnMouseClicked; menuBarButton.AddControl(menuVertical); menuVertical.ParentButton = menuBarButton; // add that button to me this.AddControl(menuBarButton); this.MustRedraw = true; return(menuVertical); }
/// <summary> /// Adds a group menu item. /// </summary> /// <param name="name">The name for the instance.</param> /// <param name="text">The text to show on the instance.</param> /// <returns>The group menu item.</returns> public MenuContainer AddGroup(string name, string text) { // create a sub menu that will be shown when this button is pressed, users can add items to this menu var menuVertical = new MenuBarVertical(name + "-Menu") { ConfigExpanded = false }; // create the button var menuBarButton = new MenuItemButton(name + "-Button") { ConfigText = text, Tag = menuVertical }; menuBarButton.MouseClicked += this.OnMouseClicked; menuBarButton.AddControl(menuVertical); menuVertical.ParentButton = menuBarButton; // add that button to me this.AddControl(menuBarButton); this.MustRedraw = true; return menuVertical; }