New Ram Watch - progress on column hid/show/reorder logic, but still not quite what I want

This commit is contained in:
adelikat 2013-09-10 00:58:36 +00:00
parent ea9fb1f85d
commit e28c45d69e
4 changed files with 260 additions and 244 deletions

View File

@ -202,6 +202,17 @@ namespace BizHawk.MultiClient
{ "NotesColumn",-1 }, { "NotesColumn",-1 },
}; };
public Dictionary<string, int> RamWatchColumnIndexes = new Dictionary<string, int>()
{
{ "AddressColumn", 0 },
{ "ValueColumn", 1 },
{ "PrevColumn", 2 },
{ "ChangesColumn", 3 },
{ "DiffColumn", 4 },
{ "DomainColumn", 5 },
{ "NotesColumn", 6 },
};
public int RamWatchAddressIndex = 0; public int RamWatchAddressIndex = 0;
public int RamWatchValueIndex = 1; public int RamWatchValueIndex = 1;
public int RamWatchPrevIndex = 2; public int RamWatchPrevIndex = 2;

View File

@ -33,6 +33,23 @@
this.WatchCountLabel = new System.Windows.Forms.Label(); this.WatchCountLabel = new System.Windows.Forms.Label();
this.MessageLabel = new System.Windows.Forms.Label(); this.MessageLabel = new System.Windows.Forms.Label();
this.MemDomainLabel = new System.Windows.Forms.Label(); this.MemDomainLabel = new System.Windows.Forms.Label();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.EditContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RemoveContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DuplicateContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PokeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FreezeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.UnfreezeAllContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ViewInHexEditorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Separator6 = new System.Windows.Forms.ToolStripSeparator();
this.InsertSeperatorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MoveUpContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MoveDownContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.ShowPreviousValueContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowChangeCountsContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowDiffContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowDomainContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1 = new ToolStripEx(); this.toolStrip1 = new ToolStripEx();
this.newToolStripButton = new System.Windows.Forms.ToolStripButton(); this.newToolStripButton = new System.Windows.Forms.ToolStripButton();
this.openToolStripButton = new System.Windows.Forms.ToolStripButton(); this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
@ -98,26 +115,9 @@
this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenuStrip1.SuspendLayout();
this.EditContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RemoveContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DuplicateContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.PokeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FreezeContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.UnfreezeAllContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ViewInHexEditorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Separator6 = new System.Windows.Forms.ToolStripSeparator();
this.InsertSeperatorContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MoveUpContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MoveDownContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.ShowPreviousValueContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowChangeCountsContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowDiffContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowDomainContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// WatchCountLabel // WatchCountLabel
@ -149,6 +149,154 @@
this.MemDomainLabel.TabIndex = 7; this.MemDomainLabel.TabIndex = 7;
this.MemDomainLabel.Text = " "; this.MemDomainLabel.Text = " ";
// //
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.EditContextMenuItem,
this.RemoveContextMenuItem,
this.DuplicateContextMenuItem,
this.PokeContextMenuItem,
this.FreezeContextMenuItem,
this.UnfreezeAllContextMenuItem,
this.ViewInHexEditorContextMenuItem,
this.Separator6,
this.InsertSeperatorContextMenuItem,
this.MoveUpContextMenuItem,
this.MoveDownContextMenuItem,
this.toolStripSeparator4,
this.ShowPreviousValueContextMenuItem,
this.ShowChangeCountsContextMenuItem,
this.ShowDiffContextMenuItem,
this.ShowDomainContextMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(204, 324);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
//
// EditContextMenuItem
//
this.EditContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.CutHS;
this.EditContextMenuItem.Name = "EditContextMenuItem";
this.EditContextMenuItem.ShortcutKeyDisplayString = "Ctrl+E";
this.EditContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.EditContextMenuItem.Text = "&Edit";
this.EditContextMenuItem.Click += new System.EventHandler(this.editWatchToolStripMenuItem_Click);
//
// RemoveContextMenuItem
//
this.RemoveContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Delete;
this.RemoveContextMenuItem.Name = "RemoveContextMenuItem";
this.RemoveContextMenuItem.ShortcutKeyDisplayString = "Ctrl+R";
this.RemoveContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.RemoveContextMenuItem.Text = "&Remove";
this.RemoveContextMenuItem.Click += new System.EventHandler(this.removeWatchToolStripMenuItem_Click);
//
// DuplicateContextMenuItem
//
this.DuplicateContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Duplicate;
this.DuplicateContextMenuItem.Name = "DuplicateContextMenuItem";
this.DuplicateContextMenuItem.ShortcutKeyDisplayString = "Ctrl+D";
this.DuplicateContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.DuplicateContextMenuItem.Text = "&Duplicate";
this.DuplicateContextMenuItem.Click += new System.EventHandler(this.duplicateWatchToolStripMenuItem_Click);
//
// PokeContextMenuItem
//
this.PokeContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.poke;
this.PokeContextMenuItem.Name = "PokeContextMenuItem";
this.PokeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+P";
this.PokeContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.PokeContextMenuItem.Text = "&Poke";
this.PokeContextMenuItem.Click += new System.EventHandler(this.pokeAddressToolStripMenuItem_Click);
//
// FreezeContextMenuItem
//
this.FreezeContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Freeze;
this.FreezeContextMenuItem.Name = "FreezeContextMenuItem";
this.FreezeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+F";
this.FreezeContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.FreezeContextMenuItem.Text = "&Freeze";
this.FreezeContextMenuItem.Click += new System.EventHandler(this.freezeAddressToolStripMenuItem_Click);
//
// UnfreezeAllContextMenuItem
//
this.UnfreezeAllContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Unfreeze;
this.UnfreezeAllContextMenuItem.Name = "UnfreezeAllContextMenuItem";
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(203, 22);
this.ViewInHexEditorContextMenuItem.Text = "View in Hex Editor";
this.ViewInHexEditorContextMenuItem.Click += new System.EventHandler(this.ViewInHexEditorContextMenuItem_Click);
//
// Separator6
//
this.Separator6.Name = "Separator6";
this.Separator6.Size = new System.Drawing.Size(200, 6);
//
// InsertSeperatorContextMenuItem
//
this.InsertSeperatorContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.InsertSeparator;
this.InsertSeperatorContextMenuItem.Name = "InsertSeperatorContextMenuItem";
this.InsertSeperatorContextMenuItem.ShortcutKeyDisplayString = "Ctrl+I";
this.InsertSeperatorContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.InsertSeperatorContextMenuItem.Text = "&Insert Separator";
this.InsertSeperatorContextMenuItem.Click += new System.EventHandler(this.insertSeparatorToolStripMenuItem_Click);
//
// MoveUpContextMenuItem
//
this.MoveUpContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.MoveUp;
this.MoveUpContextMenuItem.Name = "MoveUpContextMenuItem";
this.MoveUpContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Up";
this.MoveUpContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.MoveUpContextMenuItem.Text = "Move &Up";
this.MoveUpContextMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click);
//
// MoveDownContextMenuItem
//
this.MoveDownContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.MoveDown;
this.MoveDownContextMenuItem.Name = "MoveDownContextMenuItem";
this.MoveDownContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Down";
this.MoveDownContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.MoveDownContextMenuItem.Text = "Move &Down";
this.MoveDownContextMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(200, 6);
//
// ShowPreviousValueContextMenuItem
//
this.ShowPreviousValueContextMenuItem.Name = "ShowPreviousValueContextMenuItem";
this.ShowPreviousValueContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowPreviousValueContextMenuItem.Text = "Show Previous Value";
this.ShowPreviousValueContextMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click);
//
// ShowChangeCountsContextMenuItem
//
this.ShowChangeCountsContextMenuItem.Name = "ShowChangeCountsContextMenuItem";
this.ShowChangeCountsContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowChangeCountsContextMenuItem.Text = "Show Change Counts";
this.ShowChangeCountsContextMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click);
//
// ShowDiffContextMenuItem
//
this.ShowDiffContextMenuItem.Name = "ShowDiffContextMenuItem";
this.ShowDiffContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowDiffContextMenuItem.Text = "Show Difference";
this.ShowDiffContextMenuItem.Click += new System.EventHandler(this.diffToolStripMenuItem_Click);
//
// ShowDomainContextMenuItem
//
this.ShowDomainContextMenuItem.Name = "ShowDomainContextMenuItem";
this.ShowDomainContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowDomainContextMenuItem.Text = "Show Domain";
this.ShowDomainContextMenuItem.Click += new System.EventHandler(this.domainToolStripMenuItem_Click);
//
// toolStrip1 // toolStrip1
// //
this.toolStrip1.ClickThrough = true; this.toolStrip1.ClickThrough = true;
@ -706,6 +854,7 @@
this.WatchListView.UseCompatibleStateImageBehavior = false; this.WatchListView.UseCompatibleStateImageBehavior = false;
this.WatchListView.View = System.Windows.Forms.View.Details; this.WatchListView.View = System.Windows.Forms.View.Details;
this.WatchListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.WatchListView_ColumnClick); this.WatchListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.WatchListView_ColumnClick);
this.WatchListView.ColumnReordered += new System.Windows.Forms.ColumnReorderedEventHandler(this.WatchListView_ColumnReordered);
this.WatchListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown); this.WatchListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.WatchListView_KeyDown);
this.WatchListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.WatchListView_MouseDoubleClick); this.WatchListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.WatchListView_MouseDoubleClick);
// //
@ -754,154 +903,6 @@
this.NotesColumn.Text = "Notes"; this.NotesColumn.Text = "Notes";
this.NotesColumn.Width = 128; this.NotesColumn.Width = 128;
// //
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.EditContextMenuItem,
this.RemoveContextMenuItem,
this.DuplicateContextMenuItem,
this.PokeContextMenuItem,
this.FreezeContextMenuItem,
this.UnfreezeAllContextMenuItem,
this.ViewInHexEditorContextMenuItem,
this.Separator6,
this.InsertSeperatorContextMenuItem,
this.MoveUpContextMenuItem,
this.MoveDownContextMenuItem,
this.toolStripSeparator4,
this.ShowPreviousValueContextMenuItem,
this.ShowChangeCountsContextMenuItem,
this.ShowDiffContextMenuItem,
this.ShowDomainContextMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(204, 324);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
//
// EditContextMenuItem
//
this.EditContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.CutHS;
this.EditContextMenuItem.Name = "EditContextMenuItem";
this.EditContextMenuItem.ShortcutKeyDisplayString = "Ctrl+E";
this.EditContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.EditContextMenuItem.Text = "&Edit";
this.EditContextMenuItem.Click += new System.EventHandler(this.editWatchToolStripMenuItem_Click);
//
// RemoveContextMenuItem
//
this.RemoveContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Delete;
this.RemoveContextMenuItem.Name = "RemoveContextMenuItem";
this.RemoveContextMenuItem.ShortcutKeyDisplayString = "Ctrl+R";
this.RemoveContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.RemoveContextMenuItem.Text = "&Remove";
this.RemoveContextMenuItem.Click += new System.EventHandler(this.removeWatchToolStripMenuItem_Click);
//
// DuplicateContextMenuItem
//
this.DuplicateContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Duplicate;
this.DuplicateContextMenuItem.Name = "DuplicateContextMenuItem";
this.DuplicateContextMenuItem.ShortcutKeyDisplayString = "Ctrl+D";
this.DuplicateContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.DuplicateContextMenuItem.Text = "&Duplicate";
this.DuplicateContextMenuItem.Click += new System.EventHandler(this.duplicateWatchToolStripMenuItem_Click);
//
// PokeContextMenuItem
//
this.PokeContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.poke;
this.PokeContextMenuItem.Name = "PokeContextMenuItem";
this.PokeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+P";
this.PokeContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.PokeContextMenuItem.Text = "&Poke";
this.PokeContextMenuItem.Click += new System.EventHandler(this.pokeAddressToolStripMenuItem_Click);
//
// FreezeContextMenuItem
//
this.FreezeContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Freeze;
this.FreezeContextMenuItem.Name = "FreezeContextMenuItem";
this.FreezeContextMenuItem.ShortcutKeyDisplayString = "Ctrl+F";
this.FreezeContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.FreezeContextMenuItem.Text = "&Freeze";
this.FreezeContextMenuItem.Click += new System.EventHandler(this.freezeAddressToolStripMenuItem_Click);
//
// UnfreezeAllContextMenuItem
//
this.UnfreezeAllContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Unfreeze;
this.UnfreezeAllContextMenuItem.Name = "UnfreezeAllContextMenuItem";
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(203, 22);
this.ViewInHexEditorContextMenuItem.Text = "View in Hex Editor";
this.ViewInHexEditorContextMenuItem.Click += new System.EventHandler(this.ViewInHexEditorContextMenuItem_Click);
//
// Separator6
//
this.Separator6.Name = "Separator6";
this.Separator6.Size = new System.Drawing.Size(200, 6);
//
// InsertSeperatorContextMenuItem
//
this.InsertSeperatorContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.InsertSeparator;
this.InsertSeperatorContextMenuItem.Name = "InsertSeperatorContextMenuItem";
this.InsertSeperatorContextMenuItem.ShortcutKeyDisplayString = "Ctrl+I";
this.InsertSeperatorContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.InsertSeperatorContextMenuItem.Text = "&Insert Separator";
this.InsertSeperatorContextMenuItem.Click += new System.EventHandler(this.insertSeparatorToolStripMenuItem_Click);
//
// MoveUpContextMenuItem
//
this.MoveUpContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.MoveUp;
this.MoveUpContextMenuItem.Name = "MoveUpContextMenuItem";
this.MoveUpContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Up";
this.MoveUpContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.MoveUpContextMenuItem.Text = "Move &Up";
this.MoveUpContextMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click);
//
// MoveDownContextMenuItem
//
this.MoveDownContextMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.MoveDown;
this.MoveDownContextMenuItem.Name = "MoveDownContextMenuItem";
this.MoveDownContextMenuItem.ShortcutKeyDisplayString = "Ctrl+Down";
this.MoveDownContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.MoveDownContextMenuItem.Text = "Move &Down";
this.MoveDownContextMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(200, 6);
//
// ShowPreviousValueContextMenuItem
//
this.ShowPreviousValueContextMenuItem.Name = "ShowPreviousValueContextMenuItem";
this.ShowPreviousValueContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowPreviousValueContextMenuItem.Text = "Show Previous Value";
this.ShowPreviousValueContextMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click);
//
// ShowChangeCountsContextMenuItem
//
this.ShowChangeCountsContextMenuItem.Name = "ShowChangeCountsContextMenuItem";
this.ShowChangeCountsContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowChangeCountsContextMenuItem.Text = "Show Change Counts";
this.ShowChangeCountsContextMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click);
//
// ShowDiffContextMenuItem
//
this.ShowDiffContextMenuItem.Name = "ShowDiffContextMenuItem";
this.ShowDiffContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowDiffContextMenuItem.Text = "Show Difference";
this.ShowDiffContextMenuItem.Click += new System.EventHandler(this.diffToolStripMenuItem_Click);
//
// ShowDomainContextMenuItem
//
this.ShowDomainContextMenuItem.Name = "ShowDomainContextMenuItem";
this.ShowDomainContextMenuItem.Size = new System.Drawing.Size(203, 22);
this.ShowDomainContextMenuItem.Text = "Show Domain";
this.ShowDomainContextMenuItem.Click += new System.EventHandler(this.domainToolStripMenuItem_Click);
//
// NewRamWatch // NewRamWatch
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -921,11 +922,11 @@
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragEnter); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewRamWatch_DragEnter);
this.Enter += new System.EventHandler(this.NewRamWatch_Enter); this.Enter += new System.EventHandler(this.NewRamWatch_Enter);
this.contextMenuStrip1.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout(); this.toolStrip1.PerformLayout();
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -129,53 +129,57 @@ namespace BizHawk.MultiClient
} }
public void SaveConfigSettings() public void SaveConfigSettings()
{
SaveColumnInfo();
Global.Config.RamWatchWndx = Location.X;
Global.Config.RamWatchWndy = Location.Y;
Global.Config.RamWatchWidth = Right - Left;
Global.Config.RamWatchHeight = Bottom - Top;
}
private void SaveColumnInfo()
{ {
if (WatchListView.Columns[ADDRESS] != null) if (WatchListView.Columns[ADDRESS] != null)
{ {
Global.Config.RamWatchAddressIndex = WatchListView.Columns[ADDRESS].DisplayIndex; Global.Config.RamWatchColumnIndexes[ADDRESS] = WatchListView.Columns[ADDRESS].DisplayIndex;
Global.Config.RamWatchColumnWidths[ADDRESS] = WatchListView.Columns[ADDRESS].Width; Global.Config.RamWatchColumnWidths[ADDRESS] = WatchListView.Columns[ADDRESS].Width;
} }
if (WatchListView.Columns[VALUE] != null) if (WatchListView.Columns[VALUE] != null)
{ {
Global.Config.RamWatchValueIndex = WatchListView.Columns[VALUE].DisplayIndex; Global.Config.RamWatchColumnIndexes[VALUE] = WatchListView.Columns[VALUE].DisplayIndex;
Global.Config.RamWatchColumnWidths[VALUE] = WatchListView.Columns[VALUE].Width; Global.Config.RamWatchColumnWidths[VALUE] = WatchListView.Columns[VALUE].Width;
} }
if (WatchListView.Columns[PREV] != null) if (WatchListView.Columns[PREV] != null)
{ {
Global.Config.RamWatchPrevIndex = WatchListView.Columns[PREV].DisplayIndex; Global.Config.RamWatchColumnIndexes[PREV] = WatchListView.Columns[PREV].DisplayIndex;
Global.Config.RamWatchColumnWidths[PREV] = WatchListView.Columns[PREV].Width; Global.Config.RamWatchColumnWidths[PREV] = WatchListView.Columns[PREV].Width;
} }
if (WatchListView.Columns[CHANGES] != null) if (WatchListView.Columns[CHANGES] != null)
{ {
Global.Config.RamWatchChangeIndex = WatchListView.Columns[CHANGES].DisplayIndex; Global.Config.RamWatchColumnIndexes[CHANGES] = WatchListView.Columns[CHANGES].DisplayIndex;
Global.Config.RamWatchColumnWidths[CHANGES] = WatchListView.Columns[CHANGES].Width; Global.Config.RamWatchColumnWidths[CHANGES] = WatchListView.Columns[CHANGES].Width;
} }
if (WatchListView.Columns[DIFF] != null) if (WatchListView.Columns[DIFF] != null)
{ {
Global.Config.RamWatchDiffIndex = WatchListView.Columns[DIFF].DisplayIndex; Global.Config.RamWatchColumnIndexes[DIFF] = WatchListView.Columns[DIFF].DisplayIndex;
Global.Config.RamWatchColumnWidths[DIFF] = WatchListView.Columns[DIFF].Width; Global.Config.RamWatchColumnWidths[DIFF] = WatchListView.Columns[DIFF].Width;
} }
if (WatchListView.Columns[DOMAIN] != null) if (WatchListView.Columns[DOMAIN] != null)
{ {
Global.Config.RamWatchDomainIndex = WatchListView.Columns[DOMAIN].DisplayIndex; Global.Config.RamWatchColumnIndexes[DOMAIN] = WatchListView.Columns[DOMAIN].DisplayIndex;
Global.Config.RamWatchColumnWidths[DOMAIN] = WatchListView.Columns[DOMAIN].Width; Global.Config.RamWatchColumnWidths[DOMAIN] = WatchListView.Columns[DOMAIN].Width;
} }
if (WatchListView.Columns[NOTES] != null) if (WatchListView.Columns[NOTES] != null)
{ {
Global.Config.RamWatchNotesIndex = WatchListView.Columns[NOTES].Index; Global.Config.RamWatchColumnIndexes[NOTES] = WatchListView.Columns[NOTES].Index;
Global.Config.RamWatchColumnWidths[NOTES] = WatchListView.Columns[NOTES].Width; Global.Config.RamWatchColumnWidths[NOTES] = WatchListView.Columns[NOTES].Width;
} }
Global.Config.RamWatchWndx = Location.X;
Global.Config.RamWatchWndy = Location.Y;
Global.Config.RamWatchWidth = Right - Left;
Global.Config.RamWatchHeight = Bottom - Top;
} }
protected override void OnClosing(CancelEventArgs e) protected override void OnClosing(CancelEventArgs e)
@ -356,7 +360,9 @@ namespace BizHawk.MultiClient
private void SelectAll() private void SelectAll()
{ {
for (int i = 0; i < Watches.Count; i++) for (int i = 0; i < Watches.Count; i++)
{
WatchListView.SelectItem(i, true); WatchListView.SelectItem(i, true);
}
} }
private void Changes() private void Changes()
@ -585,7 +591,7 @@ namespace BizHawk.MultiClient
} }
private void AddRemoveColumn(string columnName, bool enabled) private void AddColumn(string columnName, bool enabled)
{ {
if (enabled) if (enabled)
{ {
@ -598,48 +604,18 @@ namespace BizHawk.MultiClient
Width = GetColumnWidth(columnName), Width = GetColumnWidth(columnName),
}; };
WatchListView.Columns.Add(column); //TODO: insert in right place WatchListView.Columns.Add(column);
} }
} }
else
{
WatchListView.Columns.RemoveByKey(columnName);
}
DisplayWatches();
} }
private void ColumnPositionSet() //TODO: fix indexing, thrown off by columns not existing private void ColumnPositions()
{ {
var columnHeaders = new List<ColumnHeader>(); foreach (var kvp in Global.Config.RamWatchColumnIndexes)
foreach(ColumnHeader column in WatchListView.Columns)
{ {
columnHeaders.Add(column); if (WatchListView.Columns.ContainsKey(kvp.Key))
}
WatchListView.Columns.Clear();
var columnSettings = new List<KeyValuePair<int, string>>
{ {
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, ADDRESS), WatchListView.Columns[kvp.Key].DisplayIndex = kvp.Value < WatchListView.Columns.Count ? kvp.Value : WatchListView.Columns.Count - 1;
new KeyValuePair<int, string>(Global.Config.RamWatchValueIndex, VALUE),
new KeyValuePair<int, string>(Global.Config.RamWatchPrevIndex, PREV),
new KeyValuePair<int, string>(Global.Config.RamWatchChangeIndex, CHANGES),
new KeyValuePair<int, string>(Global.Config.RamWatchDiffIndex, DIFF),
new KeyValuePair<int, string>(Global.Config.RamWatchDomainIndex, DOMAIN),
new KeyValuePair<int, string>(Global.Config.RamWatchNotesIndex, NOTES)
};
columnSettings = columnSettings.OrderBy(s => s.Key).ToList();
foreach (KeyValuePair<int, string> t in columnSettings)
{
foreach (ColumnHeader t1 in columnHeaders)
{
if (t.Value == t1.Name)
{
WatchListView.Columns.Add(t1);
}
} }
} }
} }
@ -660,15 +636,21 @@ namespace BizHawk.MultiClient
Size = new Size(Global.Config.RamWatchWidth, Global.Config.RamWatchHeight); Size = new Size(Global.Config.RamWatchWidth, Global.Config.RamWatchHeight);
} }
//Columns LoadColumnInfo();
ColumnPositionSet(); }
AddRemoveColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
AddRemoveColumn(DIFF, Global.Config.RamWatchShowDiffColumn); private void LoadColumnInfo()
AddRemoveColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn); {
AddRemoveColumn(PREV, Global.Config.RamWatchShowPrevColumn); WatchListView.Columns.Clear();
WatchListView.Columns[ADDRESS].Width = GetColumnWidth(ADDRESS); AddColumn(ADDRESS, true);
WatchListView.Columns[VALUE].Width = GetColumnWidth(VALUE); AddColumn(VALUE, true);
WatchListView.Columns[NOTES].Width = GetColumnWidth(NOTES); AddColumn(PREV, Global.Config.RamWatchShowPrevColumn);
AddColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
AddColumn(DIFF, Global.Config.RamWatchShowDiffColumn);
AddColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn);
AddColumn(NOTES, true);
ColumnPositions();
} }
private void RemoveWatch() private void RemoveWatch()
@ -953,25 +935,36 @@ namespace BizHawk.MultiClient
private void showPreviousValueToolStripMenuItem_Click(object sender, EventArgs e) private void showPreviousValueToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.RamWatchShowPrevColumn ^= true; Global.Config.RamWatchShowPrevColumn ^= true;
AddRemoveColumn(PREV, Global.Config.RamWatchShowPrevColumn); SaveColumnInfo();
//AddRemoveColumn(PREV, Global.Config.RamWatchShowPrevColumn);
LoadColumnInfo();
} }
private void showChangeCountsToolStripMenuItem_Click(object sender, EventArgs e) private void showChangeCountsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.RamWatchShowChangeColumn ^= true; Global.Config.RamWatchShowChangeColumn ^= true;
AddRemoveColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
SaveColumnInfo();
//AddRemoveColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
LoadColumnInfo();
} }
private void diffToolStripMenuItem_Click(object sender, EventArgs e) private void diffToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.RamWatchShowDiffColumn ^= true; Global.Config.RamWatchShowDiffColumn ^= true;
AddRemoveColumn(DIFF, Global.Config.RamWatchShowDiffColumn);
SaveColumnInfo();
//(DIFF, Global.Config.RamWatchShowDiffColumn);
LoadColumnInfo();
} }
private void domainToolStripMenuItem_Click(object sender, EventArgs e) private void domainToolStripMenuItem_Click(object sender, EventArgs e)
{ {
Global.Config.RamWatchShowDomainColumn ^= true; Global.Config.RamWatchShowDomainColumn ^= true;
AddRemoveColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn);
SaveColumnInfo();
//AddRemoveColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn);
LoadColumnInfo();
} }
/*************Options***********************/ /*************Options***********************/
@ -1040,26 +1033,24 @@ namespace BizHawk.MultiClient
{ {
Size = new Size(defaultWidth, defaultHeight); Size = new Size(defaultWidth, defaultHeight);
Global.Config.RamWatchAddressIndex = 0; Global.Config.RamWatchColumnIndexes = new Dictionary<string, int>()
Global.Config.RamWatchValueIndex = 1; {
Global.Config.RamWatchPrevIndex = 2; { "AddressColumn", 0 },
Global.Config.RamWatchChangeIndex = 3; { "ValueColumn", 1 },
Global.Config.RamWatchDiffIndex = 4; { "PrevColumn", 2 },
Global.Config.RamWatchDomainIndex = 5; { "ChangesColumn", 3 },
Global.Config.RamWatchNotesIndex = 6; { "DiffColumn", 4 },
{ "DomainColumn", 5 },
{ "NotesColumn", 6 },
};
ColumnPositionSet(); ColumnPositions();
Global.Config.RamWatchShowChangeColumn = true; Global.Config.RamWatchShowChangeColumn = true;
Global.Config.RamWatchShowDomainColumn = true; Global.Config.RamWatchShowDomainColumn = true;
Global.Config.RamWatchShowPrevColumn = false; Global.Config.RamWatchShowPrevColumn = false;
Global.Config.RamWatchShowDiffColumn = false; Global.Config.RamWatchShowDiffColumn = false;
AddRemoveColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
AddRemoveColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn);
AddRemoveColumn(PREV, Global.Config.RamWatchShowPrevColumn);
AddRemoveColumn(DIFF, Global.Config.RamWatchShowDiffColumn);
WatchListView.Columns[ADDRESS].Width = DefaultColumnWidths[ADDRESS]; WatchListView.Columns[ADDRESS].Width = DefaultColumnWidths[ADDRESS];
WatchListView.Columns[VALUE].Width = DefaultColumnWidths[VALUE]; WatchListView.Columns[VALUE].Width = DefaultColumnWidths[VALUE];
//WatchListView.Columns[PREV].Width = DefaultColumnWidths[PREV]; //WatchListView.Columns[PREV].Width = DefaultColumnWidths[PREV];
@ -1070,6 +1061,8 @@ namespace BizHawk.MultiClient
Global.Config.DisplayRamWatch = false; Global.Config.DisplayRamWatch = false;
Global.Config.RamWatchSaveWindowPosition = true; Global.Config.RamWatchSaveWindowPosition = true;
LoadColumnInfo();
} }
/*************Context Menu***********************/ /*************Context Menu***********************/
@ -1178,6 +1171,17 @@ namespace BizHawk.MultiClient
OrderColumn(e.Column); OrderColumn(e.Column);
} }
private void WatchListView_ColumnReordered(object sender, ColumnReorderedEventArgs e)
{
Global.Config.RamWatchColumnIndexes[ADDRESS] = WatchListView.Columns[ADDRESS].DisplayIndex;
Global.Config.RamWatchColumnIndexes[VALUE] = WatchListView.Columns[VALUE].DisplayIndex;
Global.Config.RamWatchColumnIndexes[PREV] = WatchListView.Columns[ADDRESS].DisplayIndex;
Global.Config.RamWatchColumnIndexes[CHANGES] = WatchListView.Columns[CHANGES].DisplayIndex;
Global.Config.RamWatchColumnIndexes[DIFF] = WatchListView.Columns[DIFF].DisplayIndex;
Global.Config.RamWatchColumnIndexes[DOMAIN] = WatchListView.Columns[DOMAIN].DisplayIndex;
Global.Config.RamWatchColumnIndexes[NOTES] = WatchListView.Columns[NOTES].DisplayIndex;
}
#endregion #endregion
} }
} }

View File

@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>336, 17</value>
</metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>231, 17</value> <value>231, 17</value>
</metadata> </metadata>
@ -209,9 +212,6 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>336, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAABMLAAATCwAAAAEAAAAA AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAABMLAAATCwAAAAEAAAAA