Rip out obsolete notion of a WatchList domain, change ram watch menu item to Default Domain, who's functionality is simply to decide the default domain used when adding a new watch, also add some Visual Studio designer shenanigans for a previous commit I made that broke it

This commit is contained in:
adelikat 2016-01-30 22:17:31 -05:00
parent 5ddd9e097b
commit 0013646db5
9 changed files with 108 additions and 169 deletions

View File

@ -42,7 +42,6 @@ namespace BizHawk.Client.Common
private static IMemoryDomains _memoryDomains;
private List<Watch> _watchList = new List<Watch>(0);
private MemoryDomain _domain;
private string _currentFilename = string.Empty;
private string _systemid;
@ -50,24 +49,6 @@ namespace BizHawk.Client.Common
#region cTor(s)
/// <summary>
/// Initialize a new instance of <see cref="WatchList"/> that will
/// contains a set of <see cref="Watch"/>
/// </summary>
/// <param name="core">All available memomry domains</param>
/// <param name="domain">Domain you want to watch</param>
/// <param name="systemid">System identifier (NES, SNES, ...)</param>
[Obsolete("Use the constructor with two parameters instead")]
public WatchList(IMemoryDomains core, MemoryDomain domain, string systemid)
{
if (_memoryDomains == null)
{
_memoryDomains = core;
}
_domain = domain;
_systemid = systemid;
}
/// <summary>
/// Initialize a new instance of <see cref="WatchList"/> that will
/// contains a set of <see cref="Watch"/>
@ -81,8 +62,7 @@ namespace BizHawk.Client.Common
{
_memoryDomains = core;
}
//TODO: Remove this after tests
_domain = core.MainMemory;
_systemid = systemid;
}
@ -370,19 +350,6 @@ namespace BizHawk.Client.Common
});
}
public string AddressFormatStr // TODO: this is probably compensating for not using the ToHex string extension
{
get
{
if (_domain != null)
{
return "{0:X" + (_domain.Size - 1).NumHexDigits() + "}";
}
return string.Empty;
}
}
#endregion
#region Propeties
@ -468,38 +435,6 @@ namespace BizHawk.Client.Common
#endregion
[Obsolete("Use the method with single parameter instead")]
public void RefreshDomains(IMemoryDomains core, MemoryDomain domain)
{
_memoryDomains = core;
_domain = domain;
_watchList.ForEach(w =>
{
if (w.Domain != null)
{
w.Domain = _memoryDomains[w.Domain.Name];
}
});
}
[Obsolete("Use domain from individual watch instead")]
public MemoryDomain Domain
{
get { return _domain; }
set { _domain = value; }
}
[Obsolete("Use count property instead", true)]
public int ItemCount
{
get
{
return Count;
}
}
#region File handling logic - probably needs to be its own class
public bool Load(string path, bool append)
@ -541,9 +476,7 @@ namespace BizHawk.Client.Common
using (var sw = new StreamWriter(CurrentFileName))
{
var sb = new StringBuilder();
sb
.Append("Domain ").AppendLine(_domain.Name)
.Append("SystemID ").AppendLine(_systemid);
sb.Append("SystemID ").AppendLine(_systemid);
foreach (var watch in _watchList)
{
@ -570,7 +503,6 @@ namespace BizHawk.Client.Common
private bool LoadFile(string path, bool append)
{
var domain = string.Empty;
var file = new FileInfo(path);
if (file.Exists == false)
{
@ -600,7 +532,6 @@ namespace BizHawk.Client.Common
if (line.Length >= 6 && line.Substring(0, 6) == "Domain")
{
domain = line.Substring(7, line.Length - 7);
isBizHawkWatch = true;
}
@ -687,10 +618,8 @@ namespace BizHawk.Client.Common
type,
bigEndian,
notes));
_domain = _memoryDomains[domain];
}
Domain = _memoryDomains[domain] ?? _memoryDomains.MainMemory;
_currentFilename = path;
}

View File

@ -825,7 +825,7 @@
this.Text = "Lua Console";
this.Load += new System.EventHandler(this.LuaConsole_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LuaConsole_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GenericDragEnter);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);
this.ScriptListContextMenu.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();

View File

@ -1240,6 +1240,12 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.DisplayManager.ClearLuaSurfaces();
}
// Stupid designer
protected void DragEnterWrapper(object sender, DragEventArgs e)
{
base.GenericDragEnter(sender, e);
}
#endregion
}
}

View File

