Better input validation on Ram Watch - New Watch Dialog

This commit is contained in:
andres.delikat 2011-03-20 01:25:11 +00:00
parent f9256f5cd1
commit 52dbff1606
3 changed files with 9 additions and 2 deletions

View File

@ -17,7 +17,6 @@ namespace BizHawk.MultiClient
public partial class RamWatch : Form public partial class RamWatch : Form
{ {
//TODO: //TODO:
//address num digits based on domain size
//Restore window size should restore column order as well //Restore window size should restore column order as well
//When receiving a watch from a different domain, should something be done? //When receiving a watch from a different domain, should something be done?

View File

@ -79,6 +79,7 @@
this.AddressBox.TabIndex = 2; this.AddressBox.TabIndex = 2;
this.AddressBox.Text = "00000000"; this.AddressBox.Text = "00000000";
this.AddressBox.Leave += new System.EventHandler(this.AddressBox_Leave); this.AddressBox.Leave += new System.EventHandler(this.AddressBox_Leave);
this.AddressBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.AddressBox_KeyPress);
// //
// NotesBox // NotesBox
// //

View File

@ -12,7 +12,6 @@ namespace BizHawk.MultiClient
{ {
public partial class RamWatchNewWatch : Form public partial class RamWatchNewWatch : Form
{ {
//TODO: better input validation - Like Ram Search
public Watch watch = new Watch(); public Watch watch = new Watch();
public bool userSelected = false; public bool userSelected = false;
public bool customSetup = false; public bool customSetup = false;
@ -152,5 +151,13 @@ namespace BizHawk.MultiClient
t.Show("MUst be a valid hexadecimal vaue", AddressBox, 5000); t.Show("MUst be a valid hexadecimal vaue", AddressBox, 5000);
} }
} }
private void AddressBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\b') return;
if (!InputValidate.IsValidHexNumber(e.KeyChar))
e.Handled = true;
}
} }
} }