Exemplo n.º 1
0
        bool pressed = false; // Ensure clicks only register if we have released first

        #endregion Fields

        #region Constructors

        public DToggleButton(DGuiManager guiManager, float x, float y, string _text, int _width, int _height, 
            Color _fillColor, Color _borderColor,
            Color _clickedFillColor, Color _clickedBorderColor)
            : this(guiManager, x, y, _text, _width, _height, _fillColor, _borderColor)
        {
            SetClickedColors(_clickedFillColor, _clickedBorderColor);
        }
Exemplo n.º 2
0
 public DMultiLineTextBox(DGuiManager guiManager, float x, float y, int width, int height, string text, 
     Color fillColor, Color borderColor)
     : this(guiManager, x, y, width, height, text)
 {
     this.ColorTheme.FillColor = fillColor;
     this.ColorTheme.BorderColor = borderColor;
 }
Exemplo n.º 3
0
 public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height, 
     Color _fillColor, Color _borderColor)
     : this(guiManager, x, y, _width, _height)
 {
     this.FillColor = _fillColor;
     this.BorderColor = _borderColor;
 }
Exemplo n.º 4
0
        public override void Initialize()
        {
            base.Initialize();

            gui_manager = game.GuiManager;

            form = new DForm(gui_manager, "test", null);
            form.Size = new Vector2(800, 600);
            form.Position = new Vector2(0, 0);
            form.Alpha = 0;
            form.Initialize();
            gui_manager.AddControl(form);

            DLayoutFlow layout = new DLayoutFlow(2, 2, 60, 20, DLayoutFlow.DLayoutFlowStyle.Vertically);
            layout.Position = new Vector2(10, 10);

            button1 = new DButton(gui_manager);
            layout.Add(button1);
            button1.Text = "test";
            button1.Initialize();
            form.AddPanel(button1);
            button1.OnClick += new DButtonEventHandler(button_OnClick);

            check1 = new DCheckbox(gui_manager);
            layout.Add(check1);
             check1.Text = "Enable Fog";
            check1.FontColor = Color.White;
            check1.FillColor = Color.Wheat;
            check1.Checked = true;
            check1.Initialize();
            form.AddPanel(check1);
            check1.OnToggle += new CheckboxEventHandler(check_OnCheck);
        }
Exemplo n.º 5
0
 public DCheckbox(DGuiManager guiManager, float x, float y, string _text, 
     Color _fillColor, Color _borderColor)
     : this(guiManager, x, y, _text)
 {
     this.FillColor = _fillColor;
     this.BorderColor = _borderColor;
 }
Exemplo n.º 6
0
 public DToggleButton(DGuiManager guiManager, float x, float y, string _text, int _width, int _height, 
     Color _fillColor, Color _borderColor)
     : this(guiManager, x, y, _text, _width, _height)
 {
     this.FillColor = _fillColor;
     this.BorderColor = _borderColor;
 }
Exemplo n.º 7
0
 public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height, 
     Color _fillColor, Color _borderColor,
     Color _buttonFillColor, Color _buttonBorderColor)
     : this(guiManager, x, y, _width, _height, _fillColor, _borderColor)
 {
     SetButtonColors(_buttonFillColor, _buttonBorderColor);
 }
Exemplo n.º 8
0
        public DButtonBase(DGuiManager guiManager)
            : base(guiManager)
        {
            Size = new Vector2(WIDTH, HEIGHT);
            UseHoverColor = true;

            label = new DText(guiManager);
        }
Exemplo n.º 9
0
 public DCheckbox(DGuiManager guiManager, float x, float y, string _text, 
     Color _fillColor, Color _borderColor,
     Color _checkedFillColor, Color _checkedBorderColor)
     : this(guiManager, x, y, _text, _fillColor, _borderColor)
 {
     this.ClickedFillColor = _checkedFillColor;
     this.ClickedBorderColor = _checkedBorderColor;
 }
Exemplo n.º 10
0
        Color _tintColor = Color.White; // Tint color, if you're into that sort of thing

        #endregion Fields

        #region Constructors

        public DPanel(DGuiManager guiManager)
            : base(guiManager.Game)
        {
            _guiManager = guiManager;
            _origin = new Vector2(0, 0);
            Size = new Vector2(1, 1);

            _guiManager.OnFocusQueueReject += new DGuiManagerFocusQueueHandler(_guiManager_OnFocusQueueReject);
        }
Exemplo n.º 11
0
        public DImage(DGuiManager guiManager)
            : base(guiManager)
        {
            Size = new Vector2(WIDTH, HEIGHT);

            content = new ContentManager(guiManager.Game.Services);
            content.RootDirectory = "Content";
            _acceptsFocus = false;
        }
Exemplo n.º 12
0
Arquivo: DText.cs Projeto: konlil/pipe
        public DText(DGuiManager guiManager)
            : base(guiManager)
        {
            Size = new Vector2(WIDTH, HEIGHT);

            content = new ContentManager(guiManager.Game.Services);
            content.RootDirectory = "Content";
            text = string.Empty;  // hack to avoid a render-time null check
            _acceptsFocus = false;
        }
Exemplo n.º 13
0
        public DToggleButton(DGuiManager guiManager)
            : base(guiManager)
        {
            //FillColor = Color.Ivory;
            //BorderColor = new Color(40,40,40);
            //HoverFillColor = Color.Cornsilk;
            //HoverBorderColor = new Color(40, 40, 40);

            OnToggle += new ToggleButtonEventHandler(Toggle);
        }
