/// <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; _ItemTypeCombobox = new Combobox(GUI, Position, Width - 10, 15); _ItemCombobox = new Combobox(GUI, Position, Width - 10, 15); Textbox textbox = new Textbox(GUI, Position, Width - 10, 15); //Initialize the item type combobox. foreach (ItemType item in Enum.GetValues(typeof(ItemType))) { //Add a item to the combobox. _ItemTypeCombobox.List.AddItem(); //Get the added item and change its text. (_ItemTypeCombobox.List.Items[_ItemTypeCombobox.List.Items.Count - 1] as LabelListItem).Label.Tag = item; (_ItemTypeCombobox.List.Items[_ItemTypeCombobox.List.Items.Count - 1] as LabelListItem).Label.Text = item.ToString(); } //Add the controls. AddItem(_ItemTypeCombobox); AddItem(_ItemCombobox); AddItem(textbox); //Hook up to some events. _ItemTypeCombobox.ItemSelect += OnItemTypeSelect; }
/// <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; _Textbox = new Textbox(GUI, new Vector2((position.X + _Border), (position.Y + _Border)), (Width - (2 * _Border)), 15); _Button = new Button(GUI, new Vector2((position.X + ((Width / 2) - 25)), (position.Y + (Height - 30 - _Border))), 50, 30); //Add the controls. AddItem(_Textbox); AddItem(_Button); //Hook up some events. _Button.MouseClick += OnDoneButtonClick; }
/// <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); }
/// <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; }
/// <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); }
/// <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; }