Popup menu.
Inheritance: Flood.GUI.Controls.ScrollControl
Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComboBox"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ComboBox(Control parent)
            : base(parent)
        {
            SetSize(100, 20);
            m_Menu = new Menu(this);
            m_Menu.IsHidden = true;
            m_Menu.IconMarginDisabled = true;
            m_Menu.IsTabable = false;

            DownArrow arrow = new DownArrow(this);
            m_Button = arrow;

            Alignment = Pos.Left | Pos.CenterV;
            Margin = new Margin(3, 0, 0, 0);

            IsTabable = true;
            KeyboardInputEnabled = true;
        }
Ejemplo n.º 2
0
        public void TestMenu()
        {
            var control = new Flood.GUI.Controls.Menu(canvas);
            control.AddItem("item1");
            control.AddItem("item2");
            control.AddItem("item3");
            control.AddDivider();
            control.AddItem("item4");
            control.SizeToChildren();

            GUI.Test(control, "Menu1");
        }