예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <summary>
        /// Adds a button 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 button menu item.</returns>
        public MenuItemButton AddButton(string name, string text)
        {
            var item = new MenuItemButton(name)
            {
                ConfigText = text
            };

            this.AddControl(item);
            this.MustRedraw = true;

            return(item);
        }
예제 #3
0
        /// <summary>
        /// Adds a button 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 button menu item.</returns>
        public MenuItemButton AddButton(string name, string text)
        {
            var item = new MenuItemButton(name)
                           {
                               ConfigText = text
                           };

            this.AddControl(item);
            this.MustRedraw = true;

            return item;
        }
예제 #4
0
        /// <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;
        }