Debugger: Find All Occurrences search
This commit is contained in:
parent
c1a6453343
commit
a86eaa0911
11 changed files with 372 additions and 24 deletions
|
@ -96,6 +96,10 @@ namespace Mesen.GUI.Config
|
|||
public bool BreakInPpuCycles = false;
|
||||
|
||||
public bool HighlightUnexecutedCode = true;
|
||||
|
||||
public bool FindOccurrencesMatchCase = false;
|
||||
public bool FindOccurrencesMatchWholeWord = false;
|
||||
public string FindOccurrencesLastSearch = string.Empty;
|
||||
|
||||
public DebugInfo()
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
this.mnuNavigateBackward,
|
||||
this.mnuNavigateForward});
|
||||
this.contextMenuCode.Name = "contextMenuWatch";
|
||||
this.contextMenuCode.Size = new System.Drawing.Size(259, 270);
|
||||
this.contextMenuCode.Size = new System.Drawing.Size(259, 248);
|
||||
this.contextMenuCode.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuCode_Opening);
|
||||
//
|
||||
// mnuShowNextStatement
|
||||
|
@ -293,6 +293,7 @@
|
|||
this.lstSearchResult.TabIndex = 9;
|
||||
this.lstSearchResult.UseCompatibleStateImageBehavior = false;
|
||||
this.lstSearchResult.View = System.Windows.Forms.View.Details;
|
||||
this.lstSearchResult.SizeChanged += new System.EventHandler(this.lstSearchResult_SizeChanged);
|
||||
this.lstSearchResult.DoubleClick += new System.EventHandler(this.lstSearchResult_DoubleClick);
|
||||
//
|
||||
// columnHeader1
|
||||
|
|
|
@ -466,22 +466,30 @@ namespace Mesen.GUI.Debugger
|
|||
|
||||
private void mnuFindOccurrences_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.FindAllOccurrences(_lastWord);
|
||||
this.FindAllOccurrences(_lastWord, true, true);
|
||||
}
|
||||
|
||||
public void FindAllOccurrences(string text)
|
||||
public void FindAllOccurrences(string text, bool matchWholeWord, bool matchCase)
|
||||
{
|
||||
this.lstSearchResult.Items.Clear();
|
||||
foreach(Tuple<int, int, string> searchResult in this.ctrlCodeViewer.FindAllOccurrences(text)) {
|
||||
foreach(Tuple<int, int, string> searchResult in this.ctrlCodeViewer.FindAllOccurrences(text, matchWholeWord, matchCase)) {
|
||||
var item = this.lstSearchResult.Items.Add(searchResult.Item1.ToString("X4"));
|
||||
item.Tag = searchResult.Item2;
|
||||
item.SubItems.Add(searchResult.Item3);
|
||||
item.SubItems.Add("");
|
||||
}
|
||||
this.lblSearchResult.Text = $"Search results for: {text} ({this.lstSearchResult.Items.Count} results)";
|
||||
this.lstSearchResult.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
|
||||
this.lstSearchResult.Columns[0].Width += 20;
|
||||
this.lstSearchResult.Columns[1].Width = Math.Max(this.lstSearchResult.Columns[1].Width, this.lstSearchResult.Width - this.lstSearchResult.Columns[0].Width - 4);
|
||||
this.splitContainer.Panel2Collapsed = false;
|
||||
}
|
||||
|
||||
private void lstSearchResult_SizeChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.lstSearchResult.Columns[1].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
|
||||
this.lstSearchResult.Columns[1].Width = Math.Max(this.lstSearchResult.Columns[1].Width, this.lstSearchResult.Width - this.lstSearchResult.Columns[0].Width - 4);
|
||||
}
|
||||
|
||||
private void picCloseOccurrenceList_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
|
|
@ -371,9 +371,9 @@ namespace Mesen.GUI.Debugger
|
|||
}
|
||||
}
|
||||
|
||||
public List<Tuple<int, int, string>> FindAllOccurrences(string text)
|
||||
public List<Tuple<int, int, string>> FindAllOccurrences(string text, bool matchWholeWord, bool matchCase)
|
||||
{
|
||||
return this.ctrlTextbox.FindAllOccurrences(text);
|
||||
return this.ctrlTextbox.FindAllOccurrences(text, matchWholeWord, matchCase);
|
||||
}
|
||||
|
||||
public void NavigateForward()
|
||||
|
|
|
@ -207,18 +207,18 @@ namespace Mesen.GUI.Debugger
|
|||
}
|
||||
}
|
||||
|
||||
public List<Tuple<int, int, string>> FindAllOccurrences(string text)
|
||||
public List<Tuple<int, int, string>> FindAllOccurrences(string text, bool matchWholeWord, bool matchCase)
|
||||
{
|
||||
List<Tuple<int, int, string>> result = new List<Tuple<int, int, string>>();
|
||||
string regex;
|
||||
if(text.StartsWith("$")) {
|
||||
regex = $"[^#]+\\$\\b{text.Substring(1, text.Length - 1)}\\b";
|
||||
if(matchWholeWord) {
|
||||
regex = $"[^0-9a-zA-Z_#@]+{Regex.Escape(text)}[^0-9a-zA-Z_#@]+";
|
||||
} else {
|
||||
regex = $"\\b{text}\\b";
|
||||
regex = Regex.Escape(text);
|
||||
}
|
||||
|
||||
for(int i = 0, len = _contents.Length; i < len; i++) {
|
||||
if(Regex.IsMatch(_contents[i], regex, RegexOptions.IgnoreCase)) {
|
||||
if(Regex.IsMatch(_contents[i], regex, matchCase ? RegexOptions.None : RegexOptions.IgnoreCase)) {
|
||||
string line = _contents[i].Replace("\x2", "\t").Trim();
|
||||
|
||||
if(line.StartsWith("__") && line.EndsWith("__") || line.StartsWith("[[") && line.EndsWith("]]")) {
|
||||
|
|
42
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
42
GUI.NET/Debugger/frmDebugger.Designer.cs
generated
|
@ -82,11 +82,13 @@
|
|||
this.mnuFind = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuFindNext = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuFindPrev = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mnuGoTo = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuGoToAddress = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuGoToIrqHandler = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuGoToNmiHandler = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuGoToResetHandler = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuFindAllOccurrences = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuOptions = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuSplitView = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fontSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -424,14 +426,14 @@
|
|||
this.mnuSaveWorkspace,
|
||||
this.mnuResetWorkspace});
|
||||
this.mnuWorkspace.Name = "mnuWorkspace";
|
||||
this.mnuWorkspace.Size = new System.Drawing.Size(132, 22);
|
||||
this.mnuWorkspace.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuWorkspace.Text = "Workspace";
|
||||
//
|
||||
// mnuImportLabels
|
||||
//
|
||||
this.mnuImportLabels.Image = global::Mesen.GUI.Properties.Resources.Import;
|
||||
this.mnuImportLabels.Name = "mnuImportLabels";
|
||||
this.mnuImportLabels.Size = new System.Drawing.Size(146, 22);
|
||||
this.mnuImportLabels.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuImportLabels.Text = "Import Labels";
|
||||
this.mnuImportLabels.Click += new System.EventHandler(this.mnuImportLabels_Click);
|
||||
//
|
||||
|
@ -440,7 +442,7 @@
|
|||
this.mnuSaveWorkspace.Image = global::Mesen.GUI.Properties.Resources.Floppy;
|
||||
this.mnuSaveWorkspace.Name = "mnuSaveWorkspace";
|
||||
this.mnuSaveWorkspace.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
|
||||
this.mnuSaveWorkspace.Size = new System.Drawing.Size(146, 22);
|
||||
this.mnuSaveWorkspace.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuSaveWorkspace.Text = "Save";
|
||||
this.mnuSaveWorkspace.Click += new System.EventHandler(this.mnuSaveWorkspace_Click);
|
||||
//
|
||||
|
@ -448,19 +450,19 @@
|
|||
//
|
||||
this.mnuResetWorkspace.Image = global::Mesen.GUI.Properties.Resources.Reset;
|
||||
this.mnuResetWorkspace.Name = "mnuResetWorkspace";
|
||||
this.mnuResetWorkspace.Size = new System.Drawing.Size(146, 22);
|
||||
this.mnuResetWorkspace.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuResetWorkspace.Text = "Reset";
|
||||
this.mnuResetWorkspace.Click += new System.EventHandler(this.mnuResetWorkspace_Click);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(129, 6);
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(149, 6);
|
||||
//
|
||||
// mnuClose
|
||||
//
|
||||
this.mnuClose.Name = "mnuClose";
|
||||
this.mnuClose.Size = new System.Drawing.Size(132, 22);
|
||||
this.mnuClose.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuClose.Text = "Close";
|
||||
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
|
||||
//
|
||||
|
@ -598,7 +600,9 @@
|
|||
this.mnuFind,
|
||||
this.mnuFindNext,
|
||||
this.mnuFindPrev,
|
||||
this.mnuGoTo});
|
||||
this.toolStripMenuItem9,
|
||||
this.mnuGoTo,
|
||||
this.mnuFindAllOccurrences});
|
||||
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
|
||||
this.searchToolStripMenuItem.Size = new System.Drawing.Size(54, 20);
|
||||
this.searchToolStripMenuItem.Text = "Search";
|
||||
|
@ -607,7 +611,7 @@
|
|||
//
|
||||
this.mnuFind.Name = "mnuFind";
|
||||
this.mnuFind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
|
||||
this.mnuFind.Size = new System.Drawing.Size(196, 22);
|
||||
this.mnuFind.Size = new System.Drawing.Size(255, 22);
|
||||
this.mnuFind.Text = "Find...";
|
||||
this.mnuFind.Click += new System.EventHandler(this.mnuFind_Click);
|
||||
//
|
||||
|
@ -615,7 +619,7 @@
|
|||
//
|
||||
this.mnuFindNext.Name = "mnuFindNext";
|
||||
this.mnuFindNext.ShortcutKeys = System.Windows.Forms.Keys.F3;
|
||||
this.mnuFindNext.Size = new System.Drawing.Size(196, 22);
|
||||
this.mnuFindNext.Size = new System.Drawing.Size(255, 22);
|
||||
this.mnuFindNext.Text = "Find Next";
|
||||
this.mnuFindNext.Click += new System.EventHandler(this.mnuFindNext_Click);
|
||||
//
|
||||
|
@ -623,10 +627,15 @@
|
|||
//
|
||||
this.mnuFindPrev.Name = "mnuFindPrev";
|
||||
this.mnuFindPrev.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F3)));
|
||||
this.mnuFindPrev.Size = new System.Drawing.Size(196, 22);
|
||||
this.mnuFindPrev.Size = new System.Drawing.Size(255, 22);
|
||||
this.mnuFindPrev.Text = "Find Previous";
|
||||
this.mnuFindPrev.Click += new System.EventHandler(this.mnuFindPrev_Click);
|
||||
//
|
||||
// toolStripMenuItem9
|
||||
//
|
||||
this.toolStripMenuItem9.Name = "toolStripMenuItem9";
|
||||
this.toolStripMenuItem9.Size = new System.Drawing.Size(252, 6);
|
||||
//
|
||||
// mnuGoTo
|
||||
//
|
||||
this.mnuGoTo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -635,7 +644,7 @@
|
|||
this.mnuGoToNmiHandler,
|
||||
this.mnuGoToResetHandler});
|
||||
this.mnuGoTo.Name = "mnuGoTo";
|
||||
this.mnuGoTo.Size = new System.Drawing.Size(196, 22);
|
||||
this.mnuGoTo.Size = new System.Drawing.Size(255, 22);
|
||||
this.mnuGoTo.Text = "Go To...";
|
||||
//
|
||||
// mnuGoToAddress
|
||||
|
@ -667,6 +676,15 @@
|
|||
this.mnuGoToResetHandler.Text = "Reset Handler";
|
||||
this.mnuGoToResetHandler.Click += new System.EventHandler(this.mnuGoToResetHandler_Click);
|
||||
//
|
||||
// mnuFindAllOccurrences
|
||||
//
|
||||
this.mnuFindAllOccurrences.Name = "mnuFindAllOccurrences";
|
||||
this.mnuFindAllOccurrences.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
|
||||
| System.Windows.Forms.Keys.F)));
|
||||
this.mnuFindAllOccurrences.Size = new System.Drawing.Size(255, 22);
|
||||
this.mnuFindAllOccurrences.Text = "Find All Occurrences";
|
||||
this.mnuFindAllOccurrences.Click += new System.EventHandler(this.mnuFindAllOccurrences_Click);
|
||||
//
|
||||
// mnuOptions
|
||||
//
|
||||
this.mnuOptions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -1095,5 +1113,7 @@
|
|||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem7;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem8;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuBreakIn;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem9;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuFindAllOccurrences;
|
||||
}
|
||||
}
|
|
@ -618,12 +618,12 @@ namespace Mesen.GUI.Debugger
|
|||
private void ctrlLabelList_OnFindOccurrence(object sender, EventArgs e)
|
||||
{
|
||||
CodeLabel label = sender as CodeLabel;
|
||||
_lastCodeWindow.FindAllOccurrences(label.Label);
|
||||
_lastCodeWindow.FindAllOccurrences(label.Label, true, true);
|
||||
}
|
||||
|
||||
private void ctrlFunctionList_OnFindOccurrence(object sender, EventArgs e)
|
||||
{
|
||||
_lastCodeWindow.FindAllOccurrences(sender as string);
|
||||
_lastCodeWindow.FindAllOccurrences(sender as string, true, true);
|
||||
}
|
||||
|
||||
private void mnuBreakIn_Click(object sender, EventArgs e)
|
||||
|
@ -632,5 +632,13 @@ namespace Mesen.GUI.Debugger
|
|||
frm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void mnuFindAllOccurrences_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmFindOccurrences frm = new Debugger.frmFindOccurrences();
|
||||
if(frm.ShowDialog() == DialogResult.OK) {
|
||||
_lastCodeWindow.FindAllOccurrences(frm.SearchString, frm.MatchWholeWord, frm.MatchCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
128
GUI.NET/Debugger/frmFindOccurrences.Designer.cs
generated
Normal file
128
GUI.NET/Debugger/frmFindOccurrences.Designer.cs
generated
Normal file
|
@ -0,0 +1,128 @@
|
|||
namespace Mesen.GUI.Debugger
|
||||
{
|
||||
partial class frmFindOccurrences
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if(disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.lblAddress = new System.Windows.Forms.Label();
|
||||
this.txtSearchString = new System.Windows.Forms.TextBox();
|
||||
this.chkMatchWholeWord = new System.Windows.Forms.CheckBox();
|
||||
this.chkMatchCase = new System.Windows.Forms.CheckBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// baseConfigPanel
|
||||
//
|
||||
this.baseConfigPanel.Location = new System.Drawing.Point(0, 73);
|
||||
this.baseConfigPanel.Size = new System.Drawing.Size(251, 29);
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblAddress, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtSearchString, 1, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.chkMatchWholeWord, 1, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.chkMatchCase, 1, 1);
|
||||
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 4;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(251, 102);
|
||||
this.tableLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// lblAddress
|
||||
//
|
||||
this.lblAddress.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||
this.lblAddress.AutoSize = true;
|
||||
this.lblAddress.Location = new System.Drawing.Point(3, 6);
|
||||
this.lblAddress.Name = "lblAddress";
|
||||
this.lblAddress.Size = new System.Drawing.Size(44, 13);
|
||||
this.lblAddress.TabIndex = 0;
|
||||
this.lblAddress.Text = "Search:";
|
||||
//
|
||||
// txtSearchString
|
||||
//
|
||||
this.txtSearchString.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtSearchString.Location = new System.Drawing.Point(53, 3);
|
||||
this.txtSearchString.MaxLength = 255;
|
||||
this.txtSearchString.Name = "txtSearchString";
|
||||
this.txtSearchString.Size = new System.Drawing.Size(195, 20);
|
||||
this.txtSearchString.TabIndex = 1;
|
||||
//
|
||||
// chkMatchWholeWord
|
||||
//
|
||||
this.chkMatchWholeWord.AutoSize = true;
|
||||
this.chkMatchWholeWord.Location = new System.Drawing.Point(53, 52);
|
||||
this.chkMatchWholeWord.Name = "chkMatchWholeWord";
|
||||
this.chkMatchWholeWord.Size = new System.Drawing.Size(113, 17);
|
||||
this.chkMatchWholeWord.TabIndex = 2;
|
||||
this.chkMatchWholeWord.Text = "Match whole word";
|
||||
this.chkMatchWholeWord.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkMatchCase
|
||||
//
|
||||
this.chkMatchCase.AutoSize = true;
|
||||
this.chkMatchCase.Location = new System.Drawing.Point(53, 29);
|
||||
this.chkMatchCase.Name = "chkMatchCase";
|
||||
this.chkMatchCase.Size = new System.Drawing.Size(82, 17);
|
||||
this.chkMatchCase.TabIndex = 3;
|
||||
this.chkMatchCase.Text = "Match case";
|
||||
this.chkMatchCase.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// frmFindOccurrences
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(251, 102);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.Name = "frmFindOccurrences";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Find All Occurrences";
|
||||
this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);
|
||||
this.Controls.SetChildIndex(this.baseConfigPanel, 0);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.Label lblAddress;
|
||||
private System.Windows.Forms.TextBox txtSearchString;
|
||||
private System.Windows.Forms.CheckBox chkMatchWholeWord;
|
||||
private System.Windows.Forms.CheckBox chkMatchCase;
|
||||
}
|
||||
}
|
47
GUI.NET/Debugger/frmFindOccurrences.cs
Normal file
47
GUI.NET/Debugger/frmFindOccurrences.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Mesen.GUI.Config;
|
||||
using Mesen.GUI.Forms;
|
||||
|
||||
namespace Mesen.GUI.Debugger
|
||||
{
|
||||
public partial class frmFindOccurrences : BaseConfigForm
|
||||
{
|
||||
public string SearchString { get { return txtSearchString.Text; } }
|
||||
public bool MatchWholeWord { get { return chkMatchWholeWord.Checked; } }
|
||||
public bool MatchCase { get { return chkMatchCase.Checked; } }
|
||||
|
||||
public frmFindOccurrences()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
txtSearchString.Text = ConfigManager.Config.DebugInfo.FindOccurrencesLastSearch;
|
||||
chkMatchWholeWord.Checked = ConfigManager.Config.DebugInfo.FindOccurrencesMatchWholeWord;
|
||||
chkMatchCase.Checked = ConfigManager.Config.DebugInfo.FindOccurrencesMatchCase;
|
||||
}
|
||||
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
txtSearchString.Focus();
|
||||
}
|
||||
|
||||
protected override void OnFormClosed(FormClosedEventArgs e)
|
||||
{
|
||||
base.OnFormClosed(e);
|
||||
if(DialogResult == DialogResult.OK) {
|
||||
ConfigManager.Config.DebugInfo.FindOccurrencesLastSearch = txtSearchString.Text;
|
||||
ConfigManager.Config.DebugInfo.FindOccurrencesMatchWholeWord = chkMatchWholeWord.Checked;
|
||||
ConfigManager.Config.DebugInfo.FindOccurrencesMatchCase = chkMatchCase.Checked;
|
||||
ConfigManager.ApplyChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
123
GUI.NET/Debugger/frmFindOccurrences.resx
Normal file
123
GUI.NET/Debugger/frmFindOccurrences.resx
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -386,6 +386,12 @@
|
|||
<Compile Include="Debugger\frmBreakIn.Designer.cs">
|
||||
<DependentUpon>frmBreakIn.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\frmFindOccurrences.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\frmFindOccurrences.Designer.cs">
|
||||
<DependentUpon>frmFindOccurrences.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Debugger\frmGoToLine.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -667,6 +673,9 @@
|
|||
<EmbeddedResource Include="Debugger\frmBreakIn.resx">
|
||||
<DependentUpon>frmBreakIn.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Debugger\frmFindOccurrences.resx">
|
||||
<DependentUpon>frmFindOccurrences.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Debugger\frmGoToLine.resx">
|
||||
<DependentUpon>frmGoToLine.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
Loading…
Add table
Reference in a new issue