From 9ebc848d26be55b63762704ea0ed8b38bbf5d2e9 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 18 Nov 2012 05:31:31 +0000 Subject: [PATCH] VirtualPad tool - fix resizing, fix clear button on coleco pad, add to Toolbox Dialog, Toolbox dialog - dynamically resize height based on number of tools in the box --- BizHawk.MultiClient/tools/ToolBox.Designer.cs | 24 ++++++++++++++----- BizHawk.MultiClient/tools/ToolBox.cs | 7 ++++++ .../tools/VirtualPadForm.Designer.cs | 3 +-- BizHawk.MultiClient/tools/VirtualPadForm.cs | 4 ++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/BizHawk.MultiClient/tools/ToolBox.Designer.cs b/BizHawk.MultiClient/tools/ToolBox.Designer.cs index 4c47487009..c6dd2ab014 100644 --- a/BizHawk.MultiClient/tools/ToolBox.Designer.cs +++ b/BizHawk.MultiClient/tools/ToolBox.Designer.cs @@ -44,6 +44,7 @@ this.KeypadTool = new System.Windows.Forms.ToolStripButton(); this.GameboyDebuggerTool = new System.Windows.Forms.ToolStripButton(); this.SNESGraphicsDebuggerButton = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -58,6 +59,7 @@ this.toolStripButton4, this.HexEditor, this.toolStripButton5, + this.toolStripButton6, this.TAStudioButton, this.NESDebugger, this.NESPPU, @@ -69,7 +71,7 @@ this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.Table; this.toolStrip1.Location = new System.Drawing.Point(9, 11); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(100, 306); + this.toolStrip1.Size = new System.Drawing.Size(100, 348); this.toolStrip1.TabIndex = 0; this.toolStrip1.TabStop = true; // @@ -129,12 +131,12 @@ // // TAStudioButton // - this.TAStudioButton.Image = global::BizHawk.MultiClient.Properties.Resources.TAStudio; + this.TAStudioButton.Image = global::BizHawk.MultiClient.Properties.Resources.GameController; this.TAStudioButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.TAStudioButton.Name = "TAStudioButton"; - this.TAStudioButton.Size = new System.Drawing.Size(76, 20); - this.TAStudioButton.Text = "TAStudio"; - this.TAStudioButton.Click += new System.EventHandler(this.TAStudioButton_Click); + this.TAStudioButton.Size = new System.Drawing.Size(86, 20); + this.TAStudioButton.Text = "VirtualPads"; + this.TAStudioButton.Click += new System.EventHandler(this.TAStudioButton_Click_1); // // NESDebugger // @@ -195,11 +197,20 @@ this.SNESGraphicsDebuggerButton.Text = "Gfx Debugger"; this.SNESGraphicsDebuggerButton.Click += new System.EventHandler(this.SNESGraphicsDebuggerButton_Click); // + // toolStripButton6 + // + this.toolStripButton6.Image = global::BizHawk.MultiClient.Properties.Resources.TAStudio; + this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton6.Name = "toolStripButton6"; + this.toolStripButton6.Size = new System.Drawing.Size(76, 20); + this.toolStripButton6.Text = "TAStudio"; + this.toolStripButton6.Click += new System.EventHandler(this.TAStudioButton_Click); + // // ToolBox // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(116, 321); + this.ClientSize = new System.Drawing.Size(116, 338); this.Controls.Add(this.toolStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MinimumSize = new System.Drawing.Size(130, 64); @@ -230,6 +241,7 @@ private System.Windows.Forms.ToolStripButton TAStudioButton; private System.Windows.Forms.ToolStripButton GameboyDebuggerTool; private System.Windows.Forms.ToolStripButton SNESGraphicsDebuggerButton; + private System.Windows.Forms.ToolStripButton toolStripButton6; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/ToolBox.cs b/BizHawk.MultiClient/tools/ToolBox.cs index ec559b8ad9..7fdf02c8f0 100644 --- a/BizHawk.MultiClient/tools/ToolBox.cs +++ b/BizHawk.MultiClient/tools/ToolBox.cs @@ -66,6 +66,8 @@ namespace BizHawk.MultiClient { SNESGraphicsDebuggerButton.Visible = false; } + + Size = new Size(this.Size.Width, toolStrip1.Size.Height + 50); } private void toolStripButton1_Click(object sender, EventArgs e) @@ -139,5 +141,10 @@ namespace BizHawk.MultiClient Global.MainForm.LoadSNESGraphicsDebugger(); } } + + private void TAStudioButton_Click_1(object sender, EventArgs e) + { + Global.MainForm.LoadVirtualPads(); + } } } diff --git a/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs b/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs index 2d07319a75..ee8c21f599 100644 --- a/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs +++ b/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs @@ -143,8 +143,7 @@ this.Controls.Add(this.menuStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; - this.MaximumSize = new System.Drawing.Size(404, 350); - this.MinimumSize = new System.Drawing.Size(404, 350); + this.MinimumSize = new System.Drawing.Size(100, 100); this.Name = "VirtualPadForm"; this.Text = "Virtual Pads"; this.Load += new System.EventHandler(this.VirtualPadForm_Load); diff --git a/BizHawk.MultiClient/tools/VirtualPadForm.cs b/BizHawk.MultiClient/tools/VirtualPadForm.cs index 2e35158a63..9baf217f76 100644 --- a/BizHawk.MultiClient/tools/VirtualPadForm.cs +++ b/BizHawk.MultiClient/tools/VirtualPadForm.cs @@ -192,8 +192,8 @@ namespace BizHawk.MultiClient { foreach (var controller in ControllerBox.Controls) { - if (controller is VirtualPad) - ((VirtualPad)controller).Clear(); + if (controller is IVirtualPad) + ((IVirtualPad)controller).Clear(); } }