New Ram WAtch - implement column hide/show, and column positioning/width saving and loading
This commit is contained in:
parent
0442eddf5a
commit
8d4a8bc869
|
@ -182,6 +182,7 @@ namespace BizHawk.MultiClient
|
||||||
public bool RamWatchShowPrevColumn = false;
|
public bool RamWatchShowPrevColumn = false;
|
||||||
public bool RamWatchShowDiffColumn = false;
|
public bool RamWatchShowDiffColumn = false;
|
||||||
public bool RamWatchShowDomainColumn = true;
|
public bool RamWatchShowDomainColumn = true;
|
||||||
|
|
||||||
public int RamWatchAddressWidth = -1;
|
public int RamWatchAddressWidth = -1;
|
||||||
public int RamWatchValueWidth = -1;
|
public int RamWatchValueWidth = -1;
|
||||||
public int RamWatchPrevWidth = -1;
|
public int RamWatchPrevWidth = -1;
|
||||||
|
@ -189,6 +190,18 @@ namespace BizHawk.MultiClient
|
||||||
public int RamWatchDiffWidth = -1;
|
public int RamWatchDiffWidth = -1;
|
||||||
public int RamWatchNotesWidth = -1;
|
public int RamWatchNotesWidth = -1;
|
||||||
public int RamWatchDomainWidth = -1;
|
public int RamWatchDomainWidth = -1;
|
||||||
|
|
||||||
|
public Dictionary<string, int> RamWatchColumnWidths = new Dictionary<string, int>()
|
||||||
|
{
|
||||||
|
{ "AddressColumn", -1 },
|
||||||
|
{ "ValueColumn", -1 },
|
||||||
|
{ "PrevColumn", -1 },
|
||||||
|
{ "ChangesColumn", -1 },
|
||||||
|
{ "DiffColumn", -1 },
|
||||||
|
{ "DomainColumn", -1 },
|
||||||
|
{ "NotesColumn",-1 },
|
||||||
|
};
|
||||||
|
|
||||||
public int RamWatchAddressIndex = 0;
|
public int RamWatchAddressIndex = 0;
|
||||||
public int RamWatchValueIndex = 1;
|
public int RamWatchValueIndex = 1;
|
||||||
public int RamWatchPrevIndex = 2;
|
public int RamWatchPrevIndex = 2;
|
||||||
|
@ -196,6 +209,7 @@ namespace BizHawk.MultiClient
|
||||||
public int RamWatchDiffIndex = 4;
|
public int RamWatchDiffIndex = 4;
|
||||||
public int RamWatchDomainIndex = 5;
|
public int RamWatchDomainIndex = 5;
|
||||||
public int RamWatchNotesIndex = 6;
|
public int RamWatchNotesIndex = 6;
|
||||||
|
|
||||||
public int RamWatchPrev_Type = 1;
|
public int RamWatchPrev_Type = 1;
|
||||||
|
|
||||||
// RamSearch Settings
|
// RamSearch Settings
|
||||||
|
|
|
@ -89,13 +89,13 @@
|
||||||
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.restoreWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.WatchListView = new BizHawk.VirtualListView();
|
this.WatchListView = new BizHawk.VirtualListView();
|
||||||
this.Address = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.AddressColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.Value = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.ValueColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.Prev = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.PrevColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.ChangeCounts = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.ChangesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.Diff = ((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.Notes = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.toolStrip1.SuspendLayout();
|
this.toolStrip1.SuspendLayout();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
|
@ -555,36 +555,37 @@
|
||||||
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
|
||||||
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||||
this.viewToolStripMenuItem.Text = "&View";
|
this.viewToolStripMenuItem.Text = "&View";
|
||||||
|
this.viewToolStripMenuItem.DropDownOpened += new System.EventHandler(this.viewToolStripMenuItem_DropDownOpened);
|
||||||
//
|
//
|
||||||
// showPreviousValueToolStripMenuItem
|
// showPreviousValueToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.showPreviousValueToolStripMenuItem.Enabled = false;
|
|
||||||
this.showPreviousValueToolStripMenuItem.Name = "showPreviousValueToolStripMenuItem";
|
this.showPreviousValueToolStripMenuItem.Name = "showPreviousValueToolStripMenuItem";
|
||||||
this.showPreviousValueToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
this.showPreviousValueToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||||
this.showPreviousValueToolStripMenuItem.Text = "Previous Value";
|
this.showPreviousValueToolStripMenuItem.Text = "Previous Value";
|
||||||
|
this.showPreviousValueToolStripMenuItem.Click += new System.EventHandler(this.showPreviousValueToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// showChangeCountsToolStripMenuItem
|
// showChangeCountsToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.showChangeCountsToolStripMenuItem.Checked = true;
|
this.showChangeCountsToolStripMenuItem.Checked = true;
|
||||||
this.showChangeCountsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.showChangeCountsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.showChangeCountsToolStripMenuItem.Enabled = false;
|
|
||||||
this.showChangeCountsToolStripMenuItem.Name = "showChangeCountsToolStripMenuItem";
|
this.showChangeCountsToolStripMenuItem.Name = "showChangeCountsToolStripMenuItem";
|
||||||
this.showChangeCountsToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
this.showChangeCountsToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||||
this.showChangeCountsToolStripMenuItem.Text = "Change Counts";
|
this.showChangeCountsToolStripMenuItem.Text = "Change Counts";
|
||||||
|
this.showChangeCountsToolStripMenuItem.Click += new System.EventHandler(this.showChangeCountsToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// diffToolStripMenuItem
|
// diffToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.diffToolStripMenuItem.Enabled = false;
|
|
||||||
this.diffToolStripMenuItem.Name = "diffToolStripMenuItem";
|
this.diffToolStripMenuItem.Name = "diffToolStripMenuItem";
|
||||||
this.diffToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
this.diffToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||||
this.diffToolStripMenuItem.Text = "Difference";
|
this.diffToolStripMenuItem.Text = "Difference";
|
||||||
|
this.diffToolStripMenuItem.Click += new System.EventHandler(this.diffToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// domainToolStripMenuItem
|
// domainToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.domainToolStripMenuItem.Enabled = false;
|
|
||||||
this.domainToolStripMenuItem.Name = "domainToolStripMenuItem";
|
this.domainToolStripMenuItem.Name = "domainToolStripMenuItem";
|
||||||
this.domainToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
this.domainToolStripMenuItem.Size = new System.Drawing.Size(156, 22);
|
||||||
this.domainToolStripMenuItem.Text = "Domain";
|
this.domainToolStripMenuItem.Text = "Domain";
|
||||||
|
this.domainToolStripMenuItem.Click += new System.EventHandler(this.domainToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// optionsToolStripMenuItem
|
// optionsToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
@ -655,13 +656,13 @@
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.WatchListView.AutoArrange = false;
|
this.WatchListView.AutoArrange = false;
|
||||||
this.WatchListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
this.WatchListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||||
this.Address,
|
this.AddressColumn,
|
||||||
this.Value,
|
this.ValueColumn,
|
||||||
this.Prev,
|
this.PrevColumn,
|
||||||
this.ChangeCounts,
|
this.ChangesColumn,
|
||||||
this.Diff,
|
this.DiffColumn,
|
||||||
this.DomainColumn,
|
this.DomainColumn,
|
||||||
this.Notes});
|
this.NotesColumn});
|
||||||
this.WatchListView.FullRowSelect = true;
|
this.WatchListView.FullRowSelect = true;
|
||||||
this.WatchListView.GridLines = true;
|
this.WatchListView.GridLines = true;
|
||||||
this.WatchListView.HideSelection = false;
|
this.WatchListView.HideSelection = false;
|
||||||
|
@ -675,43 +676,50 @@
|
||||||
this.WatchListView.UseCompatibleStateImageBehavior = false;
|
this.WatchListView.UseCompatibleStateImageBehavior = false;
|
||||||
this.WatchListView.View = System.Windows.Forms.View.Details;
|
this.WatchListView.View = System.Windows.Forms.View.Details;
|
||||||
//
|
//
|
||||||
// Address
|
// AddressColumn
|
||||||
//
|
//
|
||||||
this.Address.Text = "Address";
|
this.AddressColumn.Name = "AddressColumn";
|
||||||
|
this.AddressColumn.Text = "Address";
|
||||||
//
|
//
|
||||||
// Value
|
// ValueColumn
|
||||||
//
|
//
|
||||||
this.Value.Text = "Value";
|
this.ValueColumn.Name = "ValueColumn";
|
||||||
this.Value.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.ValueColumn.Text = "Value";
|
||||||
this.Value.Width = 59;
|
this.ValueColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
this.ValueColumn.Width = 59;
|
||||||
//
|
//
|
||||||
// Prev
|
// PrevColumn
|
||||||
//
|
//
|
||||||
this.Prev.Text = "Prev";
|
this.PrevColumn.Name = "PrevColumn";
|
||||||
this.Prev.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.PrevColumn.Text = "Prev";
|
||||||
this.Prev.Width = 0;
|
this.PrevColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
this.PrevColumn.Width = 59;
|
||||||
//
|
//
|
||||||
// ChangeCounts
|
// ChangesColumn
|
||||||
//
|
//
|
||||||
this.ChangeCounts.Text = "Changes";
|
this.ChangesColumn.Name = "ChangesColumn";
|
||||||
this.ChangeCounts.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.ChangesColumn.Text = "Changes";
|
||||||
this.ChangeCounts.Width = 54;
|
this.ChangesColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
this.ChangesColumn.Width = 54;
|
||||||
//
|
//
|
||||||
// Diff
|
// DiffColumn
|
||||||
//
|
//
|
||||||
this.Diff.Text = "Diff";
|
this.DiffColumn.Name = "DiffColumn";
|
||||||
this.Diff.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
this.DiffColumn.Text = "Diff";
|
||||||
this.Diff.Width = 59;
|
this.DiffColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
this.DiffColumn.Width = 59;
|
||||||
//
|
//
|
||||||
// DomainColumn
|
// DomainColumn
|
||||||
//
|
//
|
||||||
|
this.DomainColumn.Name = "DomainColumn";
|
||||||
this.DomainColumn.Text = "Domain";
|
this.DomainColumn.Text = "Domain";
|
||||||
this.DomainColumn.Width = 55;
|
this.DomainColumn.Width = 55;
|
||||||
//
|
//
|
||||||
// Notes
|
// NotesColumn
|
||||||
//
|
//
|
||||||
this.Notes.Text = "Notes";
|
this.NotesColumn.Name = "NotesColumn";
|
||||||
this.Notes.Width = 128;
|
this.NotesColumn.Text = "Notes";
|
||||||
|
this.NotesColumn.Width = 128;
|
||||||
//
|
//
|
||||||
// NewRamWatch
|
// NewRamWatch
|
||||||
//
|
//
|
||||||
|
@ -740,13 +748,13 @@
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private VirtualListView WatchListView;
|
private VirtualListView WatchListView;
|
||||||
private System.Windows.Forms.ColumnHeader Address;
|
private System.Windows.Forms.ColumnHeader AddressColumn;
|
||||||
private System.Windows.Forms.ColumnHeader Value;
|
private System.Windows.Forms.ColumnHeader ValueColumn;
|
||||||
private System.Windows.Forms.ColumnHeader Prev;
|
private System.Windows.Forms.ColumnHeader PrevColumn;
|
||||||
private System.Windows.Forms.ColumnHeader ChangeCounts;
|
private System.Windows.Forms.ColumnHeader ChangesColumn;
|
||||||
private System.Windows.Forms.ColumnHeader Diff;
|
private System.Windows.Forms.ColumnHeader DiffColumn;
|
||||||
private System.Windows.Forms.ColumnHeader DomainColumn;
|
private System.Windows.Forms.ColumnHeader DomainColumn;
|
||||||
private System.Windows.Forms.ColumnHeader Notes;
|
private System.Windows.Forms.ColumnHeader NotesColumn;
|
||||||
private MenuStripEx menuStrip1;
|
private MenuStripEx menuStrip1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem filesToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem filesToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem newListToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem newListToolStripMenuItem;
|
||||||
|
|
|
@ -12,6 +12,25 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
public partial class NewRamWatch : Form
|
public partial class NewRamWatch : Form
|
||||||
{
|
{
|
||||||
|
private const string ADDRESS = "AddressColumn";
|
||||||
|
private const string VALUE = "ValueColumn";
|
||||||
|
private const string PREV = "PrevColumn";
|
||||||
|
private const string CHANGES = "ChangesColumn";
|
||||||
|
private const string DIFF = "DiffColumn";
|
||||||
|
private const string DOMAIN = "DomainColumn";
|
||||||
|
private const string NOTES = "NotesColumn";
|
||||||
|
|
||||||
|
private Dictionary<string, int> DefaultColumnWidths = new Dictionary<string, int>()
|
||||||
|
{
|
||||||
|
{ ADDRESS, 60 },
|
||||||
|
{ VALUE, 59 },
|
||||||
|
{ PREV, 59 },
|
||||||
|
{ CHANGES, 55 },
|
||||||
|
{ DIFF, 59 },
|
||||||
|
{ DOMAIN, 55 },
|
||||||
|
{ NOTES, 128 },
|
||||||
|
};
|
||||||
|
|
||||||
private int defaultWidth;
|
private int defaultWidth;
|
||||||
private int defaultHeight;
|
private int defaultHeight;
|
||||||
private WatchList Watches = new WatchList();
|
private WatchList Watches = new WatchList();
|
||||||
|
@ -105,13 +124,47 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public void SaveConfigSettings()
|
public void SaveConfigSettings()
|
||||||
{
|
{
|
||||||
Global.Config.RamWatchAddressWidth = WatchListView.Columns[Global.Config.RamWatchAddressIndex].Width;
|
if (WatchListView.Columns[ADDRESS] != null)
|
||||||
Global.Config.RamWatchValueWidth = WatchListView.Columns[Global.Config.RamWatchValueIndex].Width;
|
{
|
||||||
Global.Config.RamWatchPrevWidth = WatchListView.Columns[Global.Config.RamWatchPrevIndex].Width;
|
Global.Config.RamWatchAddressIndex = WatchListView.Columns[ADDRESS].DisplayIndex;
|
||||||
Global.Config.RamWatchChangeWidth = WatchListView.Columns[Global.Config.RamWatchChangeIndex].Width;
|
Global.Config.RamWatchColumnWidths[ADDRESS] = WatchListView.Columns[ADDRESS].Width;
|
||||||
Global.Config.RamWatchDiffWidth = WatchListView.Columns[Global.Config.RamWatchDiffIndex].Width;
|
}
|
||||||
Global.Config.RamWatchDomainWidth = WatchListView.Columns[Global.Config.RamWatchDomainIndex].Width;
|
|
||||||
Global.Config.RamWatchNotesWidth = WatchListView.Columns[Global.Config.RamWatchNotesIndex].Width;
|
if (WatchListView.Columns[VALUE] != null)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchValueIndex = WatchListView.Columns[VALUE].DisplayIndex;
|
||||||
|
Global.Config.RamWatchColumnWidths[VALUE] = WatchListView.Columns[VALUE].Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WatchListView.Columns[PREV] != null)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchPrevIndex = WatchListView.Columns[PREV].DisplayIndex;
|
||||||
|
Global.Config.RamWatchColumnWidths[PREV] = WatchListView.Columns[PREV].Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WatchListView.Columns[CHANGES] != null)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchChangeIndex = WatchListView.Columns[CHANGES].DisplayIndex;
|
||||||
|
Global.Config.RamWatchColumnWidths[CHANGES] = WatchListView.Columns[CHANGES].Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WatchListView.Columns[DIFF] != null)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchDiffIndex = WatchListView.Columns[DIFF].DisplayIndex;
|
||||||
|
Global.Config.RamWatchColumnWidths[DIFF] = WatchListView.Columns[DIFF].Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WatchListView.Columns[DOMAIN] != null)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchDomainIndex = WatchListView.Columns[DOMAIN].DisplayIndex;
|
||||||
|
Global.Config.RamWatchColumnWidths[DOMAIN] = WatchListView.Columns[DOMAIN].Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WatchListView.Columns[NOTES] != null)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchNotesIndex = WatchListView.Columns[NOTES].Index;
|
||||||
|
Global.Config.RamWatchColumnWidths[NOTES] = WatchListView.Columns[NOTES].Width;
|
||||||
|
}
|
||||||
|
|
||||||
Global.Config.RamWatchWndx = Location.X;
|
Global.Config.RamWatchWndx = Location.X;
|
||||||
Global.Config.RamWatchWndy = Location.Y;
|
Global.Config.RamWatchWndy = Location.Y;
|
||||||
|
@ -126,6 +179,17 @@ namespace BizHawk.MultiClient
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int GetColumnWidth(string columnName)
|
||||||
|
{
|
||||||
|
var width = Global.Config.RamWatchColumnWidths[columnName];
|
||||||
|
if (width == -1)
|
||||||
|
{
|
||||||
|
width = DefaultColumnWidths[columnName];
|
||||||
|
}
|
||||||
|
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
private void WatchListView_QueryItemBkColor(int index, int column, ref Color color)
|
private void WatchListView_QueryItemBkColor(int index, int column, ref Color color)
|
||||||
{
|
{
|
||||||
if (index >= Watches.ItemCount)
|
if (index >= Watches.ItemCount)
|
||||||
|
@ -154,37 +218,38 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
string columnName = WatchListView.Columns[column].Name;
|
||||||
|
|
||||||
switch (column)
|
switch (columnName)
|
||||||
{
|
{
|
||||||
case 0: // address
|
case ADDRESS:
|
||||||
text = Watches[index].AddressString;
|
text = Watches[index].AddressString;
|
||||||
break;
|
break;
|
||||||
case 1: // value
|
case VALUE:
|
||||||
text = Watches[index].ValueString;
|
text = Watches[index].ValueString;
|
||||||
break;
|
break;
|
||||||
case 2: // prev
|
case PREV:
|
||||||
if (Watches[index] is iWatchEntryDetails)
|
if (Watches[index] is iWatchEntryDetails)
|
||||||
{
|
{
|
||||||
text = (Watches[index] as iWatchEntryDetails).PreviousStr;
|
text = (Watches[index] as iWatchEntryDetails).PreviousStr;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: // changes
|
case CHANGES:
|
||||||
if (Watches[index] is iWatchEntryDetails)
|
if (Watches[index] is iWatchEntryDetails)
|
||||||
{
|
{
|
||||||
text = (Watches[index] as iWatchEntryDetails).ChangeCount.ToString();
|
text = (Watches[index] as iWatchEntryDetails).ChangeCount.ToString();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: // diff
|
case DIFF:
|
||||||
if (Watches[index] is iWatchEntryDetails)
|
if (Watches[index] is iWatchEntryDetails)
|
||||||
{
|
{
|
||||||
text = (Watches[index] as iWatchEntryDetails).Diff;
|
text = (Watches[index] as iWatchEntryDetails).Diff;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5: // domain
|
case DOMAIN:
|
||||||
text = Watches[index].Domain.Name;
|
text = Watches[index].Domain.Name;
|
||||||
break;
|
break;
|
||||||
case 6: // notes
|
case NOTES:
|
||||||
if (Watches[index] is iWatchEntryDetails)
|
if (Watches[index] is iWatchEntryDetails)
|
||||||
{
|
{
|
||||||
text = (Watches[index] as iWatchEntryDetails).Notes;
|
text = (Watches[index] as iWatchEntryDetails).Notes;
|
||||||
|
@ -488,10 +553,68 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Winform Events
|
private void AddRemoveColumn(string columnName, bool enabled)
|
||||||
|
|
||||||
private void NewRamWatch_Load(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
|
if (enabled)
|
||||||
|
{
|
||||||
|
if (WatchListView.Columns[columnName] == null)
|
||||||
|
{
|
||||||
|
ColumnHeader column = new ColumnHeader()
|
||||||
|
{
|
||||||
|
Name = columnName,
|
||||||
|
Text = columnName.Replace("Column", ""),
|
||||||
|
Width = GetColumnWidth(columnName),
|
||||||
|
};
|
||||||
|
|
||||||
|
WatchListView.Columns.Add(column); //TODO: insert in right place
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WatchListView.Columns.RemoveByKey(columnName);
|
||||||
|
}
|
||||||
|
|
||||||
|
DisplayWatches();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ColumnPositionSet() //TODO: fix indexing, thrown off by columns not existing
|
||||||
|
{
|
||||||
|
List<ColumnHeader> columnHeaders = new List<ColumnHeader>();
|
||||||
|
foreach(ColumnHeader column in WatchListView.Columns)
|
||||||
|
{
|
||||||
|
columnHeaders.Add(column);
|
||||||
|
}
|
||||||
|
WatchListView.Columns.Clear();
|
||||||
|
|
||||||
|
List<KeyValuePair<int, string>> columnSettings = new List<KeyValuePair<int, string>>
|
||||||
|
{
|
||||||
|
new KeyValuePair<int, string>(Global.Config.RamWatchAddressIndex, ADDRESS),
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadConfigSettings()
|
||||||
|
{
|
||||||
|
//Size and Positioning
|
||||||
defaultWidth = Size.Width; //Save these first so that the user can restore to its original size
|
defaultWidth = Size.Width; //Save these first so that the user can restore to its original size
|
||||||
defaultHeight = Size.Height;
|
defaultHeight = Size.Height;
|
||||||
|
|
||||||
|
@ -504,6 +627,24 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
Size = new Size(Global.Config.RamWatchWidth, Global.Config.RamWatchHeight);
|
Size = new Size(Global.Config.RamWatchWidth, Global.Config.RamWatchHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Columns
|
||||||
|
ColumnPositionSet();
|
||||||
|
AddRemoveColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
|
||||||
|
AddRemoveColumn(DIFF, Global.Config.RamWatchShowDiffColumn);
|
||||||
|
AddRemoveColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn);
|
||||||
|
AddRemoveColumn(PREV, Global.Config.RamWatchShowPrevColumn);
|
||||||
|
WatchListView.Columns[ADDRESS].Width = GetColumnWidth(ADDRESS);
|
||||||
|
WatchListView.Columns[VALUE].Width = GetColumnWidth(VALUE);
|
||||||
|
WatchListView.Columns[NOTES].Width = GetColumnWidth(NOTES);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Winform Events
|
||||||
|
|
||||||
|
private void NewRamWatch_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LoadConfigSettings();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************File***********************/
|
/*************File***********************/
|
||||||
|
@ -677,6 +818,39 @@ namespace BizHawk.MultiClient
|
||||||
SelectAll();
|
SelectAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************View***********************/
|
||||||
|
private void viewToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
showPreviousValueToolStripMenuItem.Checked = Global.Config.RamWatchShowPrevColumn;
|
||||||
|
showChangeCountsToolStripMenuItem.Checked = Global.Config.RamWatchShowChangeColumn;
|
||||||
|
diffToolStripMenuItem.Checked = Global.Config.RamWatchShowDiffColumn;
|
||||||
|
domainToolStripMenuItem.Checked = Global.Config.RamWatchShowDomainColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showPreviousValueToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchShowPrevColumn ^= true;
|
||||||
|
AddRemoveColumn(PREV, Global.Config.RamWatchShowPrevColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showChangeCountsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchShowChangeColumn ^= true;
|
||||||
|
AddRemoveColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void diffToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchShowDiffColumn ^= true;
|
||||||
|
AddRemoveColumn(DIFF, Global.Config.RamWatchShowDiffColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void domainToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchShowDomainColumn ^= true;
|
||||||
|
AddRemoveColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn);
|
||||||
|
}
|
||||||
|
|
||||||
/*************Options***********************/
|
/*************Options***********************/
|
||||||
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -712,21 +886,29 @@ namespace BizHawk.MultiClient
|
||||||
Global.Config.RamWatchPrevIndex = 2;
|
Global.Config.RamWatchPrevIndex = 2;
|
||||||
Global.Config.RamWatchChangeIndex = 3;
|
Global.Config.RamWatchChangeIndex = 3;
|
||||||
Global.Config.RamWatchDiffIndex = 4;
|
Global.Config.RamWatchDiffIndex = 4;
|
||||||
Global.Config.RamWatchNotesIndex = 5;
|
Global.Config.RamWatchDomainIndex = 5;
|
||||||
|
Global.Config.RamWatchNotesIndex = 6;
|
||||||
|
|
||||||
|
ColumnPositionSet();
|
||||||
|
|
||||||
showPreviousValueToolStripMenuItem.Checked = false;
|
|
||||||
Global.Config.RamWatchShowPrevColumn = false;
|
|
||||||
showChangeCountsToolStripMenuItem.Checked = true;
|
|
||||||
Global.Config.RamWatchShowChangeColumn = true;
|
Global.Config.RamWatchShowChangeColumn = true;
|
||||||
Global.Config.RamWatchShowDiffColumn = false;
|
|
||||||
Global.Config.RamWatchShowDomainColumn = true;
|
Global.Config.RamWatchShowDomainColumn = true;
|
||||||
WatchListView.Columns[0].Width = 60;
|
Global.Config.RamWatchShowPrevColumn = false;
|
||||||
WatchListView.Columns[1].Width = 59;
|
Global.Config.RamWatchShowDiffColumn = false;
|
||||||
WatchListView.Columns[2].Width = 0;
|
|
||||||
WatchListView.Columns[3].Width = 55;
|
AddRemoveColumn(CHANGES, Global.Config.RamWatchShowChangeColumn);
|
||||||
WatchListView.Columns[4].Width = 0;
|
AddRemoveColumn(DOMAIN, Global.Config.RamWatchShowDomainColumn);
|
||||||
WatchListView.Columns[5].Width = 55;
|
AddRemoveColumn(PREV, Global.Config.RamWatchShowPrevColumn);
|
||||||
WatchListView.Columns[6].Width = 128;
|
AddRemoveColumn(DIFF, Global.Config.RamWatchShowDiffColumn);
|
||||||
|
|
||||||
|
WatchListView.Columns[ADDRESS].Width = DefaultColumnWidths[ADDRESS];
|
||||||
|
WatchListView.Columns[VALUE].Width = DefaultColumnWidths[VALUE];
|
||||||
|
//WatchListView.Columns[PREV].Width = DefaultColumnWidths[PREV];
|
||||||
|
WatchListView.Columns[CHANGES].Width = DefaultColumnWidths[CHANGES];
|
||||||
|
//WatchListView.Columns[DIFF].Width = DefaultColumnWidths[DIFF];
|
||||||
|
WatchListView.Columns[DOMAIN].Width = DefaultColumnWidths[DOMAIN];
|
||||||
|
WatchListView.Columns[NOTES].Width = DefaultColumnWidths[NOTES];
|
||||||
|
|
||||||
Global.Config.DisplayRamWatch = false;
|
Global.Config.DisplayRamWatch = false;
|
||||||
Global.Config.RamWatchSaveWindowPosition = true;
|
Global.Config.RamWatchSaveWindowPosition = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue