Controller Config - only show the analog tab if there is any thing in it

This commit is contained in:
adelikat 2014-08-16 16:12:22 +00:00
parent 3880c45398
commit 69eea53c6e
2 changed files with 247 additions and 235 deletions

View File

@ -28,230 +28,230 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ControllerConfig));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.label2 = new System.Windows.Forms.Label();
this.checkBoxAutoTab = new System.Windows.Forms.CheckBox();
this.checkBoxUDLR = new System.Windows.Forms.CheckBox();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.buttonLoadDefaults = new System.Windows.Forms.Button();
this.buttonSaveDefaults = new System.Windows.Forms.Button();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.ClearBtn = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(3, 3);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(562, 493);
this.tabControl1.TabIndex = 1;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(554, 467);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Normal Controls";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(554, 467);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Autofire Controls";
this.tabPage2.UseVisualStyleBackColor = true;
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(554, 467);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Analog Controls";
this.tabPage3.UseVisualStyleBackColor = true;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 519);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(140, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Escape clears a keybinding.";
//
// checkBoxAutoTab
//
this.checkBoxAutoTab.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxAutoTab.AutoSize = true;
this.checkBoxAutoTab.Location = new System.Drawing.Point(187, 517);
this.checkBoxAutoTab.Name = "checkBoxAutoTab";
this.checkBoxAutoTab.Size = new System.Drawing.Size(70, 17);
this.checkBoxAutoTab.TabIndex = 3;
this.checkBoxAutoTab.Text = "Auto Tab";
this.checkBoxAutoTab.UseVisualStyleBackColor = true;
this.checkBoxAutoTab.CheckedChanged += new System.EventHandler(this.CheckBoxAutoTab_CheckedChanged);
//
// checkBoxUDLR
//
this.checkBoxUDLR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxUDLR.AutoSize = true;
this.checkBoxUDLR.Location = new System.Drawing.Point(263, 517);
this.checkBoxUDLR.Name = "checkBoxUDLR";
this.checkBoxUDLR.Size = new System.Drawing.Size(101, 17);
this.checkBoxUDLR.TabIndex = 4;
this.checkBoxUDLR.Text = "Allow U+D/L+R";
this.checkBoxUDLR.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.Location = new System.Drawing.Point(764, 514);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 5;
this.buttonOK.Text = "&Save";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOk_Click);
//
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(845, 514);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 6;
this.buttonCancel.Text = "&Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ControllerConfig));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.NormalControlsTab = new System.Windows.Forms.TabPage();
this.AutofireControlsTab = new System.Windows.Forms.TabPage();
this.AnalogControlsTab = new System.Windows.Forms.TabPage();
this.label2 = new System.Windows.Forms.Label();
this.checkBoxAutoTab = new System.Windows.Forms.CheckBox();
this.checkBoxUDLR = new System.Windows.Forms.CheckBox();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.buttonLoadDefaults = new System.Windows.Forms.Button();
this.buttonSaveDefaults = new System.Windows.Forms.Button();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.ClearBtn = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.NormalControlsTab);
this.tabControl1.Controls.Add(this.AutofireControlsTab);
this.tabControl1.Controls.Add(this.AnalogControlsTab);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(3, 3);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(562, 493);
this.tabControl1.TabIndex = 1;
//
// NormalControlsTab
//
this.NormalControlsTab.Location = new System.Drawing.Point(4, 22);
this.NormalControlsTab.Name = "NormalControlsTab";
this.NormalControlsTab.Padding = new System.Windows.Forms.Padding(3);
this.NormalControlsTab.Size = new System.Drawing.Size(554, 467);
this.NormalControlsTab.TabIndex = 0;
this.NormalControlsTab.Text = "Normal Controls";
this.NormalControlsTab.UseVisualStyleBackColor = true;
//
// AutofireControlsTab
//
this.AutofireControlsTab.Location = new System.Drawing.Point(4, 22);
this.AutofireControlsTab.Name = "AutofireControlsTab";
this.AutofireControlsTab.Padding = new System.Windows.Forms.Padding(3);
this.AutofireControlsTab.Size = new System.Drawing.Size(554, 467);
this.AutofireControlsTab.TabIndex = 1;
this.AutofireControlsTab.Text = "Autofire Controls";
this.AutofireControlsTab.UseVisualStyleBackColor = true;
//
// AnalogControlsTab
//
this.AnalogControlsTab.Location = new System.Drawing.Point(4, 22);
this.AnalogControlsTab.Name = "AnalogControlsTab";
this.AnalogControlsTab.Size = new System.Drawing.Size(554, 467);
this.AnalogControlsTab.TabIndex = 2;
this.AnalogControlsTab.Text = "Analog Controls";
this.AnalogControlsTab.UseVisualStyleBackColor = true;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 519);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(140, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Escape clears a keybinding.";
//
// checkBoxAutoTab
//
this.checkBoxAutoTab.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxAutoTab.AutoSize = true;
this.checkBoxAutoTab.Location = new System.Drawing.Point(187, 517);
this.checkBoxAutoTab.Name = "checkBoxAutoTab";
this.checkBoxAutoTab.Size = new System.Drawing.Size(70, 17);
this.checkBoxAutoTab.TabIndex = 3;
this.checkBoxAutoTab.Text = "Auto Tab";
this.checkBoxAutoTab.UseVisualStyleBackColor = true;
this.checkBoxAutoTab.CheckedChanged += new System.EventHandler(this.CheckBoxAutoTab_CheckedChanged);
//
// checkBoxUDLR
//
this.checkBoxUDLR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxUDLR.AutoSize = true;
this.checkBoxUDLR.Location = new System.Drawing.Point(263, 517);
this.checkBoxUDLR.Name = "checkBoxUDLR";
this.checkBoxUDLR.Size = new System.Drawing.Size(101, 17);
this.checkBoxUDLR.TabIndex = 4;
this.checkBoxUDLR.Text = "Allow U+D/L+R";
this.checkBoxUDLR.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.Location = new System.Drawing.Point(764, 514);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 5;
this.buttonOK.Text = "&Save";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOk_Click);
//
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(845, 514);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 6;
this.buttonCancel.Text = "&Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancel_Click);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 340F));
this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 1, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(908, 499);
this.tableLayoutPanel1.TabIndex = 7;
//
// pictureBox1
//
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(571, 23);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 23, 3, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(334, 473);
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
//
// buttonLoadDefaults
//
this.buttonLoadDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonLoadDefaults.Location = new System.Drawing.Point(504, 514);
this.buttonLoadDefaults.Name = "buttonLoadDefaults";
this.buttonLoadDefaults.Size = new System.Drawing.Size(70, 23);
this.buttonLoadDefaults.TabIndex = 8;
this.buttonLoadDefaults.Text = "Defaults";
this.toolTip1.SetToolTip(this.buttonLoadDefaults, "Set the default controller configuration to the current. Note: this affects all " +
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 340F));
this.tableLayoutPanel1.Controls.Add(this.tabControl1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 1, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(908, 499);
this.tableLayoutPanel1.TabIndex = 7;
//
// pictureBox1
//
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(571, 23);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 23, 3, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(334, 473);
this.pictureBox1.TabIndex = 2;
this.pictureBox1.TabStop = false;
//
// buttonLoadDefaults
//
this.buttonLoadDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonLoadDefaults.Location = new System.Drawing.Point(504, 514);
this.buttonLoadDefaults.Name = "buttonLoadDefaults";
this.buttonLoadDefaults.Size = new System.Drawing.Size(70, 23);
this.buttonLoadDefaults.TabIndex = 8;
this.buttonLoadDefaults.Text = "Defaults";
this.toolTip1.SetToolTip(this.buttonLoadDefaults, "Set the default controller configuration to the current. Note: this affects all " +
"controllers!");
this.buttonLoadDefaults.UseVisualStyleBackColor = true;
this.buttonLoadDefaults.Click += new System.EventHandler(this.ButtonLoadDefaults_Click);
//
// buttonSaveDefaults
//
this.buttonSaveDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonSaveDefaults.Location = new System.Drawing.Point(374, 514);
this.buttonSaveDefaults.Name = "buttonSaveDefaults";
this.buttonSaveDefaults.Size = new System.Drawing.Size(70, 23);
this.buttonSaveDefaults.TabIndex = 9;
this.buttonSaveDefaults.Text = "Save Defs";
this.toolTip1.SetToolTip(this.buttonSaveDefaults, "Save the current configuration as your default controls. Note: this saves ALL con" +
this.buttonLoadDefaults.UseVisualStyleBackColor = true;
this.buttonLoadDefaults.Click += new System.EventHandler(this.ButtonLoadDefaults_Click);
//
// buttonSaveDefaults
//
this.buttonSaveDefaults.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonSaveDefaults.Location = new System.Drawing.Point(374, 514);
this.buttonSaveDefaults.Name = "buttonSaveDefaults";
this.buttonSaveDefaults.Size = new System.Drawing.Size(70, 23);
this.buttonSaveDefaults.TabIndex = 9;
this.buttonSaveDefaults.Text = "Save Defs";
this.toolTip1.SetToolTip(this.buttonSaveDefaults, "Save the current configuration as your default controls. Note: this saves ALL con" +
"troller information!");
this.buttonSaveDefaults.UseVisualStyleBackColor = true;
this.buttonSaveDefaults.Click += new System.EventHandler(this.ButtonSaveDefaults_Click);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
//
// ClearBtn
//
this.ClearBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ClearBtn.Location = new System.Drawing.Point(580, 514);
this.ClearBtn.Name = "ClearBtn";
this.ClearBtn.Size = new System.Drawing.Size(75, 23);
this.ClearBtn.TabIndex = 10;
this.ClearBtn.Text = "&Clear";
this.ClearBtn.UseVisualStyleBackColor = true;
this.ClearBtn.Click += new System.EventHandler(this.ClearBtn_Click);
//
// ControllerConfig
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(932, 544);
this.Controls.Add(this.ClearBtn);
this.Controls.Add(this.buttonSaveDefaults);
this.Controls.Add(this.buttonLoadDefaults);
this.Controls.Add(this.checkBoxUDLR);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.checkBoxAutoTab);
this.Controls.Add(this.label2);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ControllerConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Controller Config";
this.Load += new System.EventHandler(this.NewControllerConfig_Load);
this.tabControl1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
this.buttonSaveDefaults.UseVisualStyleBackColor = true;
this.buttonSaveDefaults.Click += new System.EventHandler(this.ButtonSaveDefaults_Click);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4);
//
// ClearBtn
//
this.ClearBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ClearBtn.Location = new System.Drawing.Point(580, 514);
this.ClearBtn.Name = "ClearBtn";
this.ClearBtn.Size = new System.Drawing.Size(75, 23);
this.ClearBtn.TabIndex = 10;
this.ClearBtn.Text = "&Clear";
this.ClearBtn.UseVisualStyleBackColor = true;
this.ClearBtn.Click += new System.EventHandler(this.ClearBtn_Click);
//
// ControllerConfig
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(932, 544);
this.Controls.Add(this.ClearBtn);
this.Controls.Add(this.buttonSaveDefaults);
this.Controls.Add(this.buttonLoadDefaults);
this.Controls.Add(this.checkBoxUDLR);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.checkBoxAutoTab);
this.Controls.Add(this.label2);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ControllerConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Controller Config";
this.Load += new System.EventHandler(this.NewControllerConfig_Load);
this.tabControl1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage NormalControlsTab;
private System.Windows.Forms.TabPage AutofireControlsTab;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.CheckBox checkBoxAutoTab;
private System.Windows.Forms.CheckBox checkBoxUDLR;
@ -260,7 +260,7 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button buttonLoadDefaults;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage AnalogControlsTab;
private System.Windows.Forms.Button buttonSaveDefaults;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolTip toolTip1;

View File

@ -173,6 +173,8 @@ namespace BizHawk.Client.EmuHawk
SetControllerPicture(def.Name);
var analog = tabControl1.TabPages[0];
ResumeLayout();
}
@ -181,13 +183,13 @@ namespace BizHawk.Client.EmuHawk
IDictionary<string, Dictionary<string, string>> autofire,
IDictionary<string, Dictionary<string, Config.AnalogBind>> analog)
{
LoadToPanel(tabPage1, _theDefinition.Name, _theDefinition.BoolButtons, normal, string.Empty, CreateNormalPanel);
LoadToPanel(tabPage2, _theDefinition.Name, _theDefinition.BoolButtons, autofire, string.Empty, CreateNormalPanel);
LoadToPanel(tabPage3, _theDefinition.Name, _theDefinition.FloatControls, analog, new Config.AnalogBind(string.Empty, 1.0f, 0.1f), CreateAnalogPanel);
LoadToPanel(NormalControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, normal, string.Empty, CreateNormalPanel);
LoadToPanel(AutofireControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, autofire, string.Empty, CreateNormalPanel);
LoadToPanel(AnalogControlsTab, _theDefinition.Name, _theDefinition.FloatControls, analog, new Config.AnalogBind(string.Empty, 1.0f, 0.1f), CreateAnalogPanel);
if (tabPage3.Controls.Count == 0)
if (AnalogControlsTab.Controls.Count == 0)
{
tabControl1.TabPages.Remove(tabPage3);
tabControl1.TabPages.Remove(AnalogControlsTab);
}
}
@ -255,16 +257,16 @@ namespace BizHawk.Client.EmuHawk
private void Save()
{
ActOnControlCollection<ControllerConfigPanel>(tabPage1, c => c.Save(Global.Config.AllTrollers[_theDefinition.Name]));
ActOnControlCollection<ControllerConfigPanel>(tabPage2, c => c.Save(Global.Config.AllTrollersAutoFire[_theDefinition.Name]));
ActOnControlCollection<AnalogBindPanel>(tabPage3, c => c.Save(Global.Config.AllTrollersAnalog[_theDefinition.Name]));
ActOnControlCollection<ControllerConfigPanel>(NormalControlsTab, c => c.Save(Global.Config.AllTrollers[_theDefinition.Name]));
ActOnControlCollection<ControllerConfigPanel>(AutofireControlsTab, c => c.Save(Global.Config.AllTrollersAutoFire[_theDefinition.Name]));
ActOnControlCollection<AnalogBindPanel>(AnalogControlsTab, c => c.Save(Global.Config.AllTrollersAnalog[_theDefinition.Name]));
}
private void SaveToDefaults(ControlDefaults cd)
{
ActOnControlCollection<ControllerConfigPanel>(tabPage1, c => c.Save(cd.AllTrollers[_theDefinition.Name]));
ActOnControlCollection<ControllerConfigPanel>(tabPage2, c => c.Save(cd.AllTrollersAutoFire[_theDefinition.Name]));
ActOnControlCollection<AnalogBindPanel>(tabPage3, c => c.Save(cd.AllTrollersAnalog[_theDefinition.Name]));
ActOnControlCollection<ControllerConfigPanel>(NormalControlsTab, c => c.Save(cd.AllTrollers[_theDefinition.Name]));
ActOnControlCollection<ControllerConfigPanel>(AutofireControlsTab, c => c.Save(cd.AllTrollersAutoFire[_theDefinition.Name]));
ActOnControlCollection<AnalogBindPanel>(AnalogControlsTab, c => c.Save(cd.AllTrollersAnalog[_theDefinition.Name]));
}
private static void ActOnControlCollection<T>(Control c, Action<T> proc)
@ -309,6 +311,16 @@ namespace BizHawk.Client.EmuHawk
private void NewControllerConfig_Load(object sender, EventArgs e)
{
Text = _theDefinition.Name + " Configuration";
if (!AnalogControlsTab.Controls
.OfType<TabControl>()
.First()
.Controls
.OfType<Control>()
.Any())
{
tabControl1.TabPages.Remove(AnalogControlsTab);
}
}
private static TabControl GetTabControl(IEnumerable controls)
@ -329,9 +341,9 @@ namespace BizHawk.Client.EmuHawk
tabControl1.SuspendLayout();
var wasTabbedMain = tabControl1.SelectedTab.Name;
var tb1 = GetTabControl(tabPage1.Controls);
var tb2 = GetTabControl(tabPage2.Controls);
var tb3 = GetTabControl(tabPage3.Controls);
var tb1 = GetTabControl(NormalControlsTab.Controls);
var tb2 = GetTabControl(AutofireControlsTab.Controls);
var tb3 = GetTabControl(AnalogControlsTab.Controls);
int? wasTabbedPage1 = null;
int? wasTabbedPage2 = null;
int? wasTabbedPage3 = null;
@ -340,9 +352,9 @@ namespace BizHawk.Client.EmuHawk
if (tb2 != null && tb2.SelectedTab != null) { wasTabbedPage2 = tb2.SelectedIndex; }
if (tb3 != null && tb3.SelectedTab != null) { wasTabbedPage3 = tb3.SelectedIndex; }
tabPage1.Controls.Clear();
tabPage2.Controls.Clear();
tabPage3.Controls.Clear();
NormalControlsTab.Controls.Clear();
AutofireControlsTab.Controls.Clear();
AnalogControlsTab.Controls.Clear();
// load panels directly from the default config.
// this means that the changes are NOT committed. so "Cancel" works right and you
@ -354,7 +366,7 @@ namespace BizHawk.Client.EmuHawk
if (wasTabbedPage1.HasValue)
{
var newTb1 = GetTabControl(tabPage1.Controls);
var newTb1 = GetTabControl(NormalControlsTab.Controls);
if (newTb1 != null)
{
newTb1.SelectTab(wasTabbedPage1.Value);
@ -363,7 +375,7 @@ namespace BizHawk.Client.EmuHawk
if (wasTabbedPage2.HasValue)
{
var newTb2 = GetTabControl(tabPage2.Controls);
var newTb2 = GetTabControl(AutofireControlsTab.Controls);
if (newTb2 != null)
{
newTb2.SelectTab(wasTabbedPage2.Value);
@ -372,7 +384,7 @@ namespace BizHawk.Client.EmuHawk
if (wasTabbedPage3.HasValue)
{
var newTb3 = GetTabControl(tabPage3.Controls);
var newTb3 = GetTabControl(AnalogControlsTab.Controls);
if (newTb3 != null)
{
newTb3.SelectTab(wasTabbedPage3.Value);