示例#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);
        }
示例#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;
 }
示例#3
0
文件: DScrollBar.cs 项目: konlil/pipe
 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;
 }
示例#4
0
文件: MainUI.cs 项目: konlil/pipe
        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);
        }
示例#5
0
文件: DCheckbox.cs 项目: konlil/pipe
 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;
 }
示例#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;
 }
示例#7
0
文件: DScrollBar.cs 项目: konlil/pipe
 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);
 }
示例#8
0
        public DButtonBase(DGuiManager guiManager)
            : base(guiManager)
        {
            Size = new Vector2(WIDTH, HEIGHT);
            UseHoverColor = true;

            label = new DText(guiManager);
        }
示例#9
0
文件: DCheckbox.cs 项目: konlil/pipe
 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;
 }
示例#10
0
文件: DPanel.cs 项目: konlil/pipe
        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);
        }
示例#11
0
文件: DImage.cs 项目: konlil/pipe
        public DImage(DGuiManager guiManager)
            : base(guiManager)
        {
            Size = new Vector2(WIDTH, HEIGHT);

            content = new ContentManager(guiManager.Game.Services);
            content.RootDirectory = "Content";
            _acceptsFocus = false;
        }
示例#12
0
文件: DText.cs 项目: 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;
        }
示例#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);
        }
示例#14
0
文件: DGrid.cs 项目: 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;
        }
示例#15
0
文件: DForm.cs 项目: 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);
        }
示例#16
0
文件: DCheckbox.cs 项目: konlil/pipe
        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);
        }
示例#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);
        }
示例#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";
        }
示例#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);
        }
示例#20
0
文件: DCheckbox.cs 项目: konlil/pipe
 public DCheckbox(DGuiManager guiManager, float x, float y, string _text)
     : this(guiManager, x, y)
 {
     if (_text != null)
         Text = _text;
 }
示例#21
0
 public DToggleButton(DGuiManager guiManager, float x, float y, string _text)
     : this(guiManager, x, y)
 {
     if (_text != null)
         Text = _text;
 }
示例#22
0
文件: DComboBox.cs 项目: konlil/pipe
 public DComboBox(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
示例#23
0
文件: DScrollBar.cs 项目: konlil/pipe
 public DScrollBar(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
示例#24
0
文件: DScrollBar.cs 项目: konlil/pipe
 public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height)
     : this(guiManager, x, y)
 {
     this.Size = new Vector2(_width, _height);
 }
示例#25
0
 public DMultiLineTextBox(DGuiManager guiManager)
     : base(guiManager)
 {
     FillColor = ColorTheme.InputFillColor;
     BorderColor = ColorTheme.BorderColor;
     Size = new Vector2(WIDTH, HEIGHT);
 }
示例#26
0
 public DToggleButton(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
示例#27
0
 public DGoldenPanel(DGuiManager guiManager)
     : base(guiManager)
 {
 }
示例#28
0
文件: DScrollBar.cs 项目: konlil/pipe
        public DScrollBar(DGuiManager guiManager)
            : base(guiManager)
        {
            FillColor = Color.White;
            BorderColor = Color.Gainsboro;

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

            //UseHoverColor = true;
        }
示例#29
0
文件: DComboBox.cs 项目: konlil/pipe
 public DComboBox(DGuiManager guiManager)
     : base(guiManager)
 {
     Size = new Vector2(DEFAULT_WIDTH, DEFAULT_HEIGHT);
     Text = "";
 }
示例#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);
 }