From 6c954c7b5d69850909398ab55f0d753e6fcb398c Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Thu, 20 Jan 2011 04:33:16 +0000 Subject: [PATCH] Ram Watch - check in a New Watch winform --- .../BizHawk.MultiClient.csproj | 10 + BizHawk.MultiClient/RamWatch.cs | 2 + .../RamWatchNewWatch.Designer.cs | 279 ++++++++++++++++++ BizHawk.MultiClient/RamWatchNewWatch.cs | 39 +++ BizHawk.MultiClient/RamWatchNewWatch.resx | 120 ++++++++ BizHawk.MultiClient/Watch.cs | 2 +- 6 files changed, 451 insertions(+), 1 deletion(-) create mode 100644 BizHawk.MultiClient/RamWatchNewWatch.Designer.cs create mode 100644 BizHawk.MultiClient/RamWatchNewWatch.cs create mode 100644 BizHawk.MultiClient/RamWatchNewWatch.resx diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index 9ef9fe6a51..fb2f33d06a 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -96,6 +96,10 @@ RamWatch.cs Designer + + RamWatchNewWatch.cs + Designer + True Resources.resx @@ -115,6 +119,12 @@ RamWatch.cs + + Form + + + RamWatchNewWatch.cs + diff --git a/BizHawk.MultiClient/RamWatch.cs b/BizHawk.MultiClient/RamWatch.cs index 1de8f1ce68..d7b9d34c70 100644 --- a/BizHawk.MultiClient/RamWatch.cs +++ b/BizHawk.MultiClient/RamWatch.cs @@ -160,6 +160,8 @@ namespace BizHawk.MultiClient void AddNewWatch() { + RamWatchNewWatch r = new RamWatchNewWatch(); + r.ShowDialog(); } void EditWatch() diff --git a/BizHawk.MultiClient/RamWatchNewWatch.Designer.cs b/BizHawk.MultiClient/RamWatchNewWatch.Designer.cs new file mode 100644 index 0000000000..7986c71908 --- /dev/null +++ b/BizHawk.MultiClient/RamWatchNewWatch.Designer.cs @@ -0,0 +1,279 @@ +namespace BizHawk.MultiClient +{ + partial class RamWatchNewWatch + { + /// + /// 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 Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.AddressBox = new System.Windows.Forms.TextBox(); + this.NotesBox = new System.Windows.Forms.TextBox(); + this.DataTypeGroupBox = new System.Windows.Forms.GroupBox(); + this.SignedRadio = new System.Windows.Forms.RadioButton(); + this.UnsignedRadio = new System.Windows.Forms.RadioButton(); + this.HexRadio = new System.Windows.Forms.RadioButton(); + this.DataSizeBox = new System.Windows.Forms.GroupBox(); + this.Byte1Radio = new System.Windows.Forms.RadioButton(); + this.Byte2Radio = new System.Windows.Forms.RadioButton(); + this.Byte4Radio = new System.Windows.Forms.RadioButton(); + this.EndianBox = new System.Windows.Forms.GroupBox(); + this.BigEndianRadio = new System.Windows.Forms.RadioButton(); + this.LittleEndianRadio = new System.Windows.Forms.RadioButton(); + this.OK = new System.Windows.Forms.Button(); + this.Cancel = new System.Windows.Forms.Button(); + this.DataTypeGroupBox.SuspendLayout(); + this.DataSizeBox.SuspendLayout(); + this.EndianBox.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(13, 23); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(45, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Address"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(16, 54); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(38, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Notes:"; + // + // AddressBox + // + this.AddressBox.Location = new System.Drawing.Point(65, 23); + this.AddressBox.Name = "AddressBox"; + this.AddressBox.Size = new System.Drawing.Size(100, 20); + this.AddressBox.TabIndex = 2; + this.AddressBox.Text = "0000"; + // + // NotesBox + // + this.NotesBox.Location = new System.Drawing.Point(65, 54); + this.NotesBox.Name = "NotesBox"; + this.NotesBox.Size = new System.Drawing.Size(100, 20); + this.NotesBox.TabIndex = 3; + // + // DataTypeGroupBox + // + this.DataTypeGroupBox.Controls.Add(this.HexRadio); + this.DataTypeGroupBox.Controls.Add(this.UnsignedRadio); + this.DataTypeGroupBox.Controls.Add(this.SignedRadio); + this.DataTypeGroupBox.Location = new System.Drawing.Point(16, 85); + this.DataTypeGroupBox.Name = "DataTypeGroupBox"; + this.DataTypeGroupBox.Size = new System.Drawing.Size(113, 111); + this.DataTypeGroupBox.TabIndex = 4; + this.DataTypeGroupBox.TabStop = false; + this.DataTypeGroupBox.Text = "Data Type"; + // + // SignedRadio + // + this.SignedRadio.AutoSize = true; + this.SignedRadio.Location = new System.Drawing.Point(8, 19); + this.SignedRadio.Name = "SignedRadio"; + this.SignedRadio.Size = new System.Drawing.Size(58, 17); + this.SignedRadio.TabIndex = 0; + this.SignedRadio.Text = "Signed"; + this.SignedRadio.UseVisualStyleBackColor = true; + // + // UnsignedRadio + // + this.UnsignedRadio.AutoSize = true; + this.UnsignedRadio.Checked = true; + this.UnsignedRadio.Location = new System.Drawing.Point(8, 42); + this.UnsignedRadio.Name = "UnsignedRadio"; + this.UnsignedRadio.Size = new System.Drawing.Size(70, 17); + this.UnsignedRadio.TabIndex = 1; + this.UnsignedRadio.TabStop = true; + this.UnsignedRadio.Text = "Unsigned"; + this.UnsignedRadio.UseVisualStyleBackColor = true; + // + // HexRadio + // + this.HexRadio.AutoSize = true; + this.HexRadio.Location = new System.Drawing.Point(6, 65); + this.HexRadio.Name = "HexRadio"; + this.HexRadio.Size = new System.Drawing.Size(86, 17); + this.HexRadio.TabIndex = 2; + this.HexRadio.Text = "Hexadecimal"; + this.HexRadio.UseVisualStyleBackColor = true; + // + // DataSizeBox + // + this.DataSizeBox.Controls.Add(this.Byte4Radio); + this.DataSizeBox.Controls.Add(this.Byte2Radio); + this.DataSizeBox.Controls.Add(this.Byte1Radio); + this.DataSizeBox.Location = new System.Drawing.Point(163, 85); + this.DataSizeBox.Name = "DataSizeBox"; + this.DataSizeBox.Size = new System.Drawing.Size(98, 100); + this.DataSizeBox.TabIndex = 5; + this.DataSizeBox.TabStop = false; + this.DataSizeBox.Text = "Data Size:"; + this.DataSizeBox.Enter += new System.EventHandler(this.DataSizeBox_Enter); + // + // Byte1Radio + // + this.Byte1Radio.AutoSize = true; + this.Byte1Radio.Checked = true; + this.Byte1Radio.Location = new System.Drawing.Point(6, 19); + this.Byte1Radio.Name = "Byte1Radio"; + this.Byte1Radio.Size = new System.Drawing.Size(55, 17); + this.Byte1Radio.TabIndex = 0; + this.Byte1Radio.TabStop = true; + this.Byte1Radio.Text = "1 Byte"; + this.Byte1Radio.UseVisualStyleBackColor = true; + // + // Byte2Radio + // + this.Byte2Radio.AutoSize = true; + this.Byte2Radio.Location = new System.Drawing.Point(6, 42); + this.Byte2Radio.Name = "Byte2Radio"; + this.Byte2Radio.Size = new System.Drawing.Size(60, 17); + this.Byte2Radio.TabIndex = 1; + this.Byte2Radio.Text = "2 Bytes"; + this.Byte2Radio.UseVisualStyleBackColor = true; + // + // Byte4Radio + // + this.Byte4Radio.AutoSize = true; + this.Byte4Radio.Location = new System.Drawing.Point(6, 65); + this.Byte4Radio.Name = "Byte4Radio"; + this.Byte4Radio.Size = new System.Drawing.Size(60, 17); + this.Byte4Radio.TabIndex = 2; + this.Byte4Radio.Text = "4 Bytes"; + this.Byte4Radio.UseVisualStyleBackColor = true; + // + // EndianBox + // + this.EndianBox.Controls.Add(this.LittleEndianRadio); + this.EndianBox.Controls.Add(this.BigEndianRadio); + this.EndianBox.Location = new System.Drawing.Point(16, 216); + this.EndianBox.Name = "EndianBox"; + this.EndianBox.Size = new System.Drawing.Size(200, 100); + this.EndianBox.TabIndex = 6; + this.EndianBox.TabStop = false; + this.EndianBox.Text = "Endian"; + // + // BigEndianRadio + // + this.BigEndianRadio.AutoSize = true; + this.BigEndianRadio.Checked = true; + this.BigEndianRadio.Location = new System.Drawing.Point(15, 19); + this.BigEndianRadio.Name = "BigEndianRadio"; + this.BigEndianRadio.Size = new System.Drawing.Size(76, 17); + this.BigEndianRadio.TabIndex = 0; + this.BigEndianRadio.TabStop = true; + this.BigEndianRadio.Text = "Big Endian"; + this.BigEndianRadio.UseVisualStyleBackColor = true; + // + // LittleEndianRadio + // + this.LittleEndianRadio.AutoSize = true; + this.LittleEndianRadio.Location = new System.Drawing.Point(15, 42); + this.LittleEndianRadio.Name = "LittleEndianRadio"; + this.LittleEndianRadio.Size = new System.Drawing.Size(83, 17); + this.LittleEndianRadio.TabIndex = 1; + this.LittleEndianRadio.Text = "Little Endian"; + this.LittleEndianRadio.UseVisualStyleBackColor = true; + // + // OK + // + this.OK.Location = new System.Drawing.Point(54, 322); + this.OK.Name = "OK"; + this.OK.Size = new System.Drawing.Size(75, 23); + this.OK.TabIndex = 7; + this.OK.Text = "Ok"; + this.OK.UseVisualStyleBackColor = true; + this.OK.Click += new System.EventHandler(this.OK_Click); + // + // Cancel + // + this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Cancel.Location = new System.Drawing.Point(169, 321); + this.Cancel.Name = "Cancel"; + this.Cancel.Size = new System.Drawing.Size(75, 23); + this.Cancel.TabIndex = 8; + this.Cancel.Text = "Cancel"; + this.Cancel.UseVisualStyleBackColor = true; + this.Cancel.Click += new System.EventHandler(this.Cancel_Click); + // + // RamWatchNewWatch + // + this.AcceptButton = this.OK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.Cancel; + this.ClientSize = new System.Drawing.Size(379, 376); + this.Controls.Add(this.Cancel); + this.Controls.Add(this.OK); + this.Controls.Add(this.EndianBox); + this.Controls.Add(this.DataSizeBox); + this.Controls.Add(this.DataTypeGroupBox); + this.Controls.Add(this.NotesBox); + this.Controls.Add(this.AddressBox); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "RamWatchNewWatch"; + this.Text = "New Watch"; + this.Load += new System.EventHandler(this.RamWatchNewWatch_Load); + this.DataTypeGroupBox.ResumeLayout(false); + this.DataTypeGroupBox.PerformLayout(); + this.DataSizeBox.ResumeLayout(false); + this.DataSizeBox.PerformLayout(); + this.EndianBox.ResumeLayout(false); + this.EndianBox.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox AddressBox; + private System.Windows.Forms.TextBox NotesBox; + private System.Windows.Forms.GroupBox DataTypeGroupBox; + private System.Windows.Forms.RadioButton SignedRadio; + private System.Windows.Forms.RadioButton UnsignedRadio; + private System.Windows.Forms.RadioButton HexRadio; + private System.Windows.Forms.GroupBox DataSizeBox; + private System.Windows.Forms.RadioButton Byte1Radio; + private System.Windows.Forms.RadioButton Byte2Radio; + private System.Windows.Forms.RadioButton Byte4Radio; + private System.Windows.Forms.GroupBox EndianBox; + private System.Windows.Forms.RadioButton BigEndianRadio; + private System.Windows.Forms.RadioButton LittleEndianRadio; + private System.Windows.Forms.Button OK; + private System.Windows.Forms.Button Cancel; + } +} \ No newline at end of file diff --git a/BizHawk.MultiClient/RamWatchNewWatch.cs b/BizHawk.MultiClient/RamWatchNewWatch.cs new file mode 100644 index 0000000000..5e21006d8c --- /dev/null +++ b/BizHawk.MultiClient/RamWatchNewWatch.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace BizHawk.MultiClient +{ + public partial class RamWatchNewWatch : Form + { + public RamWatchNewWatch() + { + InitializeComponent(); + } + + private void RamWatchNewWatch_Load(object sender, EventArgs e) + { + + } + + private void DataSizeBox_Enter(object sender, EventArgs e) + { + + } + + private void Cancel_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void OK_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/BizHawk.MultiClient/RamWatchNewWatch.resx b/BizHawk.MultiClient/RamWatchNewWatch.resx new file mode 100644 index 0000000000..ff31a6db56 --- /dev/null +++ b/BizHawk.MultiClient/RamWatchNewWatch.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/BizHawk.MultiClient/Watch.cs b/BizHawk.MultiClient/Watch.cs index 4d254e6602..d9bc4c2591 100644 --- a/BizHawk.MultiClient/Watch.cs +++ b/BizHawk.MultiClient/Watch.cs @@ -6,7 +6,7 @@ using System.Text; namespace BizHawk.MultiClient { //Data structure for a watch item in the Ram Watch Dialog - enum atype { BYTE, WORD, DWORD }; + enum atype { BYTE, WORD, DWORD }; //TODO: more custom types too like 12.4 and 24.12 fixed point enum asigned { SIGNED, UNSIGNED, HEX }; class Watch {