Exemplo n.º 1
0
        protected void Startup()
        {
            int x = InputMarginLeft;
            int y = MarginTop - Spacing;

            for (int i = 0; i < buttons.Count; i++)
            {
                y += Spacing;
                if (y > (_panelSize.Height - 30))
                {
                    y  = MarginTop;
                    x += ColumnWidth;
                }

                InputCompositeWidget iw = new InputCompositeWidget
                {
                    Location = new Point(x, y),
                    Size     = new Size(InputSize, 23),
                    TabIndex = i,
                    AutoTab  = this.Autotab
                };

                iw.BringToFront();
                Controls.Add(iw);
                Inputs.Add(iw);
                Label label = new Label
                {
                    Location = new Point(x + InputSize + LabelPadding, y + 3),
                    Text     = buttons[i].Replace('_', ' ').Trim(),
                };
                Controls.Add(label);
                Labels.Add(label);
            }
        }
Exemplo n.º 2
0
        private void DoTabs()
        {
            HotkeyTabControl.TabPages.Clear();

            //Buckets
            var Tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList();

            foreach (var tab in Tabs)
            {
                var _y = UIHelper.ScaleY(14);
                var _x = UIHelper.ScaleX(6);

                var tb = new TabPage {
                    Name = tab, Text = tab
                };

                var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList();

                int iwOffsetX = UIHelper.ScaleX(110);
                int iwOffsetY = UIHelper.ScaleY(-4);
                int iwWidth   = UIHelper.ScaleX(120);
                foreach (var b in bindings)
                {
                    var l = new Label
                    {
                        Text     = b.DisplayName,
                        Location = new Point(_x, _y),
                        Size     = new Size(iwOffsetX - UIHelper.ScaleX(2), UIHelper.ScaleY(15)),
                    };

                    var w = new InputCompositeWidget
                    {
                        Location   = new Point(_x + iwOffsetX, _y + iwOffsetY),
                        AutoTab    = AutoTabCheckBox.Checked,
                        Width      = iwWidth,
                        WidgetName = b.DisplayName,
                    };

                    w.SetupTooltip(toolTip1, b.ToolTip);
                    toolTip1.SetToolTip(l, b.ToolTip);

                    w.Bindings = b.Bindings;

                    tb.Controls.Add(l);
                    tb.Controls.Add(w);

                    _y += UIHelper.ScaleY(24);
                    if (_y > HotkeyTabControl.Height - UIHelper.ScaleY(35))
                    {
                        _x += iwOffsetX + iwWidth + UIHelper.ScaleX(10);
                        _y  = UIHelper.ScaleY(14);
                    }
                }

                HotkeyTabControl.TabPages.Add(tb);
            }
        }
Exemplo n.º 3
0
        private void DoTabs()
        {
            HotkeyTabControl.TabPages.Clear();

            //Buckets
            var Tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList();

            foreach (var tab in Tabs)
            {
                var _y = 14;
                var _x = 6;

                var tb = new TabPage {
                    Name = tab, Text = tab
                };

                var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList();

                const int iwOffsetX = 110;
                const int iwOffsetY = -4;
                const int iwWidth   = 120;
                foreach (var b in bindings)
                {
                    var l = new Label
                    {
                        Text     = b.DisplayName,
                        Location = new Point(_x, _y),
                        Width    = iwOffsetX - 2,
                    };

                    var w = new InputCompositeWidget
                    {
                        Bindings   = b.Bindings,
                        Location   = new Point(_x + iwOffsetX, _y + iwOffsetY),
                        AutoTab    = AutoTabCheckBox.Checked,
                        Width      = iwWidth,
                        WidgetName = b.DisplayName,
                    };

                    tb.Controls.Add(l);
                    tb.Controls.Add(w);

                    _y += 24;
                    if (_y > HotkeyTabControl.Height - 35)
                    {
                        _x += iwOffsetX + iwWidth + 10;
                        _y  = 14;
                    }
                }

                HotkeyTabControl.TabPages.Add(tb);
            }
        }
Exemplo n.º 4
0
        private void Startup()
        {
            Console.WriteLine("startup");
            var labelWidth  = _buttons.Max(b => b.Length) * _charWidth;
            var columnWidth = _inputSize + (_labelPadding * 2) + labelWidth;
            int x           = _inputMarginLeft;
            int y           = _marginTop - _ySpacing;

            for (int i = 0; i < _buttons.Count; i++)
            {
                y += _ySpacing;
                if (y > (_panelSize.Height - UIHelper.ScaleY(62)))
                {
                    y  = _marginTop;
                    x += columnWidth;
                }

                var iw = new InputCompositeWidget
                {
                    Location = new Point(x, y),
                    Size     = new Size(_inputSize, UIHelper.ScaleY(23)),
                    TabIndex = i,
                    AutoTab  = _autoTab
                };

                iw.SetupTooltip(Tooltip, null);

                iw.BringToFront();
                Controls.Add(iw);
                _inputs.Add(iw);
                var label = new Label
                {
                    Location = new Point(x + _inputSize + _labelPadding, y + UIHelper.ScaleY(3)),
                    Size     = new Size(UIHelper.ScaleX(labelWidth), UIHelper.ScaleY(15)),
                    Text     = _buttons[i].Replace('_', ' ').Trim()
                };

                Tooltip.SetToolTip(label, label.Text);

                Controls.Add(label);
            }
        }
        protected void Startup()
        {
            int x = InputMarginLeft;
            int y = MarginTop - Spacing;

            for (int i = 0; i < buttons.Count; i++)
            {
                y += Spacing;
                if (y > (_panelSize.Height - UIHelper.ScaleY(62)))
                {
                    y  = MarginTop;
                    x += ColumnWidth;
                }

                InputCompositeWidget iw = new InputCompositeWidget
                {
                    Location = new Point(x, y),
                    Size     = new Size(InputSize, UIHelper.ScaleY(23)),
                    TabIndex = i,
                    AutoTab  = this.Autotab
                };

                iw.SetupTooltip(Tooltip, null);

                iw.BringToFront();
                Controls.Add(iw);
                Inputs.Add(iw);
                Label label = new Label
                {
                    Location = new Point(x + InputSize + LabelPadding, y + UIHelper.ScaleY(3)),
                    Size     = new Size(UIHelper.ScaleX(100), UIHelper.ScaleY(15)),
                    Text     = buttons[i].Replace('_', ' ').Trim(),
                };

                //Tooltip.SetToolTip(label, null); //??? not supported yet

                Controls.Add(label);
                Labels.Add(label);
            }
        }
Exemplo n.º 6
0
        private void Startup()
        {
            int x = _inputMarginLeft;
            int y = _marginTop - _spacing;

            for (int i = 0; i < _buttons.Count; i++)
            {
                y += _spacing;
                if (y > (_panelSize.Height - UIHelper.ScaleY(62)))
                {
                    y  = _marginTop;
                    x += _columnWidth;
                }

                var iw = new InputCompositeWidget
                {
                    Location = new Point(x, y),
                    Size     = new Size(_inputSize, UIHelper.ScaleY(23)),
                    TabIndex = i,
                    AutoTab  = _autotab
                };

                iw.SetupTooltip(Tooltip, null);

                iw.BringToFront();
                Controls.Add(iw);
                _inputs.Add(iw);
                var label = new Label
                {
                    Location = new Point(x + _inputSize + _labelPadding, y + UIHelper.ScaleY(3)),
                    Size     = new Size(UIHelper.ScaleX(100), UIHelper.ScaleY(15)),
                    Text     = _buttons[i].Replace('_', ' ').Trim(),
                };

                ////Tooltip.SetToolTip(label, null); //??? not supported yet

                Controls.Add(label);
            }
        }
Exemplo n.º 7
0
        private void DoTabs()
        {
            HotkeyTabControl.SuspendLayout();
            HotkeyTabControl.TabPages.Clear();

            // Buckets
            var tabs = _config.HotkeyBindings.Select(x => x.TabGroup).Distinct();

            foreach (var tab in tabs)
            {
                var tb = new TabPage {
                    Name = tab, Text = tab
                };
                var bindings  = _config.HotkeyBindings.Where(n => n.TabGroup == tab).OrderBy(n => n.Ordinal).ThenBy(n => n.DisplayName);
                int x         = UIHelper.ScaleX(6);
                int y         = UIHelper.ScaleY(14);
                int iwOffsetX = UIHelper.ScaleX(110);
                int iwOffsetY = UIHelper.ScaleY(-4);
                int iwWidth   = UIHelper.ScaleX(120);

                tb.SuspendLayout();

                foreach (var b in bindings)
                {
                    var l = new Label
                    {
                        Text     = b.DisplayName,
                        Location = new Point(x, y),
                        Size     = new Size(iwOffsetX - UIHelper.ScaleX(2), UIHelper.ScaleY(15))
                    };

                    var w = new InputCompositeWidget
                    {
                        Location   = new Point(x + iwOffsetX, y + iwOffsetY),
                        AutoTab    = AutoTabCheckBox.Checked,
                        Width      = iwWidth,
                        WidgetName = b.DisplayName
                    };

                    w.SetupTooltip(toolTip1, b.ToolTip);
                    toolTip1.SetToolTip(l, b.ToolTip);

                    w.Bindings = b.Bindings;

                    tb.Controls.Add(l);
                    tb.Controls.Add(w);

                    y += UIHelper.ScaleY(24);
                    if (y > HotkeyTabControl.Height - UIHelper.ScaleY(35))
                    {
                        x += iwOffsetX + iwWidth + UIHelper.ScaleX(10);
                        y  = UIHelper.ScaleY(14);
                    }
                }

                if (tab == "TAStudio")
                {
                    tb.Controls.Add(new Label
                    {
                        Text     = "Save States hotkeys operate with branches when TAStudio is engaged.",
                        Location = new Point(x, y),
                        Size     = new Size(iwWidth + iwOffsetX, HotkeyTabControl.Height - y)
                    });
                }

                HotkeyTabControl.TabPages.Add(tb);
                tb.ResumeLayout();
            }

            HotkeyTabControl.ResumeLayout();
        }
Exemplo n.º 8
0
		private void DoTabs()
		{
			HotkeyTabControl.TabPages.Clear();

			//Buckets
			var Tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList();

			foreach (var tab in Tabs)
			{
				var _y = UIHelper.ScaleY(14);
				var _x = UIHelper.ScaleX(6);

				var tb = new TabPage {Name = tab, Text = tab};

				var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList();

				int iwOffsetX = UIHelper.ScaleX(110);
				int iwOffsetY = UIHelper.ScaleY(-4);
				int iwWidth = UIHelper.ScaleX(120);
				foreach (var b in bindings)
				{
					var l = new Label
					{
						Text = b.DisplayName,
						Location = new Point(_x, _y),
						Size = new Size(iwOffsetX - UIHelper.ScaleX(2), UIHelper.ScaleY(15)),
					};

					var w = new InputCompositeWidget
					{
						Location = new Point(_x + iwOffsetX, _y + iwOffsetY),
						AutoTab = AutoTabCheckBox.Checked,
						Width = iwWidth,
						WidgetName = b.DisplayName,
					};

					w.SetupTooltip(toolTip1, b.ToolTip);
					toolTip1.SetToolTip(l, b.ToolTip);

					w.Bindings = b.Bindings;

					tb.Controls.Add(l);
					tb.Controls.Add(w);

					_y += UIHelper.ScaleY(24);
					if (_y > HotkeyTabControl.Height - UIHelper.ScaleY(35))
					{
						_x += iwOffsetX + iwWidth + UIHelper.ScaleX(10);
						_y = UIHelper.ScaleY(14);
					}
				}

				if (tab == "TAStudio")
				{
					tb.Controls.Add(new Label
					{
						Text = "Save States hotkeys operate with branches when TAStudio is engaged.",
						Location = new Point(_x, _y),
						Size = new Size(iwWidth + iwOffsetX, HotkeyTabControl.Height - _y),
					});
				}

				HotkeyTabControl.TabPages.Add(tb);
			}
		}
Exemplo n.º 9
0
		protected void Startup()
		{
			int x = InputMarginLeft;
			int y = MarginTop - Spacing;
			for (int i = 0; i < buttons.Count; i++)
			{
				y += Spacing;
				if (y > (_panelSize.Height - 30))
				{
					y = MarginTop;
					x += ColumnWidth;
				}

				InputCompositeWidget iw = new InputCompositeWidget
				{
					Location = new Point(x, y),
					Size = new Size(InputSize, 23),
					TabIndex = i,
					AutoTab = this.Autotab
				};

				iw.BringToFront();
				Controls.Add(iw);
				Inputs.Add(iw);
				Label label = new Label
					{
						Location = new Point(x + InputSize + LabelPadding, y + 3),
						Text = buttons[i].Replace('_', ' ').Trim(),
					};
				Controls.Add(label);
				Labels.Add(label);
			}
		}
Exemplo n.º 10
0
		protected void Startup()
		{
			int x = InputMarginLeft;
			int y = MarginTop - Spacing;
			for (int i = 0; i < buttons.Count; i++)
			{
				y += Spacing;
				if (y > (_panelSize.Height - UIHelper.ScaleY(62)))
				{
					y = MarginTop;
					x += ColumnWidth;
				}

				InputCompositeWidget iw = new InputCompositeWidget
				{
					Location = new Point(x, y),
					Size = new Size(InputSize, UIHelper.ScaleY(23)),
					TabIndex = i,
					AutoTab = this.Autotab
				};

				iw.SetupTooltip(Tooltip, null);

				iw.BringToFront();
				Controls.Add(iw);
				Inputs.Add(iw);
				Label label = new Label
					{
						Location = new Point(x + InputSize + LabelPadding, y + UIHelper.ScaleY(3)),
						Size = new Size(UIHelper.ScaleX(100), UIHelper.ScaleY(15)),
						Text = buttons[i].Replace('_', ' ').Trim(),
					};

				//Tooltip.SetToolTip(label, null); //??? not supported yet

				Controls.Add(label);
				Labels.Add(label);
			}
		}
Exemplo n.º 11
0
		private void DoTabs()
		{
			HotkeyTabControl.TabPages.Clear();

			//Buckets
			var Tabs = Global.Config.HotkeyBindings.Select(x => x.TabGroup).Distinct().ToList();

			foreach (var tab in Tabs)
			{
				var _y = 14;
				var _x = 6;

				var tb = new TabPage {Name = tab, Text = tab};

				var bindings = Global.Config.HotkeyBindings.Where(x => x.TabGroup == tab).OrderBy(x => x.Ordinal).ThenBy(x => x.DisplayName).ToList();

				const int iwOffsetX = 110;
				const int iwOffsetY = -4;
				const int iwWidth = 120;
				foreach (var b in bindings)
				{
					var l = new Label
						{
						Text = b.DisplayName,
						Location = new Point(_x, _y),
						Width = iwOffsetX - 2,
					};

					var w = new InputCompositeWidget
						{
						Bindings = b.Bindings,
						Location = new Point(_x + iwOffsetX, _y + iwOffsetY),
						AutoTab = AutoTabCheckBox.Checked,
						Width = iwWidth,
						WidgetName = b.DisplayName,
					};

					tb.Controls.Add(l);
					tb.Controls.Add(w);

					_y += 24;
					if (_y > HotkeyTabControl.Height - 35)
					{
						_x += iwOffsetX + iwWidth + 10;
						_y = 14;
					}
				}

				HotkeyTabControl.TabPages.Add(tb);
			}
		}