Allow Ram Search to open Ram Watch, fix so that calling those dialogs from the main menu doesn't create a new dialog if it is already open.

This commit is contained in:
andres.delikat 2011-02-18 18:42:28 +00:00
parent 0fafc2eb0e
commit 03d891cdf8
4 changed files with 36 additions and 11 deletions

View File

@ -21,8 +21,8 @@ namespace BizHawk.MultiClient
private bool wasPaused = false; //For handling automatic pausing when entering the menu private bool wasPaused = false; //For handling automatic pausing when entering the menu
private int FrameAdvanceDelay = 0; private int FrameAdvanceDelay = 0;
private bool EmulatorPaused = false; private bool EmulatorPaused = false;
RamWatch RamWatch1 = new RamWatch(); public RamWatch RamWatch1 = new RamWatch();
RamSearch RamSearch1 = new RamSearch(); public RamSearch RamSearch1 = new RamSearch();
public MainForm(string[] args) public MainForm(string[] args)
{ {
@ -1014,16 +1014,26 @@ namespace BizHawk.MultiClient
private void LoadRamWatch() private void LoadRamWatch()
{ {
RamWatch1 = new RamWatch(); if (!RamWatch1.IsHandleCreated || RamWatch1.IsDisposed)
if (Global.Config.AutoLoadRamWatch) {
RamWatch1.LoadWatchFromRecent(Global.Config.RecentWatches.GetRecentFileByPosition(0)); RamWatch1 = new RamWatch();
RamWatch1.Show(); if (Global.Config.AutoLoadRamWatch)
RamWatch1.LoadWatchFromRecent(Global.Config.RecentWatches.GetRecentFileByPosition(0));
RamWatch1.Show();
}
else
RamWatch1.Focus();
} }
private void LoadRamSearch() private void LoadRamSearch()
{ {
RamSearch1 = new RamSearch(); if (!RamSearch1.IsHandleCreated || RamSearch1.IsDisposed)
RamSearch1.Show(); {
RamSearch1 = new RamSearch();
RamSearch1.Show();
}
else
RamSearch1.Focus();
} }
private void RAMWatchToolStripMenuItem_Click(object sender, EventArgs e) private void RAMWatchToolStripMenuItem_Click(object sender, EventArgs e)

View File

@ -112,7 +112,7 @@
this.PoketoolStripButton1}); this.PoketoolStripButton1});
this.SearchtoolStrip1.Location = new System.Drawing.Point(3, 0); this.SearchtoolStrip1.Location = new System.Drawing.Point(3, 0);
this.SearchtoolStrip1.Name = "SearchtoolStrip1"; this.SearchtoolStrip1.Name = "SearchtoolStrip1";
this.SearchtoolStrip1.Size = new System.Drawing.Size(154, 25); this.SearchtoolStrip1.Size = new System.Drawing.Size(185, 25);
this.SearchtoolStrip1.TabIndex = 0; this.SearchtoolStrip1.TabIndex = 0;
this.SearchtoolStrip1.Text = "Search"; this.SearchtoolStrip1.Text = "Search";
// //
@ -170,6 +170,7 @@
this.WatchtoolStripButton1.Name = "WatchtoolStripButton1"; this.WatchtoolStripButton1.Name = "WatchtoolStripButton1";
this.WatchtoolStripButton1.Size = new System.Drawing.Size(23, 22); this.WatchtoolStripButton1.Size = new System.Drawing.Size(23, 22);
this.WatchtoolStripButton1.Text = "toolStripButton1"; this.WatchtoolStripButton1.Text = "toolStripButton1";
this.WatchtoolStripButton1.Click += new System.EventHandler(this.WatchtoolStripButton1_Click);
// //
// PoketoolStripButton1 // PoketoolStripButton1
// //

View File

@ -147,5 +147,19 @@ namespace BizHawk.MultiClient
else else
ModuloBox.Enabled = false; ModuloBox.Enabled = false;
} }
private void WatchtoolStripButton1_Click(object sender, EventArgs e)
{
//TODO: get listview watch object and feed to ram watch
//Global.MainForm.RamWatch1 = new RamWatch();
if (!Global.MainForm.RamWatch1.IsDisposed)
Global.MainForm.RamWatch1.Focus();
else
{
Global.MainForm.RamWatch1 = new RamWatch();
Global.MainForm.RamWatch1.Show();
}
}
} }
} }

View File

@ -181,10 +181,10 @@
nwacI1lUVWkeyyF/Ztx0hAeDn4DoHOCl5MsAfgEYXgCeMXCIZ2da+rI0jxXqQGH3JRGg4H3P1tlIkJ1E nwacI1lUVWkeyyF/Ztx0hAeDn4DoHOCl5MsAfgEYXgCeMXCIZ2da+rI0jxXqQGH3JRGg4H3P1tlIkJ1E
ySh5Q8JfgKuul6DcVDDgbn8+oHM8XzlCKUk4CT6QGLnRKwV0FAy4cutFwM+2e96xXbYtVhZl3ic4AeLE ySh5Q8JfgKuul6DcVDDgbn8+oHM8XzlCKUk4CT6QGLnRKwV0FAy4cutFwM+2e96xXbYtVhZl3ic4AeLE
ZOmeXzGgocF2wR5IYYB3IM4stj1F+DGkFZ/JoqLi+GjBEXJdh5oedTuemFsf4H4og+ccIfw138UYmUgJ ZOmeXzGgocF2wR5IYYB3IM4stj1F+DGkFZ/JoqLi+GjBEXJdh5oedTuemFsf4H4og+ccIfw138UYmUgJ
0NS1TlO2EvWyERYfVtq+eVQItR2BTqt9q1bXx863eYXr7lfoGp7AbcfrXLVKM0bJRmrJtp8Bi86Dkhwx 0NS1TlO2EvWyERYfVtq+eVQItR2BTqt9q1bXx863eYXr7lfoGp7AbfvrXLVKM0bJRmrJtp8Bi86Dkhwx
HoBDp8OpWnOCh+3kHLkoz3uNu0n+fKKc/5HEtuFVIWbaL8mNjfa5kpL1Lh6dJLvJFrKD7CRbyQayRpIX HoBDp8OpWnOCh+3kHLkoz3uNu0n+fKKc/5HEtuFVIWbaL8mNjfa5kpL1Lh6dJLvJFrKD7CRbyQayRpIX
3Idr4KleJiuV5b080pE9chUF919ZGr2v48RgwrwPzrN1UmVZ1vONvWStLC4Jvz8ZDAbPpXpRtqaVyrIe 3Idr4KleJiuV5b080pE9chUF919ZGr2v48RgwrwPzrN1UmVZ1vONvWStLC4Jvz8ZDAbPpXpRtqaVyrIe
nv+Q1/1TlsM2ypfSzF0rV/5v+Tuw9oIXhM1Q5QAAAABJRU5ErkJggg== nv+Q1/1TlsM2ypfSzF0rV/5v+TuvXYIWQgoMnAAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="ClearChangeCountstoolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ClearChangeCountstoolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">