@ -1526,7 +1526,7 @@ namespace BizHawk.Client.EmuHawk
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Tastudio_Closing);
this.Load += new System.EventHandler(this.Tastudio_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.TAStudio_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GenericDragEnter);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TAStudio_KeyDown);
this.MouseLeave += new System.EventHandler(this.TAStudio_MouseLeave);
this.TASMenu.ResumeLayout(false);

View File

@ -965,5 +965,11 @@ namespace BizHawk.Client.EmuHawk
{
IsInMenuLoop = false;
}
// Stupid designer
protected void DragEnterWrapper(object sender, DragEventArgs e)
{
base.GenericDragEnter(sender, e);
}
}
}

View File

@ -214,7 +214,7 @@
this.WatchListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.WatchListView_ColumnClick);
this.WatchListView.SelectedIndexChanged += new System.EventHandler(this.WatchListView_SelectedIndexChanged);
this.WatchListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamSearch_DragDrop);
this.WatchListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.GenericDragEnter);
this.WatchListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);
this.WatchListView.Enter += new System.EventHandler(this.WatchListView_Enter);
this.WatchListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown);
this.WatchListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.WatchListView_MouseDoubleClick);
@ -1399,7 +1399,7 @@
this.Activated += new System.EventHandler(this.NewRamSearch_Activated);
this.Load += new System.EventHandler(this.RamSearch_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamSearch_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GenericDragEnter);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);
this.ListViewContextMenu.ResumeLayout(false);
this.RamSearchMenu.ResumeLayout(false);
this.RamSearchMenu.PerformLayout();

View File

