From 2308ba1ecc50869e4ffced179649abec0a27ba97 Mon Sep 17 00:00:00 2001 From: Thompson Lee Date: Fri, 8 Jul 2022 00:03:13 -0400 Subject: [PATCH] Added "Clear Output" button to Lua Console (squashed PR #3307) * Added "Clear Output" button to Lua Console tool. * Swapped out indentation from tabs to space from Line 248 through 249 for consistency. * Swapped out indentation from tabs to spaces for consistency. * Added a custom "Clear Console" icon to Bizhawk. --- .../Properties/Resources.cs | 1 + .../images/clear_console.png | Bin 0 -> 608 bytes .../tools/Lua/LuaConsole.Designer.cs | 22 +++++++++++++++++- .../tools/Lua/LuaConsole.cs | 6 +++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/BizHawk.Client.EmuHawk/images/clear_console.png diff --git a/src/BizHawk.Client.EmuHawk/Properties/Resources.cs b/src/BizHawk.Client.EmuHawk/Properties/Resources.cs index a2a7f662f7..896112e818 100644 --- a/src/BizHawk.Client.EmuHawk/Properties/Resources.cs +++ b/src/BizHawk.Client.EmuHawk/Properties/Resources.cs @@ -69,6 +69,7 @@ namespace BizHawk.Client.EmuHawk.Properties internal static readonly Icon CdLoggerIcon = ReadEmbeddedIcon("cdlogger"); internal static readonly Bitmap Checkbox = ReadEmbeddedBitmap("checkbox"); internal static readonly Bitmap Circle = ReadEmbeddedBitmap("Circle"); + internal static readonly Bitmap ClearConsole = ReadEmbeddedBitmap("clear_console"); internal static readonly Bitmap Close = ReadEmbeddedBitmap("Close"); internal static readonly Icon CommandWindow = ReadEmbeddedIcon("commandWindow"); internal static readonly Bitmap Connect16X16 = ReadEmbeddedBitmap("connect_16x16"); diff --git a/src/BizHawk.Client.EmuHawk/images/clear_console.png b/src/BizHawk.Client.EmuHawk/images/clear_console.png new file mode 100644 index 0000000000000000000000000000000000000000..2d76c5d110567045e417b112fa8e702bb71f80a8 GIT binary patch literal 608 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=>?NMQuI$g)*~KiFw=%bg0)@m& zTq8BS5TjJrKu978JRyq#t1#o{Q?D($Q+Xxx5O z-lpMV(?szP5>>3hhQb$5XwNt)mwdC=rcvF%;G)Zfi(GDOx!bzu-Tb#I{ntV7CDniL zElyu8e(Y-ax!#)=47oB5W_%9P>8nnUJ7X^H%v zUpaUpmoi8-TzkRIaqc8HbFuBUL-&5l1^oT-XU(ZgQy($({1en*y}+==i*ciLzyGpj zbM`bWTp=Q``(x!klc!Hud0aud!!#Ajlx@GCwq2k;l_|;mQt|#f%vC{}4QvZSxjOFd zc(?PP(cV8>(|kWM1-*LtI^^qiiPXS`6|y_le^A=|z2WfFv-|&R9;|&>o4wVjmdWJc zt`_l`dJbE(60Uzx`pmi}`h~=mjH?~5js8i^v}2sr5bJFa-Jn0i=JUSiayvPe{^PvO zcklT0c;(IN3v}Zj?DH~+b|}8%oNTZ~O=UByO7IKWS&?q{M`Tm literal 0 HcmV?d00001 diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs index 75c65ba2e6..b190147879 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs @@ -60,6 +60,7 @@ namespace BizHawk.Client.EmuHawk this.EditScriptMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.RemoveScriptMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.DuplicateScriptMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); + this.ClearConsoleMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.toolStripSeparator7 = new BizHawk.WinForms.Controls.ToolStripSeparatorEx(); this.InsertSeparatorMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.MoveUpMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); @@ -100,6 +101,7 @@ namespace BizHawk.Client.EmuHawk this.EditToolbarItem = new System.Windows.Forms.ToolStripButton(); this.RemoveScriptToolbarItem = new System.Windows.Forms.ToolStripButton(); this.DuplicateToolbarButton = new System.Windows.Forms.ToolStripButton(); + this.ClearConsoleToolbarButton = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator2 = new BizHawk.WinForms.Controls.ToolStripSeparatorEx(); this.MoveUpToolbarItem = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonMoveDown = new System.Windows.Forms.ToolStripButton(); @@ -243,6 +245,7 @@ namespace BizHawk.Client.EmuHawk this.EditScriptMenuItem, this.RemoveScriptMenuItem, this.DuplicateScriptMenuItem, + this.ClearConsoleMenuItem, this.toolStripSeparator7, this.InsertSeparatorMenuItem, this.MoveUpMenuItem, @@ -300,6 +303,11 @@ namespace BizHawk.Client.EmuHawk this.DuplicateScriptMenuItem.Text = "&Duplicate Script"; this.DuplicateScriptMenuItem.Click += new System.EventHandler(this.DuplicateScriptMenuItem_Click); // + // ClearConsoleMenuItem + // + this.ClearConsoleMenuItem.Text = "&Clear Output"; + this.ClearConsoleMenuItem.Click += new System.EventHandler(this.ClearConsoleMenuItem_Click); + // // InsertSeparatorMenuItem // this.InsertSeparatorMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); @@ -500,6 +508,7 @@ namespace BizHawk.Client.EmuHawk this.EditToolbarItem, this.RemoveScriptToolbarItem, this.DuplicateToolbarButton, + this.ClearConsoleToolbarButton, this.toolStripSeparator2, this.MoveUpToolbarItem, this.toolStripButtonMoveDown, @@ -582,6 +591,15 @@ namespace BizHawk.Client.EmuHawk this.DuplicateToolbarButton.Text = "Duplicate Script"; this.DuplicateToolbarButton.Click += new System.EventHandler(this.DuplicateScriptMenuItem_Click); // + // ClearConsoleToolbarButton + // + this.ClearConsoleToolbarButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.ClearConsoleToolbarButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.ClearConsoleToolbarButton.Name = "ClearConsoleToolbarButton"; + this.ClearConsoleToolbarButton.Size = new System.Drawing.Size(23, 22); + this.ClearConsoleToolbarButton.Text = "Clear Output"; + this.ClearConsoleToolbarButton.Click += new System.EventHandler(this.ClearConsoleMenuItem_Click); + // // MoveUpToolbarItem // this.MoveUpToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; @@ -765,8 +783,10 @@ namespace BizHawk.Client.EmuHawk private BizHawk.WinForms.Controls.ToolStripSeparatorEx toolStripSeparator10; private System.Windows.Forms.ToolStripButton EraseToolbarItem; private System.Windows.Forms.ToolStripButton DuplicateToolbarButton; + private System.Windows.Forms.ToolStripButton ClearConsoleToolbarButton; private BizHawk.WinForms.Controls.ToolStripMenuItemEx DuplicateScriptMenuItem; - private System.Windows.Forms.TextBox InputBox; + private BizHawk.WinForms.Controls.ToolStripMenuItemEx ClearConsoleMenuItem; + private System.Windows.Forms.TextBox InputBox; private System.Windows.Forms.SplitContainer splitContainer1; private BizHawk.WinForms.Controls.ToolStripMenuItemEx ReturnAllIfNoneSelectedMenuItem; private BizHawk.WinForms.Controls.ToolStripMenuItemEx ReloadWhenScriptFileChangesMenuItem; diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index 115d55aa9c..8af3a87536 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -107,6 +107,7 @@ namespace BizHawk.Client.EmuHawk EditToolbarItem.Image = Resources.Cut; RemoveScriptToolbarItem.Image = Resources.Delete; DuplicateToolbarButton.Image = Resources.Duplicate; + ClearConsoleToolbarButton.Image = Resources.ClearConsole; MoveUpToolbarItem.Image = Resources.MoveUp; toolStripButtonMoveDown.Image = Resources.MoveDown; InsertSeparatorToolbarItem.Image = Resources.InsertSeparator; @@ -1022,6 +1023,11 @@ namespace BizHawk.Client.EmuHawk } } + private void ClearConsoleMenuItem_Click(object sender, EventArgs e) + { + ClearOutputWindow(); + } + private void InsertSeparatorMenuItem_Click(object sender, EventArgs e) { LuaImp.ScriptList.Insert(LuaListView.SelectionStartIndex ?? LuaImp.ScriptList.Count, LuaFile.SeparatorInstance);