RamWatch - Edit watch dialog now makes it clear that the address is a hex value

This commit is contained in:
andres.delikat 2011-02-18 06:01:22 +00:00
parent 5a0d477dba
commit 2f3f0e01cf
3 changed files with 15 additions and 10 deletions

View File

@ -19,10 +19,7 @@ namespace BizHawk.MultiClient
//TODO: //TODO:
//Make a context menu for add/remove/Dup/etc, make the context menu & edit watch windows appear in relation to where they right clicked //Make a context menu for add/remove/Dup/etc, make the context menu & edit watch windows appear in relation to where they right clicked
//TODO: Call AskSave in main client X function //TODO: Call AskSave in main client X function
//Address can be changed, when that event is triggered, open the edit watch dialog
//Multiselect is enabled but only one row can be highlighted by the user //Multiselect is enabled but only one row can be highlighted by the user
//Make it clear that on edit/new/duplicate watch, address is hex
//Validate address box as legit hex number
//When using ListView index, validate the user has selected one! //When using ListView index, validate the user has selected one!
//DWORD display //DWORD display

View File

@ -56,14 +56,14 @@
this.label1.AutoSize = true; this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 9); this.label1.Location = new System.Drawing.Point(9, 9);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 13); this.label1.Size = new System.Drawing.Size(62, 13);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "Address:"; this.label1.Text = "Address: 0x";
// //
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(19, 36); this.label2.Location = new System.Drawing.Point(9, 35);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13); this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.TabIndex = 1; this.label2.TabIndex = 1;
@ -71,7 +71,7 @@
// //
// AddressBox // AddressBox
// //
this.AddressBox.Location = new System.Drawing.Point(60, 6); this.AddressBox.Location = new System.Drawing.Point(69, 6);
this.AddressBox.Name = "AddressBox"; this.AddressBox.Name = "AddressBox";
this.AddressBox.Size = new System.Drawing.Size(100, 20); this.AddressBox.Size = new System.Drawing.Size(100, 20);
this.AddressBox.TabIndex = 2; this.AddressBox.TabIndex = 2;
@ -79,7 +79,7 @@
// //
// NotesBox // NotesBox
// //
this.NotesBox.Location = new System.Drawing.Point(60, 33); this.NotesBox.Location = new System.Drawing.Point(69, 32);
this.NotesBox.Name = "NotesBox"; this.NotesBox.Name = "NotesBox";
this.NotesBox.Size = new System.Drawing.Size(100, 20); this.NotesBox.Size = new System.Drawing.Size(100, 20);
this.NotesBox.TabIndex = 3; this.NotesBox.TabIndex = 3;

View File

@ -103,8 +103,16 @@ namespace BizHawk.MultiClient
{ {
//Put user settings in the watch file //Put user settings in the watch file
userSelected = true; userSelected = true;
if (InputValidate.IsValidHexNumber(AddressBox.Text))
watch.address = int.Parse(AddressBox.Text, NumberStyles.HexNumber); watch.address = int.Parse(AddressBox.Text, NumberStyles.HexNumber);
else
{
MessageBox.Show("Not a valid address (enter a valid Hex number)", "Invalid Address", MessageBoxButtons.OK, MessageBoxIcon.Error);
AddressBox.Focus();
AddressBox.SelectAll();
return;
}
if (SignedRadio.Checked) if (SignedRadio.Checked)
watch.signed = asigned.SIGNED; watch.signed = asigned.SIGNED;