@ -821,7 +821,7 @@ namespace BizHawk.Client.EmuHawk
_currentFileName = file.FullName;
}
var watches = new WatchList(MemoryDomains, _settings.Domain, Emu.SystemId);
var watches = new WatchList(MemoryDomains, Emu.SystemId);
watches.Load(file.FullName, append);
Settings.RecentSearches.Add(watches.CurrentFileName);
@ -1003,7 +1003,7 @@ namespace BizHawk.Client.EmuHawk
{
if (!string.IsNullOrWhiteSpace(_currentFileName))
{
var watches = new WatchList(MemoryDomains, _settings.Domain, Emu.SystemId) { CurrentFileName = _currentFileName };
var watches = new WatchList(MemoryDomains, Emu.SystemId) { CurrentFileName = _currentFileName };
for (var i = 0; i < _searches.Count; i++)
{
watches.Add(_searches[i]);
@ -1020,7 +1020,7 @@ namespace BizHawk.Client.EmuHawk
}
else
{
var result = watches.SaveAs(ToolFormBase.GetWatchSaveFileFromUser(watches.CurrentFileName));
var result = watches.SaveAs(GetWatchSaveFileFromUser(watches.CurrentFileName));
if (result)
{
MessageLabel.Text = Path.GetFileName(_currentFileName) + " saved";
@ -1032,13 +1032,13 @@ namespace BizHawk.Client.EmuHawk
private void SaveAsMenuItem_Click(object sender, EventArgs e)
{
var watches = new WatchList(MemoryDomains, _settings.Domain, Emu.SystemId) { CurrentFileName = _currentFileName };
var watches = new WatchList(MemoryDomains, Emu.SystemId) { CurrentFileName = _currentFileName };
for (var i = 0; i < _searches.Count; i++)
{
watches.Add(_searches[i]);
}
if (watches.SaveAs(ToolFormBase.GetWatchSaveFileFromUser(watches.CurrentFileName)))
if (watches.SaveAs(GetWatchSaveFileFromUser(watches.CurrentFileName)))
{
_currentFileName = watches.CurrentFileName;
MessageLabel.Text = Path.GetFileName(_currentFileName) + " saved";
@ -1792,6 +1792,12 @@ namespace BizHawk.Client.EmuHawk
base.OnShown(e);
}
// Stupid designer
protected void DragEnterWrapper(object sender, DragEventArgs e)
{
base.GenericDragEnter(sender, e);
}
#endregion
#endregion

View File

@ -31,7 +31,6 @@
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RamWatch));
this.WatchCountLabel = new System.Windows.Forms.Label();
this.MemDomainLabel = new System.Windows.Forms.Label();
this.ListViewContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.EditContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -132,16 +131,6 @@
this.WatchCountLabel.TabIndex = 5;
this.WatchCountLabel.Text = "0 watches";
//
// MemDomainLabel
//
this.MemDomainLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.MemDomainLabel.AutoSize = true;
this.MemDomainLabel.Location = new System.Drawing.Point(221, 57);
this.MemDomainLabel.Name = "MemDomainLabel";
this.MemDomainLabel.Size = new System.Drawing.Size(127, 13);
this.MemDomainLabel.TabIndex = 7;
this.MemDomainLabel.Text = " ";
//
// ListViewContextMenu
//
this.ListViewContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -161,14 +150,14 @@
this.MoveUpContextMenuItem,
this.MoveDownContextMenuItem});
this.ListViewContextMenu.Name = "contextMenuStrip1";
this.ListViewContextMenu.Size = new System.Drawing.Size(191, 324);
this.ListViewContextMenu.Size = new System.Drawing.Size(204, 302);
this.ListViewContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ListViewContextMenu_Opening);
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.addWatch;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.newToolStripMenuItem.Size = new System.Drawing.Size(203, 22);
this.newToolStripMenuItem.Text = "&New Watch";
this.newToolStripMenuItem.Click += new System.EventHandler(this.NewWatchMenuItem_Click);
//
@ -177,7 +166,7 @@
this.EditContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS;
this.EditContextMenuItem.Name = "EditContextMenuItem";
this.EditContextMenuItem.ShortcutKeyDisplayString = "Ctrl+E";
this.EditContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.EditContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.EditContextMenuItem.Text = "&Edit";
this.EditContextMenuItem.Click += new System.EventHandler(this.EditWatchMenuItem_Click);
//
@ -186,7 +175,7 @@
this.RemoveContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
this.RemoveContextMenuItem.Name = "RemoveContextMenuItem";
this.RemoveContextMenuItem.ShortcutKeyDisplayString = "Ctrl+R";
this.RemoveContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.RemoveContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.RemoveContextMenuItem.Text = "&Remove";
this.RemoveContextMenuItem.Click += new System.EventHandler(this.RemoveWatchMenuItem_Click);
//
@ -195,7 +184,7 @@
this.DuplicateContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate;
this.DuplicateContextMenuItem.Name = "DuplicateContextMenuItem";
this.DuplicateContextMenuItem.ShortcutKeyDisplayString = "Ctrl+D";
this.DuplicateContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.DuplicateContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.DuplicateContextMenuItem.Text = "&Duplicate";
this.DuplicateContextMenuItem.Click += new System.EventHandler(this.DuplicateWatchMenuItem_Click);
//
@ -204,7 +193,7 @@
this.PokeContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke;
this.PokeContextMenuItem.Name = "PokeContextMenuItem";
this.PokeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+P";
this.PokeContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.PokeContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.PokeContextMenuItem.Text = "&Poke";
this.PokeContextMenuItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click);
//
@ -213,7 +202,7 @@
this.FreezeContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze;
this.FreezeContextMenuItem.Name = "FreezeContextMenuItem";
this.FreezeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+F";
this.FreezeContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.FreezeContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.FreezeContextMenuItem.Text = "&Freeze";
this.FreezeContextMenuItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click);
//
@ -221,47 +210,47 @@
//
this.UnfreezeAllContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Unfreeze;
this.UnfreezeAllContextMenuItem.Name = "UnfreezeAllContextMenuItem";
this.UnfreezeAllContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.UnfreezeAllContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.UnfreezeAllContextMenuItem.Text = "Unfreeze &All";
this.UnfreezeAllContextMenuItem.Click += new System.EventHandler(this.UnfreezeAllContextMenuItem_Click);
//
// ViewInHexEditorContextMenuItem
//
this.ViewInHexEditorContextMenuItem.Name = "ViewInHexEditorContextMenuItem";
this.ViewInHexEditorContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.ViewInHexEditorContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ViewInHexEditorContextMenuItem.Text = "View in Hex Editor";
this.ViewInHexEditorContextMenuItem.Click += new System.EventHandler(this.ViewInHexEditorContextMenuItem_Click);
//
// Separator4
//
this.Separator4.Name = "Separator4";
this.Separator4.Size = new System.Drawing.Size(187, 6);
this.Separator4.Size = new System.Drawing.Size(200, 6);
//
// ReadBreakpointContextMenuItem
//
this.ReadBreakpointContextMenuItem.Name = "ReadBreakpointContextMenuItem";
this.ReadBreakpointContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.ReadBreakpointContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ReadBreakpointContextMenuItem.Text = "Set Read Breakpoint";
this.ReadBreakpointContextMenuItem.Click += new System.EventHandler(this.ReadBreakpointContextMenuItem_Click);
//
// WriteBreakpointContextMenuItem
//
this.WriteBreakpointContextMenuItem.Name = "WriteBreakpointContextMenuItem";
this.WriteBreakpointContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.WriteBreakpointContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.WriteBreakpointContextMenuItem.Text = "Set Write Breakpoint";
this.WriteBreakpointContextMenuItem.Click += new System.EventHandler(this.WriteBreakpointContextMenuItem_Click);
//
// Separator6
//
this.Separator6.Name = "Separator6";
this.Separator6.Size = new System.Drawing.Size(187, 6);
this.Separator6.Size = new System.Drawing.Size(200, 6);
//
// InsertSeperatorContextMenuItem
//
this.InsertSeperatorContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator;
this.InsertSeperatorContextMenuItem.Name = "InsertSeperatorContextMenuItem";
this.InsertSeperatorContextMenuItem.ShortcutKeyDisplayString = "Ctrl+I";
this.InsertSeperatorContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.InsertSeperatorContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.InsertSeperatorContextMenuItem.Text = "&Insert Separator";
this.InsertSeperatorContextMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
@ -270,7 +259,7 @@
this.MoveUpContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp;
this.MoveUpContextMenuItem.Name = "MoveUpContextMenuItem";
this.MoveUpContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Up";
this.MoveUpContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.MoveUpContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.MoveUpContextMenuItem.Text = "Move &Up";
this.MoveUpContextMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click);
//
@ -279,7 +268,7 @@
this.MoveDownContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown;
this.MoveDownContextMenuItem.Name = "MoveDownContextMenuItem";
this.MoveDownContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Down";
this.MoveDownContextMenuItem.Size = new System.Drawing.Size(190, 22);
this.MoveDownContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.MoveDownContextMenuItem.Text = "Move &Down";
this.MoveDownContextMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click);
//
@ -525,7 +514,7 @@
this.toolStripSeparator1,
this.ExitMenuItem});
this.FileSubMenu.Name = "FileSubMenu";
this.FileSubMenu.Size = new System.Drawing.Size(40, 20);
this.FileSubMenu.Size = new System.Drawing.Size(42, 20);
this.FileSubMenu.Text = "&Files";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
//
@ -534,7 +523,7 @@
this.NewListMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile;
this.NewListMenuItem.Name = "NewListMenuItem";
this.NewListMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewListMenuItem.Size = new System.Drawing.Size(193, 22);
this.NewListMenuItem.Size = new System.Drawing.Size(195, 22);
this.NewListMenuItem.Text = "&New List";
this.NewListMenuItem.Click += new System.EventHandler(this.NewListMenuItem_Click);
//
@ -543,7 +532,7 @@
this.OpenMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile;
this.OpenMenuItem.Name = "OpenMenuItem";
this.OpenMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenMenuItem.Size = new System.Drawing.Size(193, 22);
this.OpenMenuItem.Size = new System.Drawing.Size(195, 22);
this.OpenMenuItem.Text = "&Open...";
this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click);
//
@ -552,7 +541,7 @@
this.SaveMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs;
this.SaveMenuItem.Name = "SaveMenuItem";
this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveMenuItem.Size = new System.Drawing.Size(195, 22);
this.SaveMenuItem.Text = "&Save";
this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click);
//
@ -561,14 +550,14 @@
this.SaveAsMenuItem.Name = "SaveAsMenuItem";
this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S)));
this.SaveAsMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveAsMenuItem.Size = new System.Drawing.Size(195, 22);
this.SaveAsMenuItem.Text = "Save &As...";
this.SaveAsMenuItem.Click += new System.EventHandler(this.SaveAsMenuItem_Click);
//
// AppendMenuItem
//
this.AppendMenuItem.Name = "AppendMenuItem";
this.AppendMenuItem.Size = new System.Drawing.Size(193, 22);
this.AppendMenuItem.Size = new System.Drawing.Size(195, 22);
this.AppendMenuItem.Text = "A&ppend File...";
this.AppendMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click);
//
@ -578,26 +567,26 @@
this.noneToolStripMenuItem});
this.RecentSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
this.RecentSubMenu.Name = "RecentSubMenu";
this.RecentSubMenu.Size = new System.Drawing.Size(193, 22);
this.RecentSubMenu.Size = new System.Drawing.Size(195, 22);
this.RecentSubMenu.Text = "Recent";
this.RecentSubMenu.DropDownOpened += new System.EventHandler(this.RecentSubMenu_DropDownOpened);
//
// noneToolStripMenuItem
//
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
this.noneToolStripMenuItem.Size = new System.Drawing.Size(99, 22);
this.noneToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
this.noneToolStripMenuItem.Text = "None";
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(190, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(192, 6);
//
// ExitMenuItem
//
this.ExitMenuItem.Name = "ExitMenuItem";
this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.ExitMenuItem.Size = new System.Drawing.Size(193, 22);
this.ExitMenuItem.Size = new System.Drawing.Size(195, 22);
this.ExitMenuItem.Text = "&Close";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
@ -621,7 +610,7 @@
this.toolStripSeparator2,
this.PauseMenuItem});
this.WatchesSubMenu.Name = "WatchesSubMenu";
this.WatchesSubMenu.Size = new System.Drawing.Size(61, 20);
this.WatchesSubMenu.Size = new System.Drawing.Size(64, 20);
this.WatchesSubMenu.Text = "&Watches";
this.WatchesSubMenu.DropDownOpened += new System.EventHandler(this.WatchesSubMenu_DropDownOpened);
//
@ -630,26 +619,26 @@
this.MemoryDomainsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.Separator2});
this.MemoryDomainsSubMenu.Name = "MemoryDomainsSubMenu";
this.MemoryDomainsSubMenu.Size = new System.Drawing.Size(211, 22);
this.MemoryDomainsSubMenu.Text = "Memory Domains";
this.MemoryDomainsSubMenu.Size = new System.Drawing.Size(224, 22);
this.MemoryDomainsSubMenu.Text = "Default Domain";
this.MemoryDomainsSubMenu.DropDownOpened += new System.EventHandler(this.MemoryDomainsSubMenu_DropDownOpened);
//
// Separator2
//
this.Separator2.Name = "Separator2";
this.Separator2.Size = new System.Drawing.Size(57, 6);
this.Separator2.Size = new System.Drawing.Size(149, 6);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(208, 6);
this.toolStripSeparator8.Size = new System.Drawing.Size(221, 6);
//
// NewWatchMenuItem
//
this.NewWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.FindHS;
this.NewWatchMenuItem.Name = "NewWatchMenuItem";
this.NewWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W)));
this.NewWatchMenuItem.Size = new System.Drawing.Size(211, 22);
this.NewWatchMenuItem.Size = new System.Drawing.Size(224, 22);
this.NewWatchMenuItem.Text = "&New Watch";
this.NewWatchMenuItem.Click += new System.EventHandler(this.NewWatchMenuItem_Click);
//
@ -658,7 +647,7 @@
this.EditWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS;
this.EditWatchMenuItem.Name = "EditWatchMenuItem";
this.EditWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.EditWatchMenuItem.Size = new System.Drawing.Size(211, 22);
this.EditWatchMenuItem.Size = new System.Drawing.Size(224, 22);
this.EditWatchMenuItem.Text = "&Edit Watch";
this.EditWatchMenuItem.Click += new System.EventHandler(this.EditWatchMenuItem_Click);
//
@ -667,7 +656,7 @@
this.RemoveWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
this.RemoveWatchMenuItem.Name = "RemoveWatchMenuItem";
this.RemoveWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R)));
this.RemoveWatchMenuItem.Size = new System.Drawing.Size(211, 22);
this.RemoveWatchMenuItem.Size = new System.Drawing.Size(224, 22);
this.RemoveWatchMenuItem.Text = "&Remove Watch";
this.RemoveWatchMenuItem.Click += new System.EventHandler(this.RemoveWatchMenuItem_Click);
//
@ -676,7 +665,7 @@
this.DuplicateWatchMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate;
this.DuplicateWatchMenuItem.Name = "DuplicateWatchMenuItem";
this.DuplicateWatchMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
this.DuplicateWatchMenuItem.Size = new System.Drawing.Size(211, 22);
this.DuplicateWatchMenuItem.Size = new System.Drawing.Size(224, 22);
this.DuplicateWatchMenuItem.Text = "&Duplicate Watch";
this.DuplicateWatchMenuItem.Click += new System.EventHandler(this.DuplicateWatchMenuItem_Click);
//
@ -685,7 +674,7 @@
this.PokeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.poke;
this.PokeAddressMenuItem.Name = "PokeAddressMenuItem";
this.PokeAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
this.PokeAddressMenuItem.Size = new System.Drawing.Size(211, 22);
this.PokeAddressMenuItem.Size = new System.Drawing.Size(224, 22);
this.PokeAddressMenuItem.Text = "Poke Address";
this.PokeAddressMenuItem.Click += new System.EventHandler(this.PokeAddressMenuItem_Click);
//
@ -694,7 +683,7 @@
this.FreezeAddressMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Freeze;
this.FreezeAddressMenuItem.Name = "FreezeAddressMenuItem";
this.FreezeAddressMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.FreezeAddressMenuItem.Size = new System.Drawing.Size(211, 22);
this.FreezeAddressMenuItem.Size = new System.Drawing.Size(224, 22);
this.FreezeAddressMenuItem.Text = "Freeze Address";
this.FreezeAddressMenuItem.Click += new System.EventHandler(this.FreezeAddressMenuItem_Click);
//
@ -703,7 +692,7 @@
this.InsertSeparatorMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator;
this.InsertSeparatorMenuItem.Name = "InsertSeparatorMenuItem";
this.InsertSeparatorMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(211, 22);
this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(224, 22);
this.InsertSeparatorMenuItem.Text = "Insert Separator";
this.InsertSeparatorMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
@ -711,21 +700,21 @@
//
this.ClearChangeCountsMenuItem.Name = "ClearChangeCountsMenuItem";
this.ClearChangeCountsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.C)));
this.ClearChangeCountsMenuItem.Size = new System.Drawing.Size(211, 22);
this.ClearChangeCountsMenuItem.Size = new System.Drawing.Size(224, 22);
this.ClearChangeCountsMenuItem.Text = "&Clear Change Counts";
this.ClearChangeCountsMenuItem.Click += new System.EventHandler(this.ClearChangeCountsMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(208, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(221, 6);
//
// MoveUpMenuItem
//
this.MoveUpMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp;
this.MoveUpMenuItem.Name = "MoveUpMenuItem";
this.MoveUpMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Up)));
this.MoveUpMenuItem.Size = new System.Drawing.Size(211, 22);
this.MoveUpMenuItem.Size = new System.Drawing.Size(224, 22);
this.MoveUpMenuItem.Text = "Move &Up";
this.MoveUpMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click);
//
@ -734,7 +723,7 @@
this.MoveDownMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown;
this.MoveDownMenuItem.Name = "MoveDownMenuItem";
this.MoveDownMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Down)));
this.MoveDownMenuItem.Size = new System.Drawing.Size(211, 22);
this.MoveDownMenuItem.Size = new System.Drawing.Size(224, 22);
this.MoveDownMenuItem.Text = "Move &Down";
this.MoveDownMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click);
//
@ -742,20 +731,20 @@
//
this.SelectAllMenuItem.Name = "SelectAllMenuItem";
this.SelectAllMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
this.SelectAllMenuItem.Size = new System.Drawing.Size(211, 22);
this.SelectAllMenuItem.Size = new System.Drawing.Size(224, 22);
this.SelectAllMenuItem.Text = "Select &All";
this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(208, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(221, 6);
//
// PauseMenuItem
//
this.PauseMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause;
this.PauseMenuItem.Name = "PauseMenuItem";
this.PauseMenuItem.Size = new System.Drawing.Size(211, 22);
this.PauseMenuItem.Size = new System.Drawing.Size(224, 22);
this.PauseMenuItem.Text = "&Pause";
this.PauseMenuItem.Click += new System.EventHandler(this.PauseMenuItem_Click);
//
@ -770,7 +759,7 @@
this.toolStripSeparator7,
this.RestoreWindowSizeMenuItem});
this.OptionsSubMenu.Name = "OptionsSubMenu";
this.OptionsSubMenu.Size = new System.Drawing.Size(56, 20);
this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20);
this.OptionsSubMenu.Text = "&Options";
this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened);
//
@ -781,68 +770,68 @@
this.LastChangeMenuItem,
this.OriginalMenuItem});
this.DefinePreviousValueSubMenu.Name = "DefinePreviousValueSubMenu";
this.DefinePreviousValueSubMenu.Size = new System.Drawing.Size(206, 22);
this.DefinePreviousValueSubMenu.Size = new System.Drawing.Size(217, 22);
this.DefinePreviousValueSubMenu.Text = "Define Previous Value";
this.DefinePreviousValueSubMenu.DropDownOpened += new System.EventHandler(this.DefinePreviousValueSubMenu_DropDownOpened);
//
// PreviousFrameMenuItem
//
this.PreviousFrameMenuItem.Name = "PreviousFrameMenuItem";
this.PreviousFrameMenuItem.Size = new System.Drawing.Size(148, 22);
this.PreviousFrameMenuItem.Size = new System.Drawing.Size(155, 22);
this.PreviousFrameMenuItem.Text = "Previous Frame";
this.PreviousFrameMenuItem.Click += new System.EventHandler(this.PreviousFrameMenuItem_Click);
//
// LastChangeMenuItem
//
this.LastChangeMenuItem.Name = "LastChangeMenuItem";
this.LastChangeMenuItem.Size = new System.Drawing.Size(148, 22);
this.LastChangeMenuItem.Size = new System.Drawing.Size(155, 22);
this.LastChangeMenuItem.Text = "Last Change";
this.LastChangeMenuItem.Click += new System.EventHandler(this.LastChangeMenuItem_Click);
//
// OriginalMenuItem
//
this.OriginalMenuItem.Name = "OriginalMenuItem";
this.OriginalMenuItem.Size = new System.Drawing.Size(148, 22);
this.OriginalMenuItem.Size = new System.Drawing.Size(155, 22);
this.OriginalMenuItem.Text = "&Original";
this.OriginalMenuItem.Click += new System.EventHandler(this.OriginalMenuItem_Click);
//
// WatchesOnScreenMenuItem
//
this.WatchesOnScreenMenuItem.Name = "WatchesOnScreenMenuItem";
this.WatchesOnScreenMenuItem.Size = new System.Drawing.Size(206, 22);
this.WatchesOnScreenMenuItem.Size = new System.Drawing.Size(217, 22);
this.WatchesOnScreenMenuItem.Text = "Display Watches On Screen";
this.WatchesOnScreenMenuItem.Click += new System.EventHandler(this.WatchesOnScreenMenuItem_Click);
//
// SaveWindowPositionMenuItem
//
this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem";
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(206, 22);
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(217, 22);
this.SaveWindowPositionMenuItem.Text = "Save Window Position";
this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click);
//
// AlwaysOnTopMenuItem
//
this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(206, 22);
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(217, 22);
this.AlwaysOnTopMenuItem.Text = "&Always On Top";
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
//
// FloatingWindowMenuItem
//
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(206, 22);
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(217, 22);
this.FloatingWindowMenuItem.Text = "&Floating Window";
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(203, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(214, 6);
//
// RestoreWindowSizeMenuItem
//
this.RestoreWindowSizeMenuItem.Name = "RestoreWindowSizeMenuItem";
this.RestoreWindowSizeMenuItem.Size = new System.Drawing.Size(206, 22);
this.RestoreWindowSizeMenuItem.Size = new System.Drawing.Size(217, 22);
this.RestoreWindowSizeMenuItem.Text = "Restore Default Settings";
this.RestoreWindowSizeMenuItem.Click += new System.EventHandler(this.RestoreDefaultsMenuItem_Click);
//
@ -881,7 +870,7 @@
this.WatchListView.SelectedIndexChanged += new System.EventHandler(this.WatchListView_SelectedIndexChanged);
this.WatchListView.VirtualItemsSelectionRangeChanged += new System.Windows.Forms.ListViewVirtualItemsSelectionRangeChangedEventHandler(this.WatchListView_VirtualItemsSelectionRangeChanged);
this.WatchListView.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop);
this.WatchListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.GenericDragEnter);
this.WatchListView.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);
this.WatchListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown);
this.WatchListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.WatchListView_MouseDoubleClick);
//
@ -936,7 +925,6 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(364, 378);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.MemDomainLabel);
this.Controls.Add(this.WatchCountLabel);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.RamWatchMenu);
@ -948,7 +936,7 @@
this.Activated += new System.EventHandler(this.NewRamWatch_Activated);
this.Load += new System.EventHandler(this.NewRamWatch_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GenericDragEnter);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);
this.Enter += new System.EventHandler(this.NewRamWatch_Enter);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown);
this.ListViewContextMenu.ResumeLayout(false);
@ -1024,7 +1012,6 @@
private System.Windows.Forms.ToolStripButton moveUpToolStripButton;
private System.Windows.Forms.ToolStripButton moveDownToolStripButton;
private System.Windows.Forms.Label WatchCountLabel;
private System.Windows.Forms.Label MemDomainLabel;
private System.Windows.Forms.ToolStripSeparator Separator2;
private System.Windows.Forms.ToolStripMenuItem OriginalMenuItem;
private System.Windows.Forms.ContextMenuStrip ListViewContextMenu;

View File

@ -199,7 +199,6 @@ namespace BizHawk.Client.EmuHawk
WatchListView.ItemCount = _watches.Count;
UpdateWatchCount();
Global.Config.RecentWatches.Add(_watches.CurrentFileName);
SetMemoryDomain(_watches.Domain.ToString());
UpdateStatusBar();
PokeAddressToolBarItem.Enabled =
@ -219,14 +218,13 @@ namespace BizHawk.Client.EmuHawk
if (_watches != null && !string.IsNullOrWhiteSpace(_watches.CurrentFileName))
{
_watches.RefreshDomains(_memoryDomains, _memoryDomains.MainMemory);
_watches.RefreshDomains(_memoryDomains);
_watches.Reload();
SetPlatformAndMemoryDomainLabel();
UpdateStatusBar();
}
else
{
_watches = new WatchList(_memoryDomains, _memoryDomains.MainMemory, _emu.SystemId);
_watches = new WatchList(_memoryDomains, _emu.SystemId);
NewWatchList(true);
}
}
@ -286,7 +284,7 @@ namespace BizHawk.Client.EmuHawk
return true;
}
if (Global.CheatList.IsActive(_watches.Domain, watch.Address))
if (Global.CheatList.IsActive(watch.Domain, watch.Address))
{
return true;
}
@ -537,16 +535,10 @@ namespace BizHawk.Client.EmuHawk
private void SetMemoryDomain(string name)
{
_watches.Domain = _memoryDomains[name];
SetPlatformAndMemoryDomainLabel();
CurrentDomain = _memoryDomains[name];
Update();
}
private void SetPlatformAndMemoryDomainLabel()
{
MemDomainLabel.Text = _emu.SystemId + " " + _watches.Domain.Name;
}
private void UpdateStatusBar(bool saved = false)
{
var message = string.Empty;
@ -589,7 +581,7 @@ namespace BizHawk.Client.EmuHawk
{
color = Color.PeachPuff;
}
else if (Global.CheatList.IsActive(_watches.Domain, _watches[index].Address))
else if (Global.CheatList.IsActive(_watches[index].Domain, _watches[index].Address))
{
color = Color.LightCyan;
}
@ -713,11 +705,19 @@ namespace BizHawk.Client.EmuHawk
PauseMenuItem.Text = _paused ? "Unpause" : "Pause";
}
private MemoryDomain _currentDomain = null;
private MemoryDomain CurrentDomain
{
get { return _currentDomain ?? _memoryDomains.MainMemory; }
set { _currentDomain = value; }
}
private void MemoryDomainsSubMenu_DropDownOpened(object sender, EventArgs e)
{
MemoryDomainsSubMenu.DropDownItems.Clear();
MemoryDomainsSubMenu.DropDownItems.AddRange(
_memoryDomains.MenuItems(SetMemoryDomain, _watches.Domain.Name)
_memoryDomains.MenuItems(SetMemoryDomain, CurrentDomain.Name)
.ToArray());
}
@ -728,7 +728,7 @@ namespace BizHawk.Client.EmuHawk
InitialLocation = this.ChildPointToScreen(WatchListView),
MemoryDomains = _memoryDomains
};
we.SetWatch(_watches.Domain);
we.SetWatch(CurrentDomain);
we.ShowHawkDialog(this);
if (we.DialogResult == DialogResult.OK)
{
@ -974,7 +974,7 @@ namespace BizHawk.Client.EmuHawk
private void NewRamWatch_Load(object sender, EventArgs e)
{
TopMost = Settings.TopMost;
_watches = new WatchList(_memoryDomains, _memoryDomains.MainMemory, _emu.SystemId);
_watches = new WatchList(_memoryDomains, _emu.SystemId);
LoadConfigSettings();
RamWatchMenu.Items.Add(Settings.Columns.GenerateColumnsMenu(ColumnToggleCallback));
UpdateStatusBar();
@ -1183,5 +1183,10 @@ namespace BizHawk.Client.EmuHawk
SelectedWatches.All(w => w.Domain.CanPoke());
}
// Stupid designer
protected void DragEnterWrapper(object sender, DragEventArgs e)
{
base.GenericDragEnter(sender, e);
}
}
}