From 1b0f1a54be226e67aaca776b06991c21387a41a4 Mon Sep 17 00:00:00 2001 From: stuyck Date: Mon, 8 Oct 2012 21:07:12 +0000 Subject: [PATCH] MokeUp for Control Config --- .../UserControlGamePad.Designer.cs | 72 +++++++++++ .../ControllerConfig/UserControlGamePad.cs | 41 ++++++ .../ControllerConfig/UserControlGamePad.resx | 120 ++++++++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.Designer.cs create mode 100644 BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.cs create mode 100644 BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.resx diff --git a/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.Designer.cs b/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.Designer.cs new file mode 100644 index 0000000000..665b24c29d --- /dev/null +++ b/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.Designer.cs @@ -0,0 +1,72 @@ +namespace BizHawk.MultiClient.config.ControllerConfig +{ + partial class UserControlGamePad + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.flowLayoutPanelLabels = new System.Windows.Forms.FlowLayoutPanel(); + this.flowLayoutPanelCommands = new System.Windows.Forms.FlowLayoutPanel(); + this.SuspendLayout(); + // + // flowLayoutPanelLabels + // + this.flowLayoutPanelLabels.Dock = System.Windows.Forms.DockStyle.Left; + this.flowLayoutPanelLabels.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanelLabels.Location = new System.Drawing.Point(0, 0); + this.flowLayoutPanelLabels.Name = "flowLayoutPanelLabels"; + this.flowLayoutPanelLabels.Size = new System.Drawing.Size(155, 400); + this.flowLayoutPanelLabels.TabIndex = 0; + // + // flowLayoutPanelCommands + // + this.flowLayoutPanelCommands.Dock = System.Windows.Forms.DockStyle.Right; + this.flowLayoutPanelCommands.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.flowLayoutPanelCommands.Location = new System.Drawing.Point(161, 0); + this.flowLayoutPanelCommands.Name = "flowLayoutPanelCommands"; + this.flowLayoutPanelCommands.Size = new System.Drawing.Size(154, 400); + this.flowLayoutPanelCommands.TabIndex = 1; + // + // UserControlGamePad + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.flowLayoutPanelCommands); + this.Controls.Add(this.flowLayoutPanelLabels); + this.Name = "UserControlGamePad"; + this.Size = new System.Drawing.Size(315, 400); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelLabels; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelCommands; + + + } +} diff --git a/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.cs b/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.cs new file mode 100644 index 0000000000..b00ba3459b --- /dev/null +++ b/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Reflection; + +namespace BizHawk.MultiClient.config.ControllerConfig +{ + public partial class UserControlGamePad : UserControl + { + private Object _Controler; + public UserControlGamePad() + { + InitializeComponent(); + this.Dock = DockStyle.Fill; + SNESControllerTemplate tmp = new SNESControllerTemplate(false); + + _Controler = tmp; + initialize(); + } + + public void initialize() + { + FieldInfo[] availbleComands = _Controler.GetType().GetFields().Where(x => x.FieldType == typeof(System.String)).ToArray(); + + foreach (FieldInfo item in availbleComands) + { + InputWidget iw = new InputWidget(); + Label label = new Label(); + label.Text = item.Name; + iw.Text = item.GetValue(_Controler) as string; + flowLayoutPanelCommands.Controls.Add(iw); + flowLayoutPanelLabels.Controls.Add(label); + } + } + } +} diff --git a/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.resx b/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.resx new file mode 100644 index 0000000000..29dcb1b3a3 --- /dev/null +++ b/BizHawk.MultiClient/config/ControllerConfig/UserControlGamePad.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file