/// <summary>
        /// Initialize the load animation 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;
            _Border = 5;
            _SelectedIndex = -1;
            _Animations = new List<string>();
            _List = new List(GUI, new Vector2((position.X + _Border), (position.Y + _Border)), (Width - (2 * _Border)), (Height - 35 - (2 * _Border)));
            _Button = new Button(GUI, new Vector2((position.X + ((Width / 2) - 25)), (position.Y + (Height - 30 - _Border))), 50, 30);

            //Add the controls.
            AddItem(_List);
            AddItem(_Button);

            //Hook up some events.
            _Button.MouseClick += OnDoneButtonClick;
            _List.ItemSelect += OnListSelect;
        }
Beispiel #2
0
 /// <summary>
 /// Create a list item.
 /// </summary>
 /// <param name="gui">The GUI that this list item will be a part of.</param>
 /// <param name="list">The list this list item is 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>
 public ListItem(GraphicalUserInterface gui, List list, Vector2 position, float width, float height)
 {
     //Initialize some variables.
     _List = list;
     Initialize(gui, position, width, height);
 }
Beispiel #3
0
        /// <summary>
        /// Initialize the tree view.
        /// </summary>
        /// <param name="gui">The GUI that this treeview will be a part of.</param>
        /// <param name="position">The position of this treeview.</param>
        /// <param name="height">The height of this treeview.</param>
        /// <param name="width">The width of this treeview.</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.
            _Nodes = new List<TreeNode>();
            _Indent = 15;
            _ChildPosition = new Vector2(Position.X + _Indent, Position.Y + 10);
            _ChildWidth = 200;
            _ChildHeight = 15;
            _MoveNodeUp = new Button(gui, new Vector2(position.X + (width / 4), position.Y + 5));
            _MoveNodeDown = new Button(gui, new Vector2(position.X + (width / 4) + 20, position.Y + 5));

            //Add the controls.
            Add(_MoveNodeDown);
            Add(_MoveNodeUp);

            //Hook up some events.
            _MoveNodeUp.MouseClick += OnMoveNodeUpClick;
            _MoveNodeDown.MouseClick += OnMoveNodeDownClick;
        }
Beispiel #4
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;
        }
Beispiel #5
0
 /// <summary>
 /// Create a list item.
 /// </summary>
 /// <param name="gui">The GUI that this list item will be a part of.</param>
 /// <param name="list">The list this list item is 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>
 public FieldListItem(GraphicalUserInterface gui, List list, Vector2 position, float width, float height)
     : base(gui, list, position, width, height)
 {
     //Initialize some variables.
     Initialize(gui, position, width, height);
 }
Beispiel #6
0
        /// <summary>
        /// Initialize the component.
        /// </summary>
        /// <param name="gui">The GUI that this component will be a part of.</param>
        /// <param name="position">The position of the component.</param>
        /// <param name="width">The width of this component.</param>
        /// <param name="height">The height of this component.</param>
        protected virtual void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //Initialize some variables.
            _GUI = gui;
            _Position = position;
            _Sprite = new SpriteManager();
            _Width = width;
            _Height = height;
            _IsActive = true;
            _IsVisible = true;
            _HasFocus = false;
            _IsMouseHovering = false;
            _Transparence = .5f;
            _MaxTransparence = 0;
            _MinTransparence = 1;
            _DrawOrder = 0;
            _CellStyle = CellStyle.Dynamic;
            _Items = new List<Component>();
            _Parent = null;

            //Subscribe to events.
            _GUI.FocusNotification += OnFocusNotification;
        }
Beispiel #7
0
        /// <summary>
        /// Initialize the textbox.
        /// </summary>
        /// <param name="gui">The GUI that this textbox will be a part of.</param>
        /// <param name="position">The position of this textbox.</param>
        /// <param name="height">The height of this textbox.</param>
        /// <param name="width">The width of this textbox.</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.
            _Text = "";
            _TextStart = 0;
            _VisibleTextLength = 0;
            _MarkerIndex = 0;
            _MarkerCharacter = '_';
            _MarkerPosition = Position;
            _UsedKeys = new Dictionary<Keys, TimeSpan>();
            _FastRepeatKeys = new List<Keys>();
            _KeyRepeatTime = new TimeSpan(0, 0, 0, 0, 500);
            _FastKeyRepeatTime = new TimeSpan(0, 0, 0, 0, 25);
            _TotalElapsedTime = TimeSpan.Zero;
            _Validator = ".*";
            _IsReadOnly = false;
        }
Beispiel #8
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;
        }
Beispiel #9
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;
        }
        /// <summary>
        /// Initialize the GUI.
        /// </summary>
        private void Initialize()
        {
            //Initialize some variables.
            _Items = new RobustList<Component>();
            _FocusQueue = new List<Component>();
            _ForegroundItems = new RobustList<Component>();
            _IsActive = true;
            _IsVisible = true;
            _RightClickList = new List(this, Vector2.Zero, 100, 200);
            _HasRightClicked = false;
            _IsContentLoaded = false;

            //Play with the right click list.
            _RightClickList.AddItem();
            _RightClickList.AddItem();
            _RightClickList.AddItem();
            (_RightClickList.Items[0] as LabelListItem).Label.Text = "Item1";
            (_RightClickList.Items[1] as LabelListItem).Label.Text = "Item2";
            (_RightClickList.Items[2] as LabelListItem).Label.Text = "Item3";
        }
Beispiel #11
0
        /// <summary>
        /// Initialize the 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.
            _Items = new List<Component>();
            _Layout = new Layout(gui, position, width, height);
            _IsDirty = false;
        }
Beispiel #12
0
        /// <summary>
        /// Initialize the treeview node.
        /// </summary>
        /// <param name="gui">The GUI that this node will be a part of.</param>
        /// <param name="position">The position of this trenodeeview.</param>
        /// <param name="height">The height of this treenodeview.</param>
        /// <param name="width">The width of this treevnodeiew.</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.
            _Nodes = new List<TreeNode>();
            _Button = new Button(gui, new Vector2(Position.X, Position.Y + (Height / 3)));
            _Checkbox = new Checkbox(gui, new Vector2(Position.X + _Button.Width + 2, Position.Y), width, height);
            _NodeState = TreeNodeState.None;

            //Add the items to the list.
            Add(_Button);
            Add(_Checkbox);

            //Hook up some events.
            _Checkbox.CheckboxTick += OnCheckboxTicked;
            _Button.MouseClick += OnButtonMouseClick;
        }
Beispiel #13
0
        /// <summary>
        /// Initialize the tab control.
        /// </summary>
        /// <param name="gui">The GUI that this tab control will be a part of.</param>
        /// <param name="position">The position of this tab control.</param>
        /// <param name="height">The height of this tab control.</param>
        /// <param name="width">The width of this tab control.</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.
            _Tabs = new List<TabPage>();
            _SelectedTab = null;
        }
Beispiel #14
0
        /// <summary>
        /// Initialize the sprite dialog.
        /// </summary>
        /// <param name="gui">The GUI that this sprite dialog will be a part of.</param>
        /// <param name="position">The position of this sprite dialog.</param>
        /// <param name="height">The height of this sprite dialog.</param>
        /// <param name="width">The width of this sprite 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;
            _Border = 5;
            _Ratio = .4f;
            _Textures = new List<string>();
            _StartPosition = Vector2.Zero;
            _EndPosition = Vector2.Zero;
            _Picturebox = new Picturebox(GUI, new Vector2((position.X + _Border + (Width * _Ratio)), (position.Y + _Border)), ((Width * (1 - _Ratio)) - (2 * _Border) - 15),
                (Height - 35 - (2 * _Border)));
            _Picturebox.Origin = new Vector2((_Picturebox.Width / 2), (_Picturebox.Height / 2));
            _List = new List(GUI, new Vector2((position.X + _Border), (position.Y + _Border)), ((Width * _Ratio) - _Border), (Height - (2 * _Border)));
            _Slider = new Slider(GUI, new Vector2((position.X + Width - _Border - 10), (position.Y + (Height - 85 - _Border))), SliderType.Vertical, 50);
            _Slider.Value = 1;
            _Slider.Maximum = 3;
            _Button = new Button(GUI, new Vector2((position.X + (2 * (Width / 3) - 25)), (position.Y + (Height - 30 - _Border))), 50, 30);

            //Add the controls.
            AddItem(_Picturebox);
            AddItem(_List);
            AddItem(_Slider);
            AddItem(_Button);

            //Hook up some events.
            _Picturebox.MouseClick += OnPictureboxClick;
            _Button.MouseClick += OnDoneButtonClick;
            _List.ItemSelect += OnListSelect;
            _Slider.ValueChange += OnSliderChange;
        }