From 555a30c4924e34e0896dc4b6c9670b600eed7302 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 25 Jun 2014 13:39:33 +0000 Subject: [PATCH] N64 controller config - fix enabling/disabling of Pak dropdown when the connected checkbox is checked --- .../N64ControllerSettingControl.Designer.cs | 93 ++++++++++--------- .../config/N64/N64ControllerSettingControl.cs | 5 + 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.Designer.cs b/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.Designer.cs index 6ccb33edb2..496fa1eb1f 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.Designer.cs @@ -28,56 +28,57 @@ /// private void InitializeComponent() { - this.EnabledCheckbox = new System.Windows.Forms.CheckBox(); - this.PakTypeDropdown = new System.Windows.Forms.ComboBox(); - this.ControllerNameLabel = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // EnabledCheckbox - // - this.EnabledCheckbox.AutoSize = true; - this.EnabledCheckbox.Location = new System.Drawing.Point(80, 2); - this.EnabledCheckbox.Name = "EnabledCheckbox"; - this.EnabledCheckbox.Size = new System.Drawing.Size(78, 17); - this.EnabledCheckbox.TabIndex = 0; - this.EnabledCheckbox.Text = "Connected"; - this.EnabledCheckbox.UseVisualStyleBackColor = true; - // - // PakTypeDropdown - // - this.PakTypeDropdown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.PakTypeDropdown.FormattingEnabled = true; - this.PakTypeDropdown.Items.AddRange(new object[] { + this.EnabledCheckbox = new System.Windows.Forms.CheckBox(); + this.PakTypeDropdown = new System.Windows.Forms.ComboBox(); + this.ControllerNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // EnabledCheckbox + // + this.EnabledCheckbox.AutoSize = true; + this.EnabledCheckbox.Location = new System.Drawing.Point(80, 2); + this.EnabledCheckbox.Name = "EnabledCheckbox"; + this.EnabledCheckbox.Size = new System.Drawing.Size(78, 17); + this.EnabledCheckbox.TabIndex = 0; + this.EnabledCheckbox.Text = "Connected"; + this.EnabledCheckbox.UseVisualStyleBackColor = true; + this.EnabledCheckbox.CheckedChanged += new System.EventHandler(this.EnabledCheckbox_CheckedChanged); + // + // PakTypeDropdown + // + this.PakTypeDropdown.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.PakTypeDropdown.FormattingEnabled = true; + this.PakTypeDropdown.Items.AddRange(new object[] { "None", "Memory Card", "Rumble Pak", "Transfer Pak"}); - this.PakTypeDropdown.Location = new System.Drawing.Point(160, 0); - this.PakTypeDropdown.Name = "PakTypeDropdown"; - this.PakTypeDropdown.Size = new System.Drawing.Size(121, 21); - this.PakTypeDropdown.TabIndex = 1; - // - // ControllerNameLabel - // - this.ControllerNameLabel.AutoSize = true; - this.ControllerNameLabel.Location = new System.Drawing.Point(3, 4); - this.ControllerNameLabel.Name = "ControllerNameLabel"; - this.ControllerNameLabel.Size = new System.Drawing.Size(60, 13); - this.ControllerNameLabel.TabIndex = 2; - this.ControllerNameLabel.Text = "Controller 1"; - // - // N64ControllerSettingControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.ControllerNameLabel); - this.Controls.Add(this.PakTypeDropdown); - this.Controls.Add(this.EnabledCheckbox); - this.Name = "N64ControllerSettingControl"; - this.Size = new System.Drawing.Size(290, 22); - this.Load += new System.EventHandler(this.N64ControllerSettingControl_Load); - this.ResumeLayout(false); - this.PerformLayout(); + this.PakTypeDropdown.Location = new System.Drawing.Point(160, 0); + this.PakTypeDropdown.Name = "PakTypeDropdown"; + this.PakTypeDropdown.Size = new System.Drawing.Size(121, 21); + this.PakTypeDropdown.TabIndex = 1; + // + // ControllerNameLabel + // + this.ControllerNameLabel.AutoSize = true; + this.ControllerNameLabel.Location = new System.Drawing.Point(3, 4); + this.ControllerNameLabel.Name = "ControllerNameLabel"; + this.ControllerNameLabel.Size = new System.Drawing.Size(60, 13); + this.ControllerNameLabel.TabIndex = 2; + this.ControllerNameLabel.Text = "Controller 1"; + // + // N64ControllerSettingControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.ControllerNameLabel); + this.Controls.Add(this.PakTypeDropdown); + this.Controls.Add(this.EnabledCheckbox); + this.Name = "N64ControllerSettingControl"; + this.Size = new System.Drawing.Size(290, 22); + this.Load += new System.EventHandler(this.N64ControllerSettingControl_Load); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.cs b/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.cs index 7178edccbc..be37f7fe1e 100644 --- a/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.cs +++ b/BizHawk.Client.EmuHawk/config/N64/N64ControllerSettingControl.cs @@ -91,5 +91,10 @@ namespace BizHawk.Client.EmuHawk ControllerNameLabel.Text = "Controller " + ControllerNumber; base.Refresh(); } + + private void EnabledCheckbox_CheckedChanged(object sender, EventArgs e) + { + PakTypeDropdown.Enabled = EnabledCheckbox.Checked; + } } }