Exemplo n.º 1
0
        /// <summary>
        /// Initialize the field.
        /// </summary>
        /// <param name="gui">The GUI that this field will be a part of.</param>
        /// <param name="position">The position of this field.</param>
        /// <param name="height">The height of this field.</param>
        /// <param name="width">The width of this field.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Ratio = .4f;
            _Label = new Label(GUI, Position, Width * _Ratio, Height);
            _Textbox = new Textbox(GUI, new Vector2(Position.X + Width * _Ratio, Position.Y), Width * (1 - _Ratio), Height);
            _IsFixed = false;
            _Label.Text = "";
            _Textbox.Text = "";

            //Add the items.
            Add(_Label);
            Add(_Textbox);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize the menu item.
        /// </summary>
        /// <param name="gui">The GUI that this menu item will be a part of.</param>
        /// <param name="position">The position of this menu item.</param>
        /// <param name="height">The height of this menu item.</param>
        /// <param name="width">The width of this menu item.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Label = new Label(GUI, Position, Width, 30);
            _List = new List(GUI, new Vector2(Position.X, (Position.Y + (_Label.Height + 2))), Width, 118);
            _List.IsActive = false;
            _SelectedItem = null;
            _State = MenuState.Closed;
            _Label.Text = "";

            //Add the controls.
            Add(_Label);
            Add(_List);

            //Hook up some events.
            _Label.MouseClick += OnLabelClick;
            _List.ItemSelect += OnItemSelect;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initialize the bone dialog.
        /// </summary>
        /// <param name="gui">The GUI that this dialog will be a part of.</param>
        /// <param name="position">The position of this dialog.</param>
        /// <param name="height">The height of this dialog.</param>
        /// <param name="width">The width of this dialog.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Layout.IsEnabled = false;
            _Bone = new Bone();
            _BoneSprite = null;
            _Border = 5;
            _Ratio = .4f;
            _StartPosition = Vector2.Zero;
            _EndPosition = Vector2.Zero;

            //Create the necessary components.
            _Picturebox = new Picturebox(GUI, new Vector2((position.X + _Border + (Width * _Ratio)), (position.Y + _Border)),
                ((Width * (1 - _Ratio)) - (2 * _Border) - 15), (Height - 35 - (2 * _Border)));
            _Slider = new Slider(GUI, new Vector2((position.X + Width - _Border - 10), (position.Y + (Height - 85 - _Border))), SliderType.Vertical, 50);
            _NameLabel = new Label(GUI, Vector2.Add(Position, new Vector2(_Border, _Border)), 50, 15);
            _NameTextbox = new Textbox(GUI, Vector2.Add(_NameLabel.Position, new Vector2(_NameLabel.Width, 0)),
                ((Width * _Ratio) - (2 * _Border) - _NameLabel.Width), 15);
            _ParentLabel = new Label(GUI, Vector2.Add(_NameLabel.Position, new Vector2(0, 15)), 50, 15);
            _ParentTextbox = new Textbox(GUI, Vector2.Add(_ParentLabel.Position, new Vector2(_ParentLabel.Width, 0)),
                ((Width * _Ratio) - (2 * _Border) - _ParentLabel.Width), 15);
            _AddSpriteButton = new Button(GUI, Vector2.Add(_NameLabel.Position, new Vector2(10, 40)), 75, 30);
            _CloseButton = new Button(GUI, new Vector2((Position.X + ((Width / 2) - 25)), (Position.Y + (Height - 30 - _Border))), 50, 30);

            //Modify the components.
            _Picturebox.Origin = new Vector2((_Picturebox.Width / 2), (_Picturebox.Height / 2));
            _NameLabel.Text = "Name:";
            _ParentLabel.Text = "Parent ID:";
            _AddSpriteButton.Text = "Sprite";
            _Slider.Value = 1;
            _Slider.Maximum = 3;
            _CloseButton.Text = "Done";

            //Add the controls.
            AddItem(_Picturebox);
            AddItem(_Slider);
            AddItem(_NameLabel);
            AddItem(_NameTextbox);
            AddItem(_ParentLabel);
            AddItem(_ParentTextbox);
            AddItem(_AddSpriteButton);
            AddItem(_CloseButton);

            //Hook up to some events.
            _AddSpriteButton.MouseClick += OnAddSpriteButtonClick;
            _CloseButton.MouseClick += OnCloseButtonClick;
            _Picturebox.MouseClick += OnPictureboxClick;
            _Slider.ValueChange += OnSliderChange;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize the checkbox.
        /// </summary>
        /// <param name="gui">The GUI that this checkbox will be a part of.</param>
        /// <param name="position">The position of this checkbox.</param>
        /// <param name="height">The height of this checkbox.</param>
        /// <param name="width">The width of this checkbox.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Ratio = .1f;
            _Label = new Label(GUI, new Vector2(Position.X + (Width * _Ratio), Position.Y), (Width * (1 - _Ratio)), Height);
            _Button = new Button(GUI, Position, (Width * _Ratio), Height);
            _IsChecked = false;
            _Label.Text = "";

            //Add the controls.
            Add(_Label);
            Add(_Button);

            //Hook up some events.
            _Button.MouseClick += OnButtonClicked;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initialize the combobox.
        /// </summary>
        /// <param name="gui">The GUI that this combobox will be a part of.</param>
        /// <param name="position">The position of this combobox.</param>
        /// <param name="height">The height of this combobox.</param>
        /// <param name="width">The width of this combobox.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Ratio = .1f;
            _Label = new Label(GUI, Position, (Width * (1 - _Ratio)), Height);
            _Button = new Button(GUI, new Vector2((Position.X + (Width * (1 - _Ratio))), Position.Y), (Width * _Ratio), Height);
            _List = new List(GUI, new Vector2(Position.X, (Position.Y + (_Label.Height + 2))), Width, 118);
            _List.IsActive = false;
            _SelectedItem = null;
            _State = ComboboxState.Closed;
            _Label.Text = "";

            //Add the items.
            Add(_Label);
            Add(_Button);
            Add(_List);

            //Hook up some events.
            _List.ItemSelect += OnItemSelect;
            _Button.MouseClick += OnButtonClick;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initialize the expander.
        /// </summary>
        /// <param name="gui">The GUI that this expander will be a part of.</param>
        /// <param name="position">The position of this expander.</param>
        /// <param name="height">The height of this expander.</param>
        /// <param name="width">The width of this expander.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Button = new Button(GUI, Position, 15, 15);
            _Header = new Label(GUI, Position + new Vector2(20, 0), 75, Height);
            _IsExpanded = true;
            _Layout = new Layout(GUI, Position + new Vector2(0, 15), _Width, _Height);
            _ItemContent = new List<Component>();
            _Header.Text = "Header";

            //Add the items.
            Add(_Header);
            Add(_Button);

            //Hook up some events.
            _Button.MouseClick += OnHeaderClick;
            _Header.MouseClick += OnHeaderClick;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initialize the item form.
        /// </summary>
        /// <param name="gui">The GUI that this form will be a part of.</param>
        /// <param name="position">The position of this form.</param>
        /// <param name="height">The height of this form.</param>
        /// <param name="width">The width of this form.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Item = null;
            Expander expGeneral = new Expander(GUI, Position + new Vector2(5, 5), Width - 10, 15);
            fldWidth = new Field(GUI, Width - 10, 15);
            fldHeight = new Field(GUI, Width - 10, 15);
            Expander expander2 = new Expander(GUI, Position + new Vector2(5, 65), Width - 10, 15);
            Textbox textbox2 = new Textbox(GUI, Position + new Vector2(5, 85), Width - 10, 15);
            Label label2 = new Label(GUI, Position + new Vector2(5, 105), Width - 10, 15);

            //Set up the components.
            SetUpComponents();

            //Add controls to the expander.
            expGeneral.AddItem(fldWidth);
            expGeneral.AddItem(fldHeight);
            expander2.AddItem(textbox2);
            expander2.AddItem(label2);

            //Add the controls.
            AddItem(expGeneral);
            AddItem(expander2);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initialize the list item.
        /// </summary>
        /// <param name="gui">The GUI that this list item will be a part of.</param>
        /// <param name="position">The position of this list item.</param>
        /// <param name="height">The height of this list item.</param>
        /// <param name="width">The width of this list item.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Label = new Label(gui, Position, Width, Height);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Initialize the bone dialog.
        /// </summary>
        /// <param name="gui">The GUI that this dialog will be a part of.</param>
        /// <param name="position">The position of this dialog.</param>
        /// <param name="height">The height of this dialog.</param>
        /// <param name="width">The width of this dialog.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Bone = new Bone();
            _Border = 5;
            _SpriteName = null;
            _SpriteOrigin = Vector2.Zero;
            _SpriteRotationOffset = 0;
            _NameLabel = new Label(GUI, Vector2.Add(Position, new Vector2(_Border, _Border)), 50, 15);
            _NameLabel.Text = "Name:";
            _NameTextbox = new Textbox(GUI, Vector2.Add(_NameLabel.Position, new Vector2(_NameLabel.Width, 0)), (Width - (2 * _Border) - _NameLabel.Width), 15);
            _AddSpriteButton = new Button(GUI, Vector2.Add(_NameLabel.Position, new Vector2(10, 40)), 75, 30);
            _AddSpriteButton.Text = "Sprite";
            _CloseButton = new Button(GUI, new Vector2((Position.X + ((Width / 2) - 25)), (Position.Y + (Height - 30 - _Border))), 50, 30);
            _CloseButton.Text = "Done";

            //Add the controls.
            AddItem(_NameLabel);
            AddItem(_NameTextbox);
            AddItem(_AddSpriteButton);
            AddItem(_CloseButton);

            //Hook up to some events.
            _AddSpriteButton.MouseClick += OnAddSpriteButtonClick;
            _CloseButton.MouseClick += OnCloseButtonClick;
        }