コード例 #1
0
ファイル: AnimationBar.cs プロジェクト: LaudableBauble/Bedlam
        /// <summary>
        /// Initialize the animation bar.
        /// </summary>
        /// <param name="gui">The GUI that this animation bar will be a part of.</param>
        /// <param name="animation">The animation that this item will play through.</param>
        /// <param name="position">The position of this animation bar.</param>
        /// <param name="height">The height of this animation bar.</param>
        /// <param name="width">The width of this animation bar.</param>
        public void Initialize(GraphicalUserInterface gui, Animation animation, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Animation = animation;
            _CurrentFrame = 0;
            _MarkerPosition = Vector2.Add(Position, new Vector2(25, 0));
            _SelectedFrameNumber = 0;
            _FrameMarkerNumber = 0;
            _FrameWidth = (100 * _Animation.FrameTime);
            _PlayButton = new Button(GUI, position, 20, 20);
            _IsPlaying = false;
            _FramePositionStart = (Position.X + 25);

            //Hook up some events.
            _PlayButton.MouseClick += OnPlayButtonClick;
            _Animation.KeyframeAdded += OnKeyframesChange;
            _Animation.KeyframeRemoved += OnKeyframesChange;
        }
コード例 #2
0
ファイル: TreeView.cs プロジェクト: LaudableBauble/Bedlam
        /// <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;
        }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
ファイル: Checkbox.cs プロジェクト: LaudableBauble/Bedlam
        /// <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;
        }
コード例 #5
0
        /// <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;
        }
コード例 #6
0
ファイル: TabPage.cs プロジェクト: LaudableBauble/Bedlam
        /// <summary>
        /// Initialize the list item.
        /// </summary>
        /// <param name="gui">The GUI that this tabpage will be a part of.</param>
        /// <param name="position">The position of this tabpage.</param>
        /// <param name="height">The height of this tabpage.</param>
        /// <param name="width">The width of this tabpage.</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, Width, Height);
            _IsHiding = true;

            //Add the controls.
            Add(_Button);

            //Subscribe to some events.
            _Button.MouseClick += OnButtonClick;
        }
コード例 #7
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;
        }
コード例 #8
0
ファイル: Expander.cs プロジェクト: LaudableBauble/Bedlam
        /// <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;
        }
コード例 #9
0
ファイル: Combobox.cs プロジェクト: LaudableBauble/Bedlam
        /// <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;
        }
コード例 #10
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;
        }
コード例 #11
0
ファイル: TreeNode.cs プロジェクト: LaudableBauble/Bedlam
        /// <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;
        }
コード例 #12
0
ファイル: ItemChooser.cs プロジェクト: LaudableBauble/Bedlam
        /// <summary>
        /// Initialize the item chooser.
        /// </summary>
        /// <param name="gui">The GUI that this chooser will be a part of.</param>
        /// <param name="position">The position of this chooser.</param>
        /// <param name="height">The height of this chooser.</param>
        /// <param name="width">The width of this chooser.</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;
            _Type = ItemType.Item;
            _PctbDisplay = new Picturebox(GUI, new Vector2(position.X + _Border + (Width * _Ratio), position.Y + _Border), (Width * (1 - _Ratio)) - (2 * _Border) - 15,
                Height - 35 - (2 * _Border));
            _PctbDisplay.Origin = new Vector2(_PctbDisplay.Width / 2, _PctbDisplay.Height / 2);
            _TrvItems = new TreeView(GUI, new Vector2(position.X + _Border, position.Y + _Border), (Width * _Ratio) - _Border, Height - (2 * _Border));
            _SldScale = new Slider(GUI, new Vector2(position.X + Width - _Border - 10, position.Y + (Height - 85 - _Border)), SliderType.Vertical, 50);
            _SldScale.Value = 1;
            _SldScale.Maximum = 3;
            _BtnFinish = new Button(GUI, new Vector2(position.X + (2 * (Width / 3) - 25), position.Y + (Height - 30 - _Border)), 50, 30);

            //Add the controls.
            AddItem(_PctbDisplay);
            AddItem(_TrvItems);
            AddItem(_SldScale);
            AddItem(_BtnFinish);

            //Hook up some events.
            _BtnFinish.MouseClick += OnDoneButtonClick;
            //_TrvItems.ItemSelect += OnListSelect;
            _SldScale.ValueChange += OnSliderChange;
        }
コード例 #13
0
ファイル: SpriteDialog.cs プロジェクト: LaudableBauble/Bedlam
        /// <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;
        }
コード例 #14
0
ファイル: Scroller.cs プロジェクト: LaudableBauble/Bedlam
        /// <summary>
        /// Initialize the scroller.
        /// </summary>
        /// <param name="gui">The GUI that this scroller will be a part of.</param>
        /// <param name="position">The position of the scroller.</param>
        /// <param name="type">The scroller type, that is whether it scrolls horizontally or vertically.</param>
        /// <param name="length">The length of this scroller. Minimum is 80.</param>
        public void Initialize(GraphicalUserInterface gui, Vector2 position, ScrollerType type, float length)
        {
            //Call the base class and pass along the appropriate information.
            if (type == ScrollerType.Horizontal) { base.Initialize(gui, position, Math.Max(length, 80), 15); }
            else { base.Initialize(gui, position, 15, Math.Max(length, 80)); }

            //Initialize some variables.
            _Type = type;
            _Value = 0;
            _Thumb = new Button(GUI, Position);
            _Backward = new Button(GUI, Position);
            _Forward = new Button(GUI, Position);

            //Add the controls.
            Add(_Thumb);
            Add(_Backward);
            Add(_Forward);

            //Hook up some events.
            _Thumb.MouseDown += OnThumbDown;
            _Backward.MouseDown += OnBackwardDown;
            _Forward.MouseDown += OnForwardDown;
            _Backward.MouseClick += OnBackwardClick;
            _Forward.MouseClick += OnForwardClick;
        }