Better input validation on Ram Watch - New Watch Dialog
This commit is contained in:
parent
f9256f5cd1
commit
52dbff1606
|
@ -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?
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
//
|
//
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue