N64 controller config - fix enabling/disabling of Pak dropdown when the connected checkbox is checked

This commit is contained in:
adelikat 2014-06-25 13:39:33 +00:00
parent 5f71bf11c8
commit 555a30c492
2 changed files with 52 additions and 46 deletions

View File

@ -28,56 +28,57 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.EnabledCheckbox = new System.Windows.Forms.CheckBox(); this.EnabledCheckbox = new System.Windows.Forms.CheckBox();
this.PakTypeDropdown = new System.Windows.Forms.ComboBox(); this.PakTypeDropdown = new System.Windows.Forms.ComboBox();
this.ControllerNameLabel = new System.Windows.Forms.Label(); this.ControllerNameLabel = new System.Windows.Forms.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// EnabledCheckbox // EnabledCheckbox
// //
this.EnabledCheckbox.AutoSize = true; this.EnabledCheckbox.AutoSize = true;
this.EnabledCheckbox.Location = new System.Drawing.Point(80, 2); this.EnabledCheckbox.Location = new System.Drawing.Point(80, 2);
this.EnabledCheckbox.Name = "EnabledCheckbox"; this.EnabledCheckbox.Name = "EnabledCheckbox";
this.EnabledCheckbox.Size = new System.Drawing.Size(78, 17); this.EnabledCheckbox.Size = new System.Drawing.Size(78, 17);
this.EnabledCheckbox.TabIndex = 0; this.EnabledCheckbox.TabIndex = 0;
this.EnabledCheckbox.Text = "Connected"; this.EnabledCheckbox.Text = "Connected";
this.EnabledCheckbox.UseVisualStyleBackColor = true; this.EnabledCheckbox.UseVisualStyleBackColor = true;
// this.EnabledCheckbox.CheckedChanged += new System.EventHandler(this.EnabledCheckbox_CheckedChanged);
// PakTypeDropdown //
// // PakTypeDropdown
this.PakTypeDropdown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; //
this.PakTypeDropdown.FormattingEnabled = true; this.PakTypeDropdown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.PakTypeDropdown.Items.AddRange(new object[] { this.PakTypeDropdown.FormattingEnabled = true;
this.PakTypeDropdown.Items.AddRange(new object[] {
"None", "None",
"Memory Card", "Memory Card",
"Rumble Pak", "Rumble Pak",
"Transfer Pak"}); "Transfer Pak"});
this.PakTypeDropdown.Location = new System.Drawing.Point(160, 0); this.PakTypeDropdown.Location = new System.Drawing.Point(160, 0);
this.PakTypeDropdown.Name = "PakTypeDropdown"; this.PakTypeDropdown.Name = "PakTypeDropdown";
this.PakTypeDropdown.Size = new System.Drawing.Size(121, 21); this.PakTypeDropdown.Size = new System.Drawing.Size(121, 21);
this.PakTypeDropdown.TabIndex = 1; this.PakTypeDropdown.TabIndex = 1;
// //
// ControllerNameLabel // ControllerNameLabel
// //
this.ControllerNameLabel.AutoSize = true; this.ControllerNameLabel.AutoSize = true;
this.ControllerNameLabel.Location = new System.Drawing.Point(3, 4); this.ControllerNameLabel.Location = new System.Drawing.Point(3, 4);
this.ControllerNameLabel.Name = "ControllerNameLabel"; this.ControllerNameLabel.Name = "ControllerNameLabel";
this.ControllerNameLabel.Size = new System.Drawing.Size(60, 13); this.ControllerNameLabel.Size = new System.Drawing.Size(60, 13);
this.ControllerNameLabel.TabIndex = 2; this.ControllerNameLabel.TabIndex = 2;
this.ControllerNameLabel.Text = "Controller 1"; this.ControllerNameLabel.Text = "Controller 1";
// //
// N64ControllerSettingControl // N64ControllerSettingControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.ControllerNameLabel); this.Controls.Add(this.ControllerNameLabel);
this.Controls.Add(this.PakTypeDropdown); this.Controls.Add(this.PakTypeDropdown);
this.Controls.Add(this.EnabledCheckbox); this.Controls.Add(this.EnabledCheckbox);
this.Name = "N64ControllerSettingControl"; this.Name = "N64ControllerSettingControl";
this.Size = new System.Drawing.Size(290, 22); this.Size = new System.Drawing.Size(290, 22);
this.Load += new System.EventHandler(this.N64ControllerSettingControl_Load); this.Load += new System.EventHandler(this.N64ControllerSettingControl_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }

View File

@ -91,5 +91,10 @@ namespace BizHawk.Client.EmuHawk
ControllerNameLabel.Text = "Controller " + ControllerNumber; ControllerNameLabel.Text = "Controller " + ControllerNumber;
base.Refresh(); base.Refresh();
} }
private void EnabledCheckbox_CheckedChanged(object sender, EventArgs e)
{
PakTypeDropdown.Enabled = EnabledCheckbox.Checked;
}
} }
} }