VirtualPad object, added to TAStudio

This commit is contained in:
andres.delikat 2011-06-12 01:50:08 +00:00
parent 9ee66226df
commit 368faf64f4
9 changed files with 332 additions and 4 deletions

View File

@ -276,6 +276,9 @@
<Compile Include="tools\Cheats.Designer.cs">
<DependentUpon>Cheats.cs</DependentUpon>
</Compile>
<Compile Include="tools\Pad.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="tools\HexEditor.cs">
<SubType>Form</SubType>
</Compile>
@ -433,6 +436,10 @@
<DependentUpon>Cheats.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="tools\Pad.resx">
<DependentUpon>Pad.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="tools\HexEditor.resx">
<DependentUpon>HexEditor.cs</DependentUpon>
<SubType>Designer</SubType>
@ -524,6 +531,8 @@
<None Include="images\BackMore.png" />
<None Include="images\Forward.png" />
<None Include="images\ForwardMore.png" />
<None Include="images\BlueDown.png" />
<None Include="images\BlueUp.png" />
<Content Include="output\gamedb.txt" />
<Content Include="output\gamedb_neshomebrew.txt" />
<None Include="images\Refresh.bmp" />

View File

@ -74,6 +74,20 @@ namespace BizHawk.MultiClient.Properties {
}
}
internal static System.Drawing.Bitmap BlueDown {
get {
object obj = ResourceManager.GetObject("BlueDown", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap BlueUp {
get {
object obj = ResourceManager.GetObject("BlueUp", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap BuilderDialog_delete {
get {
object obj = ResourceManager.GetObject("BuilderDialog_delete", resourceCulture);

View File

@ -666,4 +666,10 @@
<data name="ReadOnly" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\ReadOnly.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="BlueDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\BlueDown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="BlueUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\BlueUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,146 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
namespace BizHawk.MultiClient
{
public class VirtualPad : Panel
{
public CheckBox PU;
public CheckBox PD;
public CheckBox PL;
public CheckBox PR;
public CheckBox B1;
public CheckBox B2;
public CheckBox B3;
public CheckBox B4;
public VirtualPad()
{
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
this.BorderStyle = BorderStyle.Fixed3D;
this.Paint += new System.Windows.Forms.PaintEventHandler(this.VirtualPad_Paint);
this.Size = new Size(174, 164);
Point n = new Point(this.Size);
this.PU = new CheckBox();
this.PU.Appearance = System.Windows.Forms.Appearance.Button;
this.PU.AutoSize = true;
this.PU.Image = global::BizHawk.MultiClient.Properties.Resources.BlueUp;
this.PU.ImageAlign = System.Drawing.ContentAlignment.BottomRight;
this.PU.Location = new System.Drawing.Point(14, 2);
this.PU.TabIndex = 1;
this.PU.UseVisualStyleBackColor = true; ;
this.PD = new CheckBox();
this.PD.Appearance = System.Windows.Forms.Appearance.Button;
this.PD.AutoSize = true;
this.PD.Image = global::BizHawk.MultiClient.Properties.Resources.BlueDown;
this.PD.ImageAlign = System.Drawing.ContentAlignment.BottomRight;
this.PD.Location = new System.Drawing.Point(14, 46);
this.PD.TabIndex = 4;
this.PD.UseVisualStyleBackColor = true;
this.PR = new CheckBox();
this.PR.Appearance = System.Windows.Forms.Appearance.Button;
this.PR.AutoSize = true;
this.PR.Image = global::BizHawk.MultiClient.Properties.Resources.Forward;
this.PR.ImageAlign = System.Drawing.ContentAlignment.BottomRight;
this.PR.Location = new System.Drawing.Point(24, 24);
this.PR.TabIndex = 3;
this.PR.UseVisualStyleBackColor = true;
this.PL = new CheckBox();
this.PL.Appearance = System.Windows.Forms.Appearance.Button;
this.PL.AutoSize = true;
this.PL.Image = global::BizHawk.MultiClient.Properties.Resources.Back;
this.PL.ImageAlign = System.Drawing.ContentAlignment.BottomRight;
this.PL.Location = new System.Drawing.Point(2, 24);
this.PL.TabIndex = 2;
this.PL.UseVisualStyleBackColor = true;
this.B1 = new CheckBox();
this.B1.Appearance = System.Windows.Forms.Appearance.Button;
this.B1.AutoSize = true;
this.B1.Location = new System.Drawing.Point(52, 24);
this.B1.TabIndex = 5;
this.B1.Text = "s";
this.B1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.B1.UseVisualStyleBackColor = true;
this.B2 = new CheckBox();
this.B2.Appearance = System.Windows.Forms.Appearance.Button;
this.B2.AutoSize = true;
this.B2.Location = new System.Drawing.Point(74, 24);
this.B2.TabIndex = 6;
this.B2.Text = "S";
this.B2.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.B2.UseVisualStyleBackColor = true;
this.B3 = new CheckBox();
this.B3.Appearance = System.Windows.Forms.Appearance.Button;
this.B3.AutoSize = true;
this.B3.Location = new System.Drawing.Point(122, 24);
this.B3.TabIndex = 7;
this.B3.Text = "B";
this.B3.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.B3.UseVisualStyleBackColor = true;
this.B4 = new CheckBox();
this.B4.Appearance = System.Windows.Forms.Appearance.Button;
this.B4.AutoSize = true;
this.B4.Location = new System.Drawing.Point(146, 24);
this.B4.TabIndex = 8;
this.B4.Text = "A";
this.B4.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.B4.UseVisualStyleBackColor = true;
this.Controls.Add(this.PU);
this.Controls.Add(this.PD);
this.Controls.Add(this.PL);
this.Controls.Add(this.PR);
this.Controls.Add(this.B1);
this.Controls.Add(this.B2);
this.Controls.Add(this.B3);
this.Controls.Add(this.B4);
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Up)
{
//TODO: move to next logical key
this.Refresh();
}
else if (keyData == Keys.Down)
{
this.Refresh();
}
else if (keyData == Keys.Left)
{
this.Refresh();
}
else if (keyData == Keys.Right)
{
this.Refresh();
}
else if (keyData == Keys.Tab)
{
this.Refresh();
}
return true;
}
private void VirtualPad_Paint(object sender, PaintEventArgs e)
{
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@ -70,12 +70,15 @@
this.insertFrameToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.Pad1 = new BizHawk.MultiClient.VirtualPad();
this.menuStrip1.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.toolStrip2.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
@ -86,7 +89,7 @@
this.settingsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(721, 24);
this.menuStrip1.Size = new System.Drawing.Size(844, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
@ -261,10 +264,10 @@
//
// toolStripContainer1.ContentPanel
//
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(172, 39);
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(172, 3);
this.toolStripContainer1.Location = new System.Drawing.Point(373, 38);
this.toolStripContainer1.Name = "toolStripContainer1";
this.toolStripContainer1.Size = new System.Drawing.Size(172, 89);
this.toolStripContainer1.Size = new System.Drawing.Size(172, 53);
this.toolStripContainer1.TabIndex = 2;
this.toolStripContainer1.Text = "toolStripContainer1";
//
@ -419,11 +422,30 @@
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(147, 22);
this.selectAllToolStripMenuItem.Text = "Select All";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.Pad1);
this.groupBox1.Location = new System.Drawing.Point(373, 108);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(445, 280);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Controllers";
//
// Pad1
//
this.Pad1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Pad1.Location = new System.Drawing.Point(6, 19);
this.Pad1.Name = "Pad1";
this.Pad1.Size = new System.Drawing.Size(176, 80);
this.Pad1.TabIndex = 0;
//
// TAStudio
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(721, 474);
this.ClientSize = new System.Drawing.Size(844, 474);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.ReadOnlyCheckBox);
this.Controls.Add(this.toolStripContainer1);
this.Controls.Add(this.TASView);
@ -444,6 +466,7 @@
this.toolStrip2.ResumeLayout(false);
this.toolStrip2.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -491,5 +514,7 @@
private System.Windows.Forms.ToolStripMenuItem insertFrameToolStripMenuItem1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
private System.Windows.Forms.GroupBox groupBox1;
private VirtualPad Pad1;
}
}

View File

@ -170,5 +170,10 @@ namespace BizHawk.MultiClient
if (Global.MainForm.ReadOnly)
return;
}
private void Pad1_Paint(object sender, PaintEventArgs e)
{
}
}
}