Debugger: Added location bar to memory viewer

This commit is contained in:
Sour 2017-12-31 10:51:05 -05:00
parent b1a6fa8ee0
commit ebc71fb847
6 changed files with 123 additions and 56 deletions

View file

@ -44,6 +44,8 @@
this.chkMatchCase = new System.Windows.Forms.CheckBox();
this.ctrlHexBox = new Be.Windows.Forms.HexBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.lblLocation = new System.Windows.Forms.ToolStripStatusLabel();
this.tlpMain.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.panelSearch.SuspendLayout();
@ -52,6 +54,7 @@
((System.ComponentModel.ISupportInitialize)(this.picSearchNext)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picSearchPrevious)).BeginInit();
this.flowLayoutPanel2.SuspendLayout();
this.statusStrip.SuspendLayout();
this.SuspendLayout();
//
// tlpMain
@ -63,12 +66,13 @@
this.tlpMain.Controls.Add(this.ctrlHexBox, 0, 1);
this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpMain.Location = new System.Drawing.Point(0, 0);
this.tlpMain.Margin = new System.Windows.Forms.Padding(0);
this.tlpMain.Name = "tlpMain";
this.tlpMain.RowCount = 3;
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpMain.Size = new System.Drawing.Size(543, 309);
this.tlpMain.Size = new System.Drawing.Size(543, 287);
this.tlpMain.TabIndex = 0;
//
// flowLayoutPanel1
@ -114,7 +118,7 @@
this.panelSearch.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelSearch.Controls.Add(this.tableLayoutPanel2);
this.panelSearch.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelSearch.Location = new System.Drawing.Point(3, 281);
this.panelSearch.Location = new System.Drawing.Point(3, 259);
this.panelSearch.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.panelSearch.Name = "panelSearch";
this.panelSearch.Size = new System.Drawing.Size(537, 28);
@ -249,23 +253,45 @@
this.ctrlHexBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ctrlHexBox.InfoBackColor = System.Drawing.Color.DarkGray;
this.ctrlHexBox.LineInfoVisible = true;
this.ctrlHexBox.Location = new System.Drawing.Point(3, 30);
this.ctrlHexBox.Location = new System.Drawing.Point(0, 27);
this.ctrlHexBox.Margin = new System.Windows.Forms.Padding(0);
this.ctrlHexBox.Name = "ctrlHexBox";
this.ctrlHexBox.SelectionBackColor = System.Drawing.Color.RoyalBlue;
this.ctrlHexBox.ShadowSelectionColor = System.Drawing.Color.Orange;
this.ctrlHexBox.Size = new System.Drawing.Size(537, 248);
this.ctrlHexBox.Size = new System.Drawing.Size(543, 232);
this.ctrlHexBox.StringViewVisible = true;
this.ctrlHexBox.TabIndex = 2;
this.ctrlHexBox.UseFixedBytesPerLine = true;
this.ctrlHexBox.VScrollBarVisible = true;
this.ctrlHexBox.SelectionStartChanged += new System.EventHandler(this.ctrlHexBox_SelectionStartChanged);
this.ctrlHexBox.SelectionLengthChanged += new System.EventHandler(this.ctrlHexBox_SelectionLengthChanged);
this.ctrlHexBox.MouseLeave += new System.EventHandler(this.ctrlHexBox_MouseLeave);
this.ctrlHexBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ctrlHexBox_MouseMove);
//
// statusStrip
//
this.statusStrip.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblLocation});
this.statusStrip.Location = new System.Drawing.Point(0, 287);
this.statusStrip.Name = "statusStrip";
this.statusStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.statusStrip.Size = new System.Drawing.Size(543, 22);
this.statusStrip.SizingGrip = false;
this.statusStrip.TabIndex = 1;
//
// lblLocation
//
this.lblLocation.Name = "lblLocation";
this.lblLocation.Size = new System.Drawing.Size(0, 17);
//
// ctrlHexViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tlpMain);
this.Controls.Add(this.statusStrip);
this.Margin = new System.Windows.Forms.Padding(0);
this.Name = "ctrlHexViewer";
this.Size = new System.Drawing.Size(543, 309);
this.tlpMain.ResumeLayout(false);
@ -280,7 +306,10 @@
((System.ComponentModel.ISupportInitialize)(this.picSearchPrevious)).EndInit();
this.flowLayoutPanel2.ResumeLayout(false);
this.flowLayoutPanel2.PerformLayout();
this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -302,5 +331,7 @@
private System.Windows.Forms.Label lblSearchWarning;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
private System.Windows.Forms.CheckBox chkMatchCase;
private System.Windows.Forms.StatusStrip statusStrip;
private System.Windows.Forms.ToolStripStatusLabel lblLocation;
}
}

View file

@ -347,5 +347,24 @@ namespace Mesen.GUI.Debugger.Controls
{
ByteMouseHover?.Invoke(-1);
}
private void UpdateLocationLabel()
{
if(ctrlHexBox.SelectionLength > 0) {
this.lblLocation.Text = $"Selection: ${ctrlHexBox.SelectionStart.ToString("X4")} - ${(ctrlHexBox.SelectionStart + ctrlHexBox.SelectionLength - 1).ToString("X4")} ({ctrlHexBox.SelectionLength} bytes)";
} else {
this.lblLocation.Text = $"Location: ${ctrlHexBox.SelectionStart.ToString("X4")}";
}
}
private void ctrlHexBox_SelectionStartChanged(object sender, EventArgs e)
{
UpdateLocationLabel();
}
private void ctrlHexBox_SelectionLengthChanged(object sender, EventArgs e)
{
UpdateLocationLabel();
}
}
}

View file

@ -120,4 +120,7 @@
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
</metadata>
</root>

View file

@ -33,21 +33,21 @@
this.cboMemoryType = new System.Windows.Forms.ComboBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.ctrlScrollableTextbox = new Mesen.GUI.Debugger.ctrlScrollableTextbox();
this.chkHighlightUninitRead = new System.Windows.Forms.CheckBox();
this.btnReset = new System.Windows.Forms.Button();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.picHelp = new System.Windows.Forms.PictureBox();
this.chkHighlightUninitRead = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.lblSort = new System.Windows.Forms.Label();
this.cboSort = new System.Windows.Forms.ComboBox();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.picHelp = new System.Windows.Forms.PictureBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.flowLayoutPanel1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picHelp)).BeginInit();
this.tableLayoutPanel2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// flowLayoutPanel1
@ -99,6 +99,7 @@
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -114,15 +115,56 @@
this.tableLayoutPanel1.SetColumnSpan(this.ctrlScrollableTextbox, 2);
this.ctrlScrollableTextbox.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlScrollableTextbox.FontSize = 13F;
this.ctrlScrollableTextbox.Location = new System.Drawing.Point(3, 30);
this.ctrlScrollableTextbox.Location = new System.Drawing.Point(0, 27);
this.ctrlScrollableTextbox.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.ctrlScrollableTextbox.Name = "ctrlScrollableTextbox";
this.ctrlScrollableTextbox.ShowContentNotes = false;
this.ctrlScrollableTextbox.ShowLineNumberNotes = false;
this.ctrlScrollableTextbox.ShowSingleContentLineNotes = true;
this.ctrlScrollableTextbox.ShowSingleLineLineNumberNotes = false;
this.ctrlScrollableTextbox.Size = new System.Drawing.Size(508, 245);
this.ctrlScrollableTextbox.Size = new System.Drawing.Size(514, 251);
this.ctrlScrollableTextbox.TabIndex = 0;
//
// btnReset
//
this.btnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnReset.Location = new System.Drawing.Point(436, 281);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(75, 23);
this.btnReset.TabIndex = 5;
this.btnReset.Text = "Reset Counts";
this.btnReset.UseVisualStyleBackColor = true;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 3;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Controls.Add(this.picHelp, 1, 0);
this.tableLayoutPanel3.Controls.Add(this.chkHighlightUninitRead, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 278);
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 1;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 29F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(433, 29);
this.tableLayoutPanel3.TabIndex = 2;
//
// picHelp
//
this.picHelp.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.picHelp.Image = global::Mesen.GUI.Properties.Resources.Help;
this.picHelp.Location = new System.Drawing.Point(201, 6);
this.picHelp.Name = "picHelp";
this.picHelp.Size = new System.Drawing.Size(16, 16);
this.picHelp.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picHelp.TabIndex = 5;
this.picHelp.TabStop = false;
//
// chkHighlightUninitRead
//
this.chkHighlightUninitRead.Anchor = System.Windows.Forms.AnchorStyles.Left;
@ -135,17 +177,6 @@
this.chkHighlightUninitRead.UseVisualStyleBackColor = true;
this.chkHighlightUninitRead.CheckedChanged += new System.EventHandler(this.chkHighlightUninitRead_CheckedChanged);
//
// btnReset
//
this.btnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnReset.Location = new System.Drawing.Point(436, 281);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(75, 23);
this.btnReset.TabIndex = 5;
this.btnReset.Text = "Reset Counts";
this.btnReset.UseVisualStyleBackColor = true;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.AutoSize = true;
@ -205,35 +236,6 @@
this.cboSort.TabIndex = 1;
this.cboSort.SelectedIndexChanged += new System.EventHandler(this.cboSort_SelectedIndexChanged);
//
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 3;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.Controls.Add(this.picHelp, 1, 0);
this.tableLayoutPanel3.Controls.Add(this.chkHighlightUninitRead, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 278);
this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 1;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(433, 29);
this.tableLayoutPanel3.TabIndex = 2;
//
// picHelp
//
this.picHelp.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.picHelp.Image = global::Mesen.GUI.Properties.Resources.Help;
this.picHelp.Location = new System.Drawing.Point(201, 6);
this.picHelp.Name = "picHelp";
this.picHelp.Size = new System.Drawing.Size(16, 16);
this.picHelp.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.picHelp.TabIndex = 5;
this.picHelp.TabStop = false;
//
// toolTip
//
this.toolTip.AutomaticDelay = 0;
@ -253,13 +255,13 @@
this.flowLayoutPanel1.PerformLayout();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picHelp)).EndInit();
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.flowLayoutPanel2.ResumeLayout(false);
this.flowLayoutPanel2.PerformLayout();
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picHelp)).EndInit();
this.ResumeLayout(false);
}

View file

@ -50,6 +50,7 @@
this.tableLayoutPanel1.Controls.Add(this.lstFunctions, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -93,9 +94,10 @@
this.lstFunctions.FullRowSelect = true;
this.lstFunctions.GridLines = true;
this.lstFunctions.HideSelection = false;
this.lstFunctions.Location = new System.Drawing.Point(3, 3);
this.lstFunctions.Location = new System.Drawing.Point(0, 0);
this.lstFunctions.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.lstFunctions.Name = "lstFunctions";
this.lstFunctions.Size = new System.Drawing.Size(508, 272);
this.lstFunctions.Size = new System.Drawing.Size(514, 278);
this.lstFunctions.TabIndex = 7;
this.lstFunctions.UseCompatibleStateImageBehavior = false;
this.lstFunctions.View = System.Windows.Forms.View.Details;
@ -132,6 +134,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tableLayoutPanel1);
this.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.Name = "ctrlProfiler";
this.Size = new System.Drawing.Size(514, 307);
this.tableLayoutPanel1.ResumeLayout(false);

View file

@ -113,6 +113,7 @@
//
this.ctrlHexViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlHexViewer.Location = new System.Drawing.Point(0, 0);
this.ctrlHexViewer.Margin = new System.Windows.Forms.Padding(0);
this.ctrlHexViewer.Name = "ctrlHexViewer";
this.ctrlHexViewer.Size = new System.Drawing.Size(606, 318);
this.ctrlHexViewer.TabIndex = 0;
@ -605,11 +606,14 @@
//
// toolStrip1
//
this.toolStrip1.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnImport,
this.btnExport});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.toolStrip1.Size = new System.Drawing.Size(606, 25);
this.toolStrip1.TabIndex = 3;
this.toolStrip1.Text = "toolStrip1";
@ -650,6 +654,7 @@
this.tpgMemoryViewer.Controls.Add(this.panel1);
this.tpgMemoryViewer.Controls.Add(this.toolStrip1);
this.tpgMemoryViewer.Location = new System.Drawing.Point(4, 22);
this.tpgMemoryViewer.Margin = new System.Windows.Forms.Padding(0);
this.tpgMemoryViewer.Name = "tpgMemoryViewer";
this.tpgMemoryViewer.Size = new System.Drawing.Size(606, 343);
this.tpgMemoryViewer.TabIndex = 0;
@ -662,6 +667,7 @@
this.panel1.Controls.Add(this.ctrlHexViewer);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 25);
this.panel1.Margin = new System.Windows.Forms.Padding(0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(606, 318);
this.panel1.TabIndex = 4;
@ -670,6 +676,7 @@
//
this.tpgAccessCounters.Controls.Add(this.ctrlMemoryAccessCounters);
this.tpgAccessCounters.Location = new System.Drawing.Point(4, 22);
this.tpgAccessCounters.Margin = new System.Windows.Forms.Padding(0);
this.tpgAccessCounters.Name = "tpgAccessCounters";
this.tpgAccessCounters.Size = new System.Drawing.Size(606, 343);
this.tpgAccessCounters.TabIndex = 1;
@ -689,6 +696,7 @@
//
this.tpgProfiler.Controls.Add(this.ctrlProfiler);
this.tpgProfiler.Location = new System.Drawing.Point(4, 22);
this.tpgProfiler.Margin = new System.Windows.Forms.Padding(0);
this.tpgProfiler.Name = "tpgProfiler";
this.tpgProfiler.Size = new System.Drawing.Size(606, 343);
this.tpgProfiler.TabIndex = 2;
@ -699,6 +707,7 @@
//
this.ctrlProfiler.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlProfiler.Location = new System.Drawing.Point(0, 0);
this.ctrlProfiler.Margin = new System.Windows.Forms.Padding(0);
this.ctrlProfiler.Name = "ctrlProfiler";
this.ctrlProfiler.Size = new System.Drawing.Size(606, 343);
this.ctrlProfiler.TabIndex = 0;