Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Splitter"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Splitter(ZGE.Components.ZComponent parent) : base(parent)
 {
     m_Panel = new GUIControl[2];
     m_Scale = new bool[2];
     m_Scale[0] = true;
     m_Scale[1] = true;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorSlider"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorSlider(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     SetSize(32, 128);
     MouseInputEnabled = true;
     m_Depressed = false;
 }
Ejemplo n.º 3
0
        internal bool m_Alt; // for alternate coloring

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryButton"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CategoryButton(ZGE.Components.ZComponent parent) : base(parent)
        {
            Alignment = Pos.Left | Pos.CenterV;
            m_Alt = false;
            IsToggle = true;
            TextPadding = new Padding(3, 0, 3, 0);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButton"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public RadioButton(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     SetSize(15, 15);
     MouseInputEnabled = true;
     IsTabable = false;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MenuStrip"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public MenuStrip(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     SetBounds(0, 0, 200, 22);
     Dock = Pos.Top;
     m_InnerPanel.Padding = new Padding(5, 0, 0, 0);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TableRow"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public TableRow(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     m_Columns = new Label[MaxColumns];
     m_ColumnCount = 0;
     KeyboardInputEnabled = true;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScrollControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ScrollControl(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            MouseInputEnabled = true;

            m_VerticalScrollBar = new VerticalScrollBar(this);
            m_VerticalScrollBar.Dock = Pos.Right;
            m_VerticalScrollBar.BarMoved += VBarMoved;
            m_CanScrollV = true;
            m_VerticalScrollBar.NudgeAmount = 30;

            m_HorizontalScrollBar = new HorizontalScrollBar(this);
            m_HorizontalScrollBar.Dock = Pos.Bottom;
            m_HorizontalScrollBar.BarMoved += HBarMoved;
            m_CanScrollH = true;
            m_HorizontalScrollBar.NudgeAmount = 30;

            m_InnerPanel = new GUIControl(this);
            m_InnerPanel.SetPosition(0, 0);
            m_InnerPanel.Margin = Margin.Five;
            m_InnerPanel.SendToBack();
            m_InnerPanel.MouseInputEnabled = false;

            m_AutoHideBars = false;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TabControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TabControl(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            m_Scroll = new ScrollBarButton[2];
            m_ScrollOffset = 0;

            m_TabStrip = new TabStrip(this);
            m_TabStrip.StripPosition = Pos.Top;

            // Make this some special control?
            m_Scroll[0] = new ScrollBarButton(this);
            m_Scroll[0].SetDirectionLeft();
            m_Scroll[0].Clicked += ScrollPressedLeft;
            m_Scroll[0].SetSize(14, 16);

            m_Scroll[1] = new ScrollBarButton(this);
            m_Scroll[1].SetDirectionRight();
            m_Scroll[1].Clicked += ScrollPressedRight;
            m_Scroll[1].SetSize(14, 16);

            m_InnerPanel = new TabControlInner(this);
            m_InnerPanel.Dock = Pos.Fill;
            m_InnerPanel.SendToBack();

            IsTabable = false;
        }
Ejemplo n.º 9
0
        public CheckBox(ZGE.Components.ZComponent parent)
            : base(parent)
        {

            Control.CheckBox check = new Control.CheckBox(this);
            check.SetPosition(10, 10);
            check.Checked += OnChecked;
            check.UnChecked += OnUnchecked;
            check.CheckChanged += OnCheckChanged;

            Control.LabeledCheckBox labeled = new Control.LabeledCheckBox(this);
            labeled.Text = "Labeled CheckBox";
            labeled.Checked += OnChecked;
            labeled.UnChecked += OnUnchecked;
            labeled.CheckChanged += OnCheckChanged;
            Align.PlaceDownLeft(labeled, check, 10);

            Control.LabeledCheckBox labeled2 = new Control.LabeledCheckBox(this);
            labeled2.Text = "I'm autosized";
            labeled2.SizeToChildren();
            Align.PlaceDownLeft(labeled2, labeled, 10);

            Control.CheckBox check2 = new Control.CheckBox(this);
            check2.IsDisabled = true;
            Align.PlaceDownLeft(check2, labeled2, 20);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CrossSplitter"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CrossSplitter(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            m_Sections = new GUIControl[4];

            m_VSplitter = new SplitterBar(this);
            m_VSplitter.SetPosition(0, 128);
            m_VSplitter.Dragged += OnVerticalMoved;
            m_VSplitter.Cursor = Cursors.SizeNS;

            m_HSplitter = new SplitterBar(this);
            m_HSplitter.SetPosition(128, 0);
            m_HSplitter.Dragged += OnHorizontalMoved;
            m_HSplitter.Cursor = Cursors.SizeWE;

            m_CSplitter = new SplitterBar(this);
            m_CSplitter.SetPosition(128, 128);
            m_CSplitter.Dragged += OnCenterMoved;
            m_CSplitter.Cursor = Cursors.SizeAll;

            m_HVal = 0.5f;
            m_VVal = 0.5f;

            SetPanel(0, null);
            SetPanel(1, null);
            SetPanel(2, null);
            SetPanel(3, null);

            SplitterSize = 5;
            SplittersVisible = false;

            m_ZoomedSection = -1;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NumericUpDown"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public NumericUpDown(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            SetSize(100, 20);

            m_Splitter = new Splitter(this);
            m_Splitter.Dock = Pos.Right;
            m_Splitter.SetSize(13, 13);

            m_Up = new UpDownButton_Up(m_Splitter);
            m_Up.Clicked += OnButtonUp;
            m_Up.IsTabable = false;
            m_Splitter.SetPanel(0, m_Up, false);

            m_Down = new UpDownButton_Down(m_Splitter);
            m_Down.Clicked += OnButtonDown;
            m_Down.IsTabable = false;
            m_Down.Padding = new Padding(0, 1, 1, 0);
            m_Splitter.SetPanel(1, m_Down, false);

            m_Max = 100;
            m_Min = 0;
            m_Value = 0f;
            Text = "0";
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBox"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CheckBox(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     SetSize(15, 15);
     //m_Checked = true; // [omeg] why?!
     //Toggle();
 }
Ejemplo n.º 13
0
        public RadioButton(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            Control.RadioButtonGroup rbg = new Control.RadioButtonGroup(this, "Sample radio group");
            rbg.SetPosition(10, 10);

            rbg.AddOption("Option 1");
            rbg.AddOption("Option 2");
            rbg.AddOption("Option 3");
            rbg.AddOption("\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631");
            //rbg.SizeToContents(); // it's auto

            rbg.SelectionChanged += OnChange;

            Control.LabeledRadioButton rb1 = new LabeledRadioButton(this);
            rb1.Text = "Option 1";
            rb1.SetPosition(300, 10);

            Control.LabeledRadioButton rb2 = new LabeledRadioButton(this);
            rb2.Text = "Option 2222222222222222222222222222222222";
            rb2.SetPosition(300, 30);

            Control.LabeledRadioButton rb3 = new LabeledRadioButton(this);
            rb3.Text = "\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631";
            rb3.SetPosition(300, 50);

            //this.DrawDebugOutlines = true;
        }
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeNodeLabel"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public TreeNodeLabel(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     Alignment = Pos.Left | Pos.CenterV;
     ShouldDrawBackground = false;
     Height = 16;
     TextPadding = new Padding(3, 0, 3, 0);
 }
Ejemplo n.º 15
0
        public TabTitleBar(ZGE.Components.ZComponent parent) : base(parent)
        {
            MouseInputEnabled = true;
            TextPadding = new Padding(5, 2, 5, 2);
            Padding = new Padding(1, 2, 1, 2);

            DragAndDrop_SetPackage(true, "TabWindowMove", null);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ColorPicker"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ColorPicker(ZGE.Components.ZComponent parent) : base(parent)
        {
            MouseInputEnabled = true;

            SetSize(256, 150);
            CreateControls();
            SelectedColor = Color.FromArgb(255, 50, 60, 70);
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Resizer"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Resizer(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     m_ResizeDir = Pos.Left;
     MouseInputEnabled = true;
     SetSize(6, 6);
     Target = parent as GUIControl;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CategoryHeaderButton"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CategoryHeaderButton(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     ShouldDrawBackground = false;
     IsToggle = true;
     Alignment = Pos.Center;
     TextPadding = new Padding(3, 0, 3, 0);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Modal"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Modal(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     KeyboardInputEnabled = true;
     MouseInputEnabled = true;
     ShouldDrawBackground = true;
     SetBounds(0, 0, GetCanvas().Width, GetCanvas().Height);
 }
Ejemplo n.º 20
0
        public Docking(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            font = Skin.DefaultFont.Copy();
            font.Size = 20;

            outer = new Control.Label(this);
            outer.SetBounds(10, 10, 400, 400);

            Control.Label inner1 = new Control.Label(outer);
            inner1.Text = "1";
            inner1.Font = font;
            inner1.SetSize(100, 100);
            inner1.Dock = Pos.Left;
            Control.Label inner2 = new Control.Label(outer);
            inner2.Text = "2";
            inner2.Font = font;
            inner2.SetSize(100, 100); 
            inner2.Dock = Pos.Top;
            Control.Label inner3 = new Control.Label(outer);
            inner3.Text = "3";
            inner3.Font = font;
            inner3.SetSize(100, 100); 
            inner3.Dock = Pos.Right;
            Control.Label inner4 = new Control.Label(outer);
            inner4.Text = "4";
            inner4.Font = font;
            inner4.SetSize(100, 100); 
            inner4.Dock = Pos.Bottom;
            Control.Label inner5 = new Control.Label(outer);
            inner5.Text = "5";
            inner5.Font = font;
            inner5.SetSize(100, 100); 
            inner5.Dock = Pos.Fill;

            //outer.DrawDebugOutlines = true;

            inner1.UserData = CreateControls(inner1, 0, "Control 1", 440, 10);
            inner2.UserData = CreateControls(inner2, 1, "Control 2", 650, 10);
            inner3.UserData = CreateControls(inner3, 2, "Control 3", 440, 170);
            inner4.UserData = CreateControls(inner4, 3, "Control 4", 650, 170);
            inner5.UserData = CreateControls(inner5, 4, "Control 5", 440, 330);

            Control.Label l_padding = new Control.Label(this);
            l_padding.Text = "Padding:";
            l_padding.SetSize(50, 15);
            Align.PlaceDownLeft(l_padding, outer, 20);

            Control.HorizontalSlider padding = new Control.HorizontalSlider(this);
            padding.Min = 0;
            padding.Max = 200;
            padding.Value = 10;
            padding.SetSize(100, 20);
            padding.ValueChanged += PaddingChanged;
            Align.PlaceRightBottom(padding, l_padding);

            //DrawDebugOutlines = true;
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StatusBar"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public StatusBar(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     Height = 22;
     Dock = Pos.Bottom;
     Padding = Padding.Two;
     //Text = "Status Bar"; // [omeg] todo i18n
     Alignment = Pos.Left | Pos.CenterV;
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TabButton"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public TabButton(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     DragAndDrop_SetPackage(true, "TabButtonMove", null);
     Alignment = Pos.Top | Pos.Left;
     TextPadding = new Padding(5, 3, 3, 3);
     Padding = Padding.Two;
     KeyboardInputEnabled = true;
 }
Ejemplo n.º 23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DockedTabControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public DockedTabControl(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            Dock = Pos.Fill;

            m_TitleBar = new TabTitleBar(this);
            m_TitleBar.Dock = Pos.Top;
            m_TitleBar.IsHidden = true;
        }
Ejemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagePanel"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ImagePanel(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     m_uv = new float[4];
     m_Texture = new Texture(Skin.Renderer);
     SetUV(0, 0, 1, 1);
     MouseInputEnabled = false;
     m_DrawColor = Color.White;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Properties"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Properties(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     m_SplitterBar = new SplitterBar(this);
     m_SplitterBar.SetPosition(80, 0);
     m_SplitterBar.Cursor = Cursors.SizeWE;
     m_SplitterBar.Dragged += OnSplitterMoved;
     m_SplitterBar.ShouldDrawBackground = false;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Text"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public Text(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     m_Font = Skin.DefaultFont;
     m_String = string.Empty;
     TextColor = Skin.Colors.Label.Default;
     MouseInputEnabled = false;
     TextColorOverride = Color.FromArgb(0, 255, 255, 255); // A==0, override disabled
 }
Ejemplo n.º 27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ColorLerpBox"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ColorLerpBox(ZGE.Components.ZComponent parent) : base(parent)
        {
            SetColor(Color.FromArgb(255, 255, 128, 0), true);
            SetSize(128, 128);
            MouseInputEnabled = true;
            m_Depressed = false;

            // texture is initialized in Render() if null
        }
Ejemplo n.º 28
0
 public NumericUpDown(ZGE.Components.ZComponent parent)
     : base(parent)
 {
     Control.NumericUpDown ctrl = new Control.NumericUpDown(this);
     ctrl.SetBounds(10, 10, 50, 20);
     ctrl.Value = 50;
     ctrl.Max = 100;
     ctrl.Min = -100;
     ctrl.ValueChanged += OnValueChanged;
 }
Ejemplo n.º 29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ResizableControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ResizableControl(ZGE.Components.ZComponent parent)
            : base(parent)
        {
            m_Resizer = new Resizer[10];
            MinimumSize = new Point(5, 5);
            m_ClampMovement = false;

            m_Resizer[2] = new Resizer(this);
            m_Resizer[2].Dock = Pos.Bottom;
            m_Resizer[2].ResizeDir = Pos.Bottom;
            m_Resizer[2].Resized += OnResized;
            m_Resizer[2].Target = this;

            m_Resizer[1] = new Resizer(m_Resizer[2]);
            m_Resizer[1].Dock = Pos.Left;
            m_Resizer[1].ResizeDir = Pos.Bottom | Pos.Left;
            m_Resizer[1].Resized += OnResized;
            m_Resizer[1].Target = this;

            m_Resizer[3] = new Resizer(m_Resizer[2]);
            m_Resizer[3].Dock = Pos.Right;
            m_Resizer[3].ResizeDir = Pos.Bottom | Pos.Right;
            m_Resizer[3].Resized += OnResized;
            m_Resizer[3].Target = this;

            m_Resizer[8] = new Resizer(this);
            m_Resizer[8].Dock = Pos.Top;
            m_Resizer[8].ResizeDir = Pos.Top;
            m_Resizer[8].Resized += OnResized;
            m_Resizer[8].Target = this;

            m_Resizer[7] = new Resizer(m_Resizer[8]);
            m_Resizer[7].Dock = Pos.Left;
            m_Resizer[7].ResizeDir = Pos.Left | Pos.Top;
            m_Resizer[7].Resized += OnResized;
            m_Resizer[7].Target = this;

            m_Resizer[9] = new Resizer(m_Resizer[8]);
            m_Resizer[9].Dock = Pos.Right;
            m_Resizer[9].ResizeDir = Pos.Right | Pos.Top;
            m_Resizer[9].Resized += OnResized;
            m_Resizer[9].Target = this;

            m_Resizer[4] = new Resizer(this);
            m_Resizer[4].Dock = Pos.Left;
            m_Resizer[4].ResizeDir = Pos.Left;
            m_Resizer[4].Resized += OnResized;
            m_Resizer[4].Target = this;

            m_Resizer[6] = new Resizer(this);
            m_Resizer[6].Dock = Pos.Right;
            m_Resizer[6].ResizeDir = Pos.Right;
            m_Resizer[6].Resized += OnResized;
            m_Resizer[6].Target = this;
        }
Ejemplo n.º 30
0
        public ColorPickers(ZGE.Components.ZComponent parent) : base(parent)
        {
            ColorPicker rgbPicker = new ColorPicker(this);
            rgbPicker.SetPosition(10, 10);

            rgbPicker.ColorChanged += ColorChanged;

            HSVColorPicker hsvPicker = new HSVColorPicker(this);
            hsvPicker.SetPosition(300, 10);
            hsvPicker.ColorChanged += ColorChanged;
        }