Ram Search - Hook up preview to radio dial changes, also better input validation on text boxes

This commit is contained in:
andres.delikat 2011-02-22 15:33:28 +00:00
parent 2498342849
commit d0b99ce07a
2 changed files with 27 additions and 2 deletions

View File

@ -135,7 +135,7 @@
this.PoketoolStripButton1});
this.SearchtoolStrip1.Location = new System.Drawing.Point(3, 0);
this.SearchtoolStrip1.Name = "SearchtoolStrip1";
this.SearchtoolStrip1.Size = new System.Drawing.Size(162, 25);
this.SearchtoolStrip1.Size = new System.Drawing.Size(131, 25);
this.SearchtoolStrip1.TabIndex = 0;
this.SearchtoolStrip1.Text = "Search";
//
@ -845,6 +845,7 @@
this.NotEqualToRadio.TabIndex = 5;
this.NotEqualToRadio.Text = "Not Equal To";
this.NotEqualToRadio.UseVisualStyleBackColor = true;
this.NotEqualToRadio.CheckedChanged += new System.EventHandler(this.LessThanRadio_CheckedChanged);
//
// EqualToRadio
//
@ -855,6 +856,7 @@
this.EqualToRadio.TabIndex = 4;
this.EqualToRadio.Text = "Equal To";
this.EqualToRadio.UseVisualStyleBackColor = true;
this.EqualToRadio.CheckedChanged += new System.EventHandler(this.LessThanRadio_CheckedChanged);
//
// GreaterThanOrEqualToRadio
//
@ -865,6 +867,7 @@
this.GreaterThanOrEqualToRadio.TabIndex = 3;
this.GreaterThanOrEqualToRadio.Text = "Greater Than or Equal To";
this.GreaterThanOrEqualToRadio.UseVisualStyleBackColor = true;
this.GreaterThanOrEqualToRadio.CheckedChanged += new System.EventHandler(this.LessThanRadio_CheckedChanged);
//
// LessThanOrEqualToRadio
//
@ -875,6 +878,7 @@
this.LessThanOrEqualToRadio.TabIndex = 2;
this.LessThanOrEqualToRadio.Text = "Less Than or Equal To";
this.LessThanOrEqualToRadio.UseVisualStyleBackColor = true;
this.LessThanOrEqualToRadio.CheckedChanged += new System.EventHandler(this.LessThanRadio_CheckedChanged);
//
// GreaterThanRadio
//
@ -885,6 +889,7 @@
this.GreaterThanRadio.TabIndex = 1;
this.GreaterThanRadio.Text = "Greater Than";
this.GreaterThanRadio.UseVisualStyleBackColor = true;
this.GreaterThanRadio.CheckedChanged += new System.EventHandler(this.LessThanRadio_CheckedChanged);
//
// LessThanRadio
//
@ -897,6 +902,7 @@
this.LessThanRadio.TabStop = true;
this.LessThanRadio.Text = "Less Than";
this.LessThanRadio.UseVisualStyleBackColor = true;
this.LessThanRadio.CheckedChanged += new System.EventHandler(this.LessThanRadio_CheckedChanged);
//
// AutoSearchCheckBox
//

View File

@ -18,7 +18,9 @@ namespace BizHawk.MultiClient
{
//TODO:
//Window position gets saved but doesn't load properly
//Implement Preview search
//Implement Preview search each frame (perhaps if autosearch is not on?)
//Refactor preview search to use prevList
//Add Preview toggle to options menu
//Implement definitions of Previous value
//Multiple memory domains
//Option to remove current Ram Watch list from search list
@ -135,6 +137,7 @@ namespace BizHawk.MultiClient
{
if (SpecificValueRadio.Checked)
{
if (SpecificValueBox.Text == "") SpecificValueBox.Text = "0";
SpecificValueBox.Enabled = true;
SpecificAddressBox.Enabled = false;
NumberOfChangesBox.Enabled = false;
@ -157,6 +160,7 @@ namespace BizHawk.MultiClient
{
if (SpecificAddressRadio.Checked)
{
if (SpecificAddressBox.Text == "") SpecificAddressBox.Text = "0";
SpecificValueBox.Enabled = false;
SpecificAddressBox.Enabled = true;
NumberOfChangesBox.Enabled = false;
@ -169,6 +173,7 @@ namespace BizHawk.MultiClient
{
if (NumberOfChangesRadio.Checked)
{
if (NumberOfChangesBox.Text == "") NumberOfChangesBox.Text = "0";
SpecificValueBox.Enabled = false;
SpecificAddressBox.Enabled = false;
NumberOfChangesBox.Enabled = true;
@ -180,7 +185,11 @@ namespace BizHawk.MultiClient
private void DifferentByRadio_CheckedChanged(object sender, EventArgs e)
{
if (DifferentByRadio.Checked)
{
if (DifferentByBox.Text == "0") DifferentByBox.Text = "0";
DifferentByBox.Enabled = true;
DoPreview();
}
else
DifferentByBox.Enabled = false;
DifferentByBox.Focus();
@ -505,6 +514,7 @@ namespace BizHawk.MultiClient
private void DoPreview()
{
weededList.Clear(); //TODO: use previewList to avoid having to clear this!
if (GenerateWeedOutList())
{
DisplaySearchList();
@ -717,6 +727,7 @@ namespace BizHawk.MultiClient
private int GetSpecificValue()
{
if (SpecificValueBox.Text == "") return 0;
bool i = InputValidate.IsValidSignedNumber(SpecificValueBox.Text);
if (!i) return -1;
@ -725,6 +736,7 @@ namespace BizHawk.MultiClient
private int GetSpecificAddress()
{
if (SpecificAddressBox.Text == "") return 0;
bool i = InputValidate.IsValidHexNumber(SpecificAddressBox.Text);
if (!i) return -1;
@ -733,6 +745,7 @@ namespace BizHawk.MultiClient
private int GetDifferentBy()
{
if (DifferentByBox.Text == "") return 0;
bool i = InputValidate.IsValidUnsignedNumber(DifferentByBox.Text);
if (!i)
{
@ -816,6 +829,7 @@ namespace BizHawk.MultiClient
private int GetSpecificChanges()
{
if (NumberOfChangesBox.Text == "") return 0;
bool i = InputValidate.IsValidUnsignedNumber(NumberOfChangesBox.Text);
if (!i) return -1;
@ -1357,6 +1371,11 @@ namespace BizHawk.MultiClient
break;
}
}
private void LessThanRadio_CheckedChanged(object sender, EventArgs e)
{
if (!DifferentByRadio.Checked) DoPreview();
}
}