Exemplo n.º 14
0
Arquivo: DGrid.cs Projeto: konlil/pipe
        public DGrid(DGuiManager guiManager, int columns, int rows)
            : base(guiManager)
        {
            _guiManager = guiManager;
            _columns = columns;
            _rows = rows;
            if (_columns <= 0 || _rows <= 0)
                throw new Exception("Cannot create a DGrid with zero or negative columns/rows.");

            GridColor = ColorTheme.FillColor;
        }
Exemplo n.º 15
0
Arquivo: DForm.cs Projeto: konlil/pipe
        public DForm(DGuiManager guiManager, string formName, DForm parent)
            : base(guiManager)
        {
            _isForm = true;
            name = formName;
            parentForm = parent;
            childForms = new Dictionary<string,DForm>();
            Size = new Vector2(FORM_WIDTH, FORM_HEIGHT);

            // Center by default
            this.Position = new Vector2((guiManager.Game.Window.ClientBounds.Width - Size.X) / 2f,
                                        (guiManager.Game.Window.ClientBounds.Height - Size.Y) / 2f);
        }
Exemplo n.º 16
0
        public DCheckbox(DGuiManager guiManager)
            : base(guiManager)
        {
            FillColor = ColorTheme.InputFillColor;
            BorderColor = ColorTheme.BorderColor;

            Size = new Vector2(BOXSIZE, BOXSIZE);
            //SetCentered(true);

            //content = new ContentManager(game.Services);
            //content.RootDirectory = Path.Combine("Content", "fonts");
            Text = "";
            OnCheck += new CheckboxEventHandler(Check);
            OnUncheck += new CheckboxEventHandler(Uncheck);
        }
Exemplo n.º 17
0
        protected override void LoadContent()
        {
            base.LoadContent();

            guiManager = new DGuiManager(game, game.spriteBatch);

            layout = new DLayoutFlow(1, 12, DLayoutFlow.DLayoutFlowStyle.Vertically);
            layout.Position = new Vector2(10, 10);

            form = new DForm(guiManager, "Gunbound", null);
            form.Size = new Vector2(800, 600);
            form.Position = new Vector2(0, 0);
            form.Initialize();
            guiManager.AddControl(form);
        }
Exemplo n.º 18
0
        public DListBoxItem(DGuiManager guiManager, string _text)
            : base(guiManager)
        {
            text = "";
            if (_text != null)
                text = _text;

            FillColor = Color.LightYellow;
            BorderColor = Color.LemonChiffon;
            HoverFillColor = Color.Ivory;
            HoverBorderColor = Color.Wheat;
            Size = new Vector2(WIDTH, HEIGHT);
            UseHoverColor = true;
            content = new ContentManager(guiManager.Game.Services);
            content.RootDirectory = "Content";
        }
Exemplo n.º 19
0
        public DGoldenPanel(DGuiManager guiManager, int dimension, DGoldenPanelAlignment _alignment)
            : this(guiManager)
        {
            alignment = _alignment;
            float height = dimension;
            float width = dimension;

            // Use golden ratio to get size
            // The longest side is used to obtain the length of the shorter.
            if (alignment == DGoldenPanelAlignment.Horizontal)
                height = GoldenRatio.ShortFromLong(width);
            else
                width = GoldenRatio.ShortFromLong(height);

            Size = new Vector2(width, height);
        }
Exemplo n.º 20
0
 public DCheckbox(DGuiManager guiManager, float x, float y, string _text)
     : this(guiManager, x, y)
 {
     if (_text != null)
         Text = _text;
 }
Exemplo n.º 21
0
 public DToggleButton(DGuiManager guiManager, float x, float y, string _text)
     : this(guiManager, x, y)
 {
     if (_text != null)
         Text = _text;
 }
Exemplo n.º 22
0
 public DComboBox(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
Exemplo n.º 23
0
 public DScrollBar(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
Exemplo n.º 24
0
 public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height)
     : this(guiManager, x, y)
 {
     this.Size = new Vector2(_width, _height);
 }
Exemplo n.º 25
0
 public DMultiLineTextBox(DGuiManager guiManager)
     : base(guiManager)
 {
     FillColor = ColorTheme.InputFillColor;
     BorderColor = ColorTheme.BorderColor;
     Size = new Vector2(WIDTH, HEIGHT);
 }
Exemplo n.º 26
0
 public DToggleButton(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
Exemplo n.º 27
0
 public DGoldenPanel(DGuiManager guiManager)
     : base(guiManager)
 {
 }
Exemplo n.º 28
0
        public DScrollBar(DGuiManager guiManager)
            : base(guiManager)
        {
            FillColor = Color.White;
            BorderColor = Color.Gainsboro;

            //HoverFillColor = Color.Cornsilk;
            //HoverBorderColor = new Color(40, 40, 40);

            //UseHoverColor = true;
        }
Exemplo n.º 29
0
 public DComboBox(DGuiManager guiManager)
     : base(guiManager)
 {
     Size = new Vector2(DEFAULT_WIDTH, DEFAULT_HEIGHT);
     Text = "";
 }
Exemplo n.º 30
0
 public DToggleButton(DGuiManager guiManager, float x, float y, string _text, int _width, int _height)
     : this(guiManager, x, y, _text)
 {
     this.Size = new Vector2(_width, _height);
 }