From 56cb9d59f7f0c70b6203e691d95117c636b0a42b Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Wed, 23 Feb 2011 04:30:50 +0000 Subject: [PATCH] Ram Search - menu item + toolstrip - Copy Value to Prev --- .../BizHawk.MultiClient.csproj | 1 + .../Properties/Resources.Designer.cs | 7 ++++ BizHawk.MultiClient/Properties/Resources.resx | 3 ++ .../tools/RamSearch.Designer.cs | 39 +++++++++++++++---- BizHawk.MultiClient/tools/RamSearch.cs | 26 +++++++++++-- BizHawk.MultiClient/tools/RamSearch.resx | 6 +-- 6 files changed, 67 insertions(+), 15 deletions(-) diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index fee5057a26..b8ba4e60b4 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -313,6 +313,7 @@ + diff --git a/BizHawk.MultiClient/Properties/Resources.Designer.cs b/BizHawk.MultiClient/Properties/Resources.Designer.cs index 872b7615af..956ba26de1 100644 --- a/BizHawk.MultiClient/Properties/Resources.Designer.cs +++ b/BizHawk.MultiClient/Properties/Resources.Designer.cs @@ -136,6 +136,13 @@ namespace BizHawk.MultiClient.Properties { } } + internal static System.Drawing.Bitmap Refresh { + get { + object obj = ResourceManager.GetObject("Refresh", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap restart { get { object obj = ResourceManager.GetObject("restart", resourceCulture); diff --git a/BizHawk.MultiClient/Properties/Resources.resx b/BizHawk.MultiClient/Properties/Resources.resx index b3815f8a17..a755b68d31 100644 --- a/BizHawk.MultiClient/Properties/Resources.resx +++ b/BizHawk.MultiClient/Properties/Resources.resx @@ -588,6 +588,9 @@ AFNvdW5kIEZvcmdlIDIuMDtTb25pYyBGb3VuZHJ5IFNvdW5kIEZvcmdlIDUuMAAL + + ..\images\Refresh.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\images\TruncateFromFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/BizHawk.MultiClient/tools/RamSearch.Designer.cs b/BizHawk.MultiClient/tools/RamSearch.Designer.cs index af49003241..fb75798238 100644 --- a/BizHawk.MultiClient/tools/RamSearch.Designer.cs +++ b/BizHawk.MultiClient/tools/RamSearch.Designer.cs @@ -77,10 +77,12 @@ this.restoreOriginalWindowSizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.previewModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.alwaysExludeRamSearchListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.NewSearchtoolStripButton = new System.Windows.Forms.ToolStripButton(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.SetCurrToPrevtoolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.ClearChangeCountstoolStripButton = new System.Windows.Forms.ToolStripButton(); this.UndotoolStripButton = new System.Windows.Forms.ToolStripButton(); this.toolStrip2 = new System.Windows.Forms.ToolStrip(); @@ -118,7 +120,7 @@ this.AutoSearchCheckBox = new System.Windows.Forms.CheckBox(); this.MemDomainLabel = new System.Windows.Forms.Label(); this.OutputLabel = new System.Windows.Forms.Label(); - this.alwaysExludeRamSearchListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyValueToPrevToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SearchtoolStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.toolStripContainer1.TopToolStripPanel.SuspendLayout(); @@ -414,8 +416,9 @@ // this.searchToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.searchToolStripMenuItem1, - this.clearChangeCountsToolStripMenuItem, this.undoToolStripMenuItem, + this.copyValueToPrevToolStripMenuItem, + this.clearChangeCountsToolStripMenuItem, this.removeSelectedToolStripMenuItem, this.exludeRamWatchListToolStripMenuItem, this.toolStripSeparator5, @@ -545,6 +548,13 @@ this.previewModeToolStripMenuItem.Text = "Preview Mode"; this.previewModeToolStripMenuItem.Click += new System.EventHandler(this.previewModeToolStripMenuItem_Click); // + // alwaysExludeRamSearchListToolStripMenuItem + // + this.alwaysExludeRamSearchListToolStripMenuItem.Name = "alwaysExludeRamSearchListToolStripMenuItem"; + this.alwaysExludeRamSearchListToolStripMenuItem.Size = new System.Drawing.Size(233, 22); + this.alwaysExludeRamSearchListToolStripMenuItem.Text = "Always Exlude Ram Search List"; + this.alwaysExludeRamSearchListToolStripMenuItem.Click += new System.EventHandler(this.alwaysExludeRamSearchListToolStripMenuItem_Click); + // // toolStripContainer1 // this.toolStripContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -571,11 +581,12 @@ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.NewSearchtoolStripButton, this.toolStripButton1, + this.SetCurrToPrevtoolStripButton2, this.ClearChangeCountstoolStripButton, this.UndotoolStripButton}); this.toolStrip1.Location = new System.Drawing.Point(3, 25); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(102, 25); + this.toolStrip1.Size = new System.Drawing.Size(125, 25); this.toolStrip1.TabIndex = 1; // // NewSearchtoolStripButton @@ -598,6 +609,16 @@ this.toolStripButton1.Text = "Search"; this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); // + // SetCurrToPrevtoolStripButton2 + // + this.SetCurrToPrevtoolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.SetCurrToPrevtoolStripButton2.Image = global::BizHawk.MultiClient.Properties.Resources.Refresh; + this.SetCurrToPrevtoolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; + this.SetCurrToPrevtoolStripButton2.Name = "SetCurrToPrevtoolStripButton2"; + this.SetCurrToPrevtoolStripButton2.Size = new System.Drawing.Size(23, 22); + this.SetCurrToPrevtoolStripButton2.Text = "Copy Value to Prev"; + this.SetCurrToPrevtoolStripButton2.Click += new System.EventHandler(this.SetCurrToPrevtoolStripButton2_Click); + // // ClearChangeCountstoolStripButton // this.ClearChangeCountstoolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; @@ -996,12 +1017,12 @@ this.OutputLabel.TabIndex = 9; this.OutputLabel.Text = " "; // - // alwaysExludeRamSearchListToolStripMenuItem + // copyValueToPrevToolStripMenuItem // - this.alwaysExludeRamSearchListToolStripMenuItem.Name = "alwaysExludeRamSearchListToolStripMenuItem"; - this.alwaysExludeRamSearchListToolStripMenuItem.Size = new System.Drawing.Size(233, 22); - this.alwaysExludeRamSearchListToolStripMenuItem.Text = "Always Exlude Ram Search List"; - this.alwaysExludeRamSearchListToolStripMenuItem.Click += new System.EventHandler(this.alwaysExludeRamSearchListToolStripMenuItem_Click); + this.copyValueToPrevToolStripMenuItem.Name = "copyValueToPrevToolStripMenuItem"; + this.copyValueToPrevToolStripMenuItem.Size = new System.Drawing.Size(218, 22); + this.copyValueToPrevToolStripMenuItem.Text = "Copy Value to Prev"; + this.copyValueToPrevToolStripMenuItem.Click += new System.EventHandler(this.copyValueToPrevToolStripMenuItem_Click); // // RamSearch // @@ -1137,5 +1158,7 @@ private System.Windows.Forms.ToolStripButton ExcludeRamWatchtoolStripButton2; private System.Windows.Forms.ToolStripMenuItem exludeRamWatchListToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem alwaysExludeRamSearchListToolStripMenuItem; + private System.Windows.Forms.ToolStripButton SetCurrToPrevtoolStripButton2; + private System.Windows.Forms.ToolStripMenuItem copyValueToPrevToolStripMenuItem; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 348ffc8a74..670d1b4543 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -20,9 +20,6 @@ namespace BizHawk.MultiClient //DoSearch() - if already previewed, don't generate the list again, perhaps a bool? //Window position gets saved but doesn't load properly //Multiple memory domains - //Save Dialog - user cancelling crashes, same for Ram Watch? - //Add button to set copy current values to prev - //After search everything goes pink //**Limit number of digits in specific value based on data type, allow negative sign if signed values, and hex if hex values! //Search equal to previous value, eveyrthing will be pink afterward @@ -1528,7 +1525,28 @@ namespace BizHawk.MultiClient { Global.Config.AlwaysExludeRamWatch ^= true; } - + + private void CopyValueToPrev() + { + for (int x = 0; x < searchList.Count; x++) + { + prevList[x].value = searchList[x].value; + searchList[x].prev = searchList[x].value; + } + DisplaySearchList(); + DoPreview(); + } + + private void SetCurrToPrevtoolStripButton2_Click(object sender, EventArgs e) + { + CopyValueToPrev(); + } + + private void copyValueToPrevToolStripMenuItem_Click(object sender, EventArgs e) + { + CopyValueToPrev(); + } + } diff --git a/BizHawk.MultiClient/tools/RamSearch.resx b/BizHawk.MultiClient/tools/RamSearch.resx index b954ff8d17..1f988f2974 100644 --- a/BizHawk.MultiClient/tools/RamSearch.resx +++ b/BizHawk.MultiClient/tools/RamSearch.resx @@ -160,6 +160,9 @@ 259, 17 + + 358, 17 + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -191,9 +194,6 @@ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC - - 358, 17 - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8