Beispiel #1
0
        public CheckBox() : base()
        {
            ToggleMode = true;

            var hBox = new HBoxContainer
            {
                StyleClasses = { StyleClassCheckBox },
                MouseFilter  = MouseFilterMode.Ignore
            };

            AddChild(hBox);

            TextureRect = new TextureRect
            {
                StyleClasses = { StyleClassCheckBox },
                MouseFilter  = MouseFilterMode.Ignore
            };
            hBox.AddChild(TextureRect);

            Label = new Label
            {
                MouseFilter = MouseFilterMode.Ignore
            };
            hBox.AddChild(Label);
        }
        public OptionButton()
        {
            Prefix     = "";
            OnPressed += _onPressed;

            var hBox = new HBoxContainer
            {
                MouseFilter = MouseFilterMode.Ignore
            };

            AddChild(hBox);

            _popup = new Popup();
            UserInterfaceManager.ModalRoot.AddChild(_popup);
            _popupVBox = new VBoxContainer();
            _popup.AddChild(_popupVBox);

            _label = new Label
            {
                StyleClasses        = { StyleClassOptionButton },
                SizeFlagsHorizontal = SizeFlags.FillExpand,
                MouseFilter         = MouseFilterMode.Ignore
            };
            hBox.AddChild(_label);

            var textureRect = new TextureRect
            {
                StyleClasses      = { StyleClassOptionTriangle },
                SizeFlagsVertical = SizeFlags.ShrinkCenter,
                MouseFilter       = MouseFilterMode.Ignore
            };

            hBox.AddChild(textureRect);
        }
Beispiel #3
0
 public MenuBar()
 {
     _popup = new Popup
     {
         Children =
         {
             (_popupVBox           = new VBoxContainer {
                 CustomMinimumSize = new Vector2(300, 0)
             })
         }
     };
     _popup.OnPopupHide += PopupHidden;
     UserInterfaceManager.ModalRoot.AddChild(_popup);
     Menus          = new MenuCollection(this);
     AddChild(_hBox = new HBoxContainer {
         SeparationOverride = 8
     });
 }