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.
This commit is contained in:
Thompson Lee 2022-07-08 00:03:13 -04:00 committed by GitHub
parent bdcd37215c
commit 2308ba1ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 1 deletions

View File

@ -69,6 +69,7 @@ namespace BizHawk.Client.EmuHawk.Properties
internal static readonly Icon CdLoggerIcon = ReadEmbeddedIcon("cdlogger"); internal static readonly Icon CdLoggerIcon = ReadEmbeddedIcon("cdlogger");
internal static readonly Bitmap Checkbox = ReadEmbeddedBitmap("checkbox"); internal static readonly Bitmap Checkbox = ReadEmbeddedBitmap("checkbox");
internal static readonly Bitmap Circle = ReadEmbeddedBitmap("Circle"); 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 Bitmap Close = ReadEmbeddedBitmap("Close");
internal static readonly Icon CommandWindow = ReadEmbeddedIcon("commandWindow"); internal static readonly Icon CommandWindow = ReadEmbeddedIcon("commandWindow");
internal static readonly Bitmap Connect16X16 = ReadEmbeddedBitmap("connect_16x16"); internal static readonly Bitmap Connect16X16 = ReadEmbeddedBitmap("connect_16x16");

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

View File

@ -60,6 +60,7 @@ namespace BizHawk.Client.EmuHawk
this.EditScriptMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.EditScriptMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx();
this.RemoveScriptMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.RemoveScriptMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx();
this.DuplicateScriptMenuItem = 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.toolStripSeparator7 = new BizHawk.WinForms.Controls.ToolStripSeparatorEx();
this.InsertSeparatorMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx(); this.InsertSeparatorMenuItem = new BizHawk.WinForms.Controls.ToolStripMenuItemEx();
this.MoveUpMenuItem = 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.EditToolbarItem = new System.Windows.Forms.ToolStripButton();
this.RemoveScriptToolbarItem = new System.Windows.Forms.ToolStripButton(); this.RemoveScriptToolbarItem = new System.Windows.Forms.ToolStripButton();
this.DuplicateToolbarButton = 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.toolStripSeparator2 = new BizHawk.WinForms.Controls.ToolStripSeparatorEx();
this.MoveUpToolbarItem = new System.Windows.Forms.ToolStripButton(); this.MoveUpToolbarItem = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonMoveDown = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonMoveDown = new System.Windows.Forms.ToolStripButton();
@ -243,6 +245,7 @@ namespace BizHawk.Client.EmuHawk
this.EditScriptMenuItem, this.EditScriptMenuItem,
this.RemoveScriptMenuItem, this.RemoveScriptMenuItem,
this.DuplicateScriptMenuItem, this.DuplicateScriptMenuItem,
this.ClearConsoleMenuItem,
this.toolStripSeparator7, this.toolStripSeparator7,
this.InsertSeparatorMenuItem, this.InsertSeparatorMenuItem,
this.MoveUpMenuItem, this.MoveUpMenuItem,
@ -300,6 +303,11 @@ namespace BizHawk.Client.EmuHawk
this.DuplicateScriptMenuItem.Text = "&Duplicate Script"; this.DuplicateScriptMenuItem.Text = "&Duplicate Script";
this.DuplicateScriptMenuItem.Click += new System.EventHandler(this.DuplicateScriptMenuItem_Click); 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 // InsertSeparatorMenuItem
// //
this.InsertSeparatorMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); 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.EditToolbarItem,
this.RemoveScriptToolbarItem, this.RemoveScriptToolbarItem,
this.DuplicateToolbarButton, this.DuplicateToolbarButton,
this.ClearConsoleToolbarButton,
this.toolStripSeparator2, this.toolStripSeparator2,
this.MoveUpToolbarItem, this.MoveUpToolbarItem,
this.toolStripButtonMoveDown, this.toolStripButtonMoveDown,
@ -582,6 +591,15 @@ namespace BizHawk.Client.EmuHawk
this.DuplicateToolbarButton.Text = "Duplicate Script"; this.DuplicateToolbarButton.Text = "Duplicate Script";
this.DuplicateToolbarButton.Click += new System.EventHandler(this.DuplicateScriptMenuItem_Click); 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 // MoveUpToolbarItem
// //
this.MoveUpToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.MoveUpToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
@ -765,7 +783,9 @@ namespace BizHawk.Client.EmuHawk
private BizHawk.WinForms.Controls.ToolStripSeparatorEx toolStripSeparator10; private BizHawk.WinForms.Controls.ToolStripSeparatorEx toolStripSeparator10;
private System.Windows.Forms.ToolStripButton EraseToolbarItem; private System.Windows.Forms.ToolStripButton EraseToolbarItem;
private System.Windows.Forms.ToolStripButton DuplicateToolbarButton; private System.Windows.Forms.ToolStripButton DuplicateToolbarButton;
private System.Windows.Forms.ToolStripButton ClearConsoleToolbarButton;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx DuplicateScriptMenuItem; private BizHawk.WinForms.Controls.ToolStripMenuItemEx DuplicateScriptMenuItem;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx ClearConsoleMenuItem;
private System.Windows.Forms.TextBox InputBox; private System.Windows.Forms.TextBox InputBox;
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer splitContainer1;
private BizHawk.WinForms.Controls.ToolStripMenuItemEx ReturnAllIfNoneSelectedMenuItem; private BizHawk.WinForms.Controls.ToolStripMenuItemEx ReturnAllIfNoneSelectedMenuItem;

View File

@ -107,6 +107,7 @@ namespace BizHawk.Client.EmuHawk
EditToolbarItem.Image = Resources.Cut; EditToolbarItem.Image = Resources.Cut;
RemoveScriptToolbarItem.Image = Resources.Delete; RemoveScriptToolbarItem.Image = Resources.Delete;
DuplicateToolbarButton.Image = Resources.Duplicate; DuplicateToolbarButton.Image = Resources.Duplicate;
ClearConsoleToolbarButton.Image = Resources.ClearConsole;
MoveUpToolbarItem.Image = Resources.MoveUp; MoveUpToolbarItem.Image = Resources.MoveUp;
toolStripButtonMoveDown.Image = Resources.MoveDown; toolStripButtonMoveDown.Image = Resources.MoveDown;
InsertSeparatorToolbarItem.Image = Resources.InsertSeparator; 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) private void InsertSeparatorMenuItem_Click(object sender, EventArgs e)
{ {
LuaImp.ScriptList.Insert(LuaListView.SelectionStartIndex ?? LuaImp.ScriptList.Count, LuaFile.SeparatorInstance); LuaImp.ScriptList.Insert(LuaListView.SelectionStartIndex ?? LuaImp.ScriptList.Count, LuaFile.SeparatorInstance);