New Ram Watch - implement new Search menu item

This commit is contained in:
adelikat 2013-09-05 14:48:54 +00:00
parent 05fc6d8dd3
commit 50b7d9b8c1
3 changed files with 40 additions and 12 deletions

View File

@ -323,12 +323,12 @@
//
// newListToolStripMenuItem
//
this.newListToolStripMenuItem.Enabled = false;
this.newListToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.NewFile;
this.newListToolStripMenuItem.Name = "newListToolStripMenuItem";
this.newListToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.newListToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.newListToolStripMenuItem.Text = "&New List";
this.newListToolStripMenuItem.Click += new System.EventHandler(this.newListToolStripMenuItem_Click);
//
// openToolStripMenuItem
//

View File

@ -14,6 +14,8 @@ namespace BizHawk.MultiClient
{
private WatchList Watches = new WatchList();
private string systemID = "NULL";
private string sortedCol = "";
private bool sortReverse = false;
public NewRamWatch()
{
@ -159,6 +161,25 @@ namespace BizHawk.MultiClient
MemDomainLabel.Text = systemID + " " + memoryDomain;
}
private void NewWatchList(bool suppressAsk)
{
bool result = true;
if (Watches.Changes)
{
result = AskSave();
}
if (result || suppressAsk)
{
Watches.Clear();
DisplayWatches();
UpdateWatchCount();
MessageLabel.Text = "";
sortReverse = false;
sortedCol = "";
}
}
#region Winform Events
private void NewRamWatch_Load(object sender, EventArgs e)
@ -166,17 +187,10 @@ namespace BizHawk.MultiClient
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!AskSave())
{
return;
}
else
{
Close();
}
}
private void newListToolStripMenuItem_Click(object sender, EventArgs e)
{
NewWatchList(false);
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
@ -201,6 +215,18 @@ namespace BizHawk.MultiClient
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!AskSave())
{
return;
}
else
{
Close();
}
}
#endregion
}
}

View File

@ -1210,6 +1210,8 @@ namespace BizHawk.MultiClient
public void Clear()
{
_watchList.Clear();
Changes = false;
_currentFilename = "";
}
public MemoryDomain Domain { get { return _domain; } set { _domain = value; } }