Esempio n. 1
0
        public G_TextBox CloneChild(GuiElement parent)
        {
            G_TextBox clone = (G_TextBox)base.Clone(parent);

            //clone.TextChanged = null;

            if (ValueChanged != null)
            {
                clone.ValueChanged = (Action <object>)ValueChanged.Clone();
            }
            if (PressRight != null)
            {
                clone.PressRight = (Action)PressRight.Clone();
            }
            return(clone);
        }
        private void Initialize()
        {
            btn = new G_B_Sprite(new M_Rectangle(new Vector2(size.X - size.Y, 0), new Vector2(size.Y)),
                                 new Sprite(Vector2.Zero, ContentLoader.textures["btn_edit"]),
                                 BtnPressLeft, true, depth)
            {
                parent = this
            };
            btn.PressRight = g => PressRight();

            txt = new G_TextBox(new M_Rectangle(new Vector2(0, 0), new Vector2(size.X - size.Y, size.Y)), TextChanged, new KeyCollection().AddNumbers().Add(Input.dot, Input.comma), -1, depth)
            {
                parent = this
            };
            txt.PressRight = PressRight;

            txt.text = MyConverter.ToString(rect);

            isPosSet = false;
        }
Esempio n. 3
0
        private void Initialize()
        {
            btn = new G_B_Text(new M_Rectangle(new Vector2(size.X - size.Y, 0), new Vector2(size.Y)), "", BtnPressLeft, false, null, null, depth)
            {
                parent = this
            };
            btn.PressRight += BtnPressRight;
            if (color.HasValue)
            {
                btn.colorHover = btn.colorHoverPressed = btn.colorNormal = btn.colorPressed = color.Value;
            }

            txt = new G_TextBox(new M_Rectangle(new Vector2(0, 0), new Vector2(size.X - size.Y, size.Y)), TextChanged, new KeyCollection().AddHex(), 6, depth)
            {
                parent = this
            };

            if (color.HasValue)
            {
                txt.text = MyConverter.ToString(color.Value);
            }

            ValueChanged = MyColorChanged;
        }
Esempio n. 4
0
        private void Initialize()
        {
            value = null;

            btn = new G_B_Sprite(new M_Rectangle(new Vector2(size.X - size.Y, 0), new Vector2(size.Y)),
                                 new Sprite(Vector2.Zero, ContentLoader.textures["btn_edit"])
                                 , BtnPressLeft, false, depth)
            {
                parent = this
            };
            btn.PressRight += BtnPressRight;

            ValueChanged = MyValueChanged;

            txt = new G_TextBox(new M_Rectangle(new Vector2(0, 0), new Vector2(size.X - size.Y, size.Y)), TextChanged, new KeyCollection().AddNumbers().AddPlusMinus(), -1, depth)
            {
                parent = this
            };

            if (decimalPlaces > 0)
            {
                txt.keyCollection = txt.keyCollection.Add(new KeyP[] { Input.dot });
            }
        }