void InitializeAutoSplitTable()
 {
     autoSplitTable = new AutoSplitTable(settingsService)
     {
         Dock = DockStyle.Fill
     };
     AutoSplitLayout.Controls.Add(autoSplitTable);
 }
Example #2
0
        void InitializeAutoSplitTable()
        {
            if (autoSplitTable != null)
            {
                AutoSplitLayout.Controls.Remove(autoSplitTable);
            }

            // Create a scrollable layout.
            autoSplitTable      = new AutoSplitTable();
            autoSplitTable.Dock = DockStyle.Fill;
            AutoSplitLayout.Controls.Add(autoSplitTable);
        }
Example #3
0
        public Control CreateControl()
        {
            AutoSplitHotkeyLabel          = new Label();
            AutoSplitHotkeyLabel.AutoSize = true;
            AutoSplitHotkeyLabel.Text     = "Split-Hotkey:";

            autoSplitHotkeyControl                 = new HotkeyControl();
            autoSplitHotkeyControl.Value           = new Hotkey();
            autoSplitHotkeyControl.AutoSize        = true;
            autoSplitHotkeyControl.Text            = "None";
            autoSplitHotkeyControl.UseKeyWhitelist = true;
            autoSplitHotkeyControl.HotkeyChanged  += new EventHandler <Hotkey>(AutoSplitHotkeyControlOnHotkeyChanged);

            AutoSplitTestHotkeyButton          = new Button();
            AutoSplitTestHotkeyButton.AutoSize = true;
            AutoSplitTestHotkeyButton.Text     = "Test Split-Hotkey";
            AutoSplitTestHotkeyButton.Click   += new EventHandler(AutoSplitTestHotkey_Click);

            AutoSplitResetHotkeyLabel          = new Label();
            AutoSplitResetHotkeyLabel.AutoSize = true;
            AutoSplitResetHotkeyLabel.Text     = "Reset-Hotkey:";

            autoSplitResetHotkeyControl                 = new HotkeyControl();
            autoSplitResetHotkeyControl.Value           = new Hotkey();
            autoSplitResetHotkeyControl.AutoSize        = true;
            autoSplitResetHotkeyControl.Text            = "None";
            autoSplitResetHotkeyControl.UseKeyWhitelist = true;
            autoSplitResetHotkeyControl.HotkeyChanged  += new EventHandler <Hotkey>(AutoSplitResetHotkeyControlOnHotkeyChanged);

            AutoSplitTestResetHotkeyButton          = new Button();
            AutoSplitTestResetHotkeyButton.AutoSize = true;
            AutoSplitTestResetHotkeyButton.Text     = "Test Reset-Hotkey";
            AutoSplitTestResetHotkeyButton.Click   += new EventHandler(AutoSplitTestResetHotkey_Click);

            AutoSplitToolbar2 = new FlowLayoutPanel();
            AutoSplitToolbar2.FlowDirection = FlowDirection.LeftToRight;
            AutoSplitToolbar2.AutoSize      = true;
            AutoSplitToolbar2.Controls.Add(AutoSplitResetHotkeyLabel);
            AutoSplitToolbar2.Controls.Add(autoSplitResetHotkeyControl);
            AutoSplitToolbar2.Controls.Add(AutoSplitTestResetHotkeyButton);
            AutoSplitToolbar2.Dock   = DockStyle.Fill;
            AutoSplitToolbar2.Margin = new Padding(0);

            EnabledCheckbox          = new CheckBox();
            EnabledCheckbox.AutoSize = true;
            EnabledCheckbox.Text     = "Enable";

            AddAutoSplitButton          = new Button();
            AddAutoSplitButton.AutoSize = true;
            AddAutoSplitButton.Text     = "Add Split";
            AddAutoSplitButton.Click   += new EventHandler(AddAutoSplitButton_Clicked);

            AutoSplitToolbar = new FlowLayoutPanel();
            AutoSplitToolbar.FlowDirection = FlowDirection.LeftToRight;
            AutoSplitToolbar.AutoSize      = true;
            AutoSplitToolbar.Controls.Add(AutoSplitHotkeyLabel);
            AutoSplitToolbar.Controls.Add(autoSplitHotkeyControl);
            AutoSplitToolbar.Controls.Add(EnabledCheckbox);
            AutoSplitToolbar.Controls.Add(AutoSplitTestHotkeyButton);
            AutoSplitToolbar.Controls.Add(AddAutoSplitButton);
            AutoSplitToolbar.Dock   = DockStyle.Fill;
            AutoSplitToolbar.Margin = new Padding(0);

            autoSplitTable = new AutoSplitTable(plugin.Config)
            {
                Dock = DockStyle.Fill
            };

            control             = new TableLayoutPanel();
            control.ColumnCount = 1;
            control.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            control.Dock     = DockStyle.Fill;
            control.Location = new Point(0, 0);
            control.Margin   = new Padding(0);
            control.RowCount = 3;
            control.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            control.RowStyles.Add(new RowStyle());
            control.RowStyles.Add(new RowStyle());
            control.Size = new Size(800, 476);
            control.Controls.Add(AutoSplitToolbar, 0, 1);
            control.Controls.Add(AutoSplitToolbar2, 0, 2);
            control.Controls.Add(autoSplitTable);
            return(control);
        }
Example #4
0
        public Control CreateControl()
        {
            var SplitKeyLabel = new Label();

            SplitKeyLabel.AutoSize = true;
            SplitKeyLabel.Padding  = new Padding(0, 6, 0, 0);
            SplitKeyLabel.Text     = "Split-Key:";

            SplitKeyControl                = new HotkeyControl();
            SplitKeyControl.Value          = new Hotkey();
            SplitKeyControl.AutoSize       = true;
            SplitKeyControl.HotkeyChanged += new EventHandler <Hotkey>(SplitKeyChanged);

            var SplitKeyTestButton = new Button();

            SplitKeyTestButton.AutoSize = true;
            SplitKeyTestButton.Text     = "Test";
            SplitKeyTestButton.Click   += new EventHandler(SplitKeyTestClicked);

            var ResetKeyLabel = new Label();

            ResetKeyLabel.AutoSize = true;
            ResetKeyLabel.Padding  = new Padding(0, 6, 0, 0);
            ResetKeyLabel.Text     = "Reset-Key:";

            ResetKeyControl                = new HotkeyControl();
            ResetKeyControl.Value          = new Hotkey();
            ResetKeyControl.AutoSize       = true;
            ResetKeyControl.HotkeyChanged += new EventHandler <Hotkey>(ResetKeyChanged);

            var ResetKeyTestButton = new Button();

            ResetKeyTestButton.AutoSize = true;
            ResetKeyTestButton.Text     = "Test";
            ResetKeyTestButton.Click   += new EventHandler(ResetKeyTestClicked);

            EnabledCheckbox          = new CheckBox();
            EnabledCheckbox.AutoSize = true;
            EnabledCheckbox.Padding  = new Padding(0, 2, 0, 0);
            EnabledCheckbox.Text     = "Enable autosplits";

            EnabledForExistingCharsCheckbox          = new CheckBox();
            EnabledForExistingCharsCheckbox.AutoSize = true;
            EnabledForExistingCharsCheckbox.Padding  = new Padding(0, 2, 0, 0);
            EnabledForExistingCharsCheckbox.Text     = "Split for existing chars";

            var AddAutoSplitButton = new Button();

            AddAutoSplitButton.AutoSize = true;
            AddAutoSplitButton.Text     = "Add Split";
            AddAutoSplitButton.Click   += new EventHandler(AddAutoSplitButton_Clicked);

            var Toolbar1 = new FlowLayoutPanel();

            Toolbar1.FlowDirection = FlowDirection.LeftToRight;
            Toolbar1.AutoSize      = true;
            Toolbar1.Controls.Add(EnabledCheckbox);
            Toolbar1.Controls.Add(EnabledForExistingCharsCheckbox);
            Toolbar1.Controls.Add(AddAutoSplitButton);
            Toolbar1.Dock   = DockStyle.Fill;
            Toolbar1.Margin = new Padding(0);

            var Toolbar2 = new TableLayoutPanel();

            Toolbar2.AutoSize    = true;
            Toolbar2.ColumnCount = 3;
            Toolbar2.ColumnStyles.Add(new ColumnStyle());
            Toolbar2.ColumnStyles.Add(new ColumnStyle());
            Toolbar2.ColumnStyles.Add(new ColumnStyle());
            Toolbar2.ColumnStyles.Add(new ColumnStyle());
            Toolbar2.RowCount = 2;
            Toolbar2.RowStyles.Add(new RowStyle());
            Toolbar2.RowStyles.Add(new RowStyle());

            Toolbar2.Controls.Add(SplitKeyLabel, 0, 0);
            Toolbar2.Controls.Add(SplitKeyControl, 1, 0);
            Toolbar2.Controls.Add(SplitKeyTestButton, 2, 0);

            Toolbar2.Controls.Add(ResetKeyLabel, 0, 1);
            Toolbar2.Controls.Add(ResetKeyControl, 1, 1);
            Toolbar2.Controls.Add(ResetKeyTestButton, 2, 1);

            Toolbar2.Dock   = DockStyle.Fill;
            Toolbar2.Margin = new Padding(0);

            autoSplitTable = new AutoSplitTable(plugin.Config)
            {
                Dock = DockStyle.Fill
            };

            control             = new TableLayoutPanel();
            control.ColumnCount = 1;
            control.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
            control.Dock     = DockStyle.Fill;
            control.Location = new Point(0, 0);
            control.Margin   = new Padding(0);
            control.RowCount = 3;
            control.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            control.RowStyles.Add(new RowStyle());
            control.RowStyles.Add(new RowStyle());
            control.Size = new Size(800, 476);
            control.Controls.Add(Toolbar1, 0, 1);
            control.Controls.Add(Toolbar2, 0, 2);
            control.Controls.Add(autoSplitTable);
            return(control);
        }