make the Select All feature built right into VirtualListView instead of writing the same code over and over in the tool dialogs, also make said code faster on large lists

This commit is contained in:
adelikat 2014-02-15 19:15:04 +00:00
parent c333e2f6f3
commit 5849d2d80d
10 changed files with 179 additions and 112 deletions

View File

@ -775,5 +775,26 @@ namespace BizHawk.Client.EmuHawk
selection = -1;
}
public void SelectAll()
{
this.BeginUpdate();
for (var i = 0; i < _itemCount; i++)
{
this.SelectItem(i, true);
}
this.EndUpdate();
}
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.A && e.Control && !e.Alt && !e.Shift) // Select All
{
SelectAll();
}
base.OnKeyDown(e);
}
}
}

View File

@ -73,6 +73,7 @@
this.AutoloadMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.RestoreWindowSizeMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ColumnsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
@ -101,7 +102,6 @@
this.MessageLabel = new System.Windows.Forms.Label();
this.CheatGroupBox = new System.Windows.Forms.GroupBox();
this.CheatEditor = new BizHawk.Client.EmuHawk.CheatEdit();
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CheatsContextMenu.SuspendLayout();
this.CheatsMenu.SuspendLayout();
this.toolStrip1.SuspendLayout();
@ -382,7 +382,7 @@
// SelectAllMenuItem
//
this.SelectAllMenuItem.Name = "SelectAllMenuItem";
this.SelectAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.SelectAllMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
this.SelectAllMenuItem.Size = new System.Drawing.Size(233, 22);
this.SelectAllMenuItem.Text = "Select &All";
this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click);
@ -486,6 +486,13 @@
this.AlwaysOnTopMenuItem.Text = "Always on &Top";
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
//
// FloatingWindowMenuItem
//
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(199, 22);
this.FloatingWindowMenuItem.Text = "Floating Window";
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
@ -518,63 +525,63 @@
// ShowNameMenuItem
//
this.ShowNameMenuItem.Name = "ShowNameMenuItem";
this.ShowNameMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowNameMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowNameMenuItem.Text = "&Name";
this.ShowNameMenuItem.Click += new System.EventHandler(this.ShowNameMenuItem_Click);
//
// ShowAddressMenuItem
//
this.ShowAddressMenuItem.Name = "ShowAddressMenuItem";
this.ShowAddressMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowAddressMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowAddressMenuItem.Text = "&Address";
this.ShowAddressMenuItem.Click += new System.EventHandler(this.ShowAddressMenuItem_Click);
//
// ShowValueMenuItem
//
this.ShowValueMenuItem.Name = "ShowValueMenuItem";
this.ShowValueMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowValueMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowValueMenuItem.Text = "&Value";
this.ShowValueMenuItem.Click += new System.EventHandler(this.ShowValueMenuItem_Click);
//
// ShowCompareMenuItem
//
this.ShowCompareMenuItem.Name = "ShowCompareMenuItem";
this.ShowCompareMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowCompareMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowCompareMenuItem.Text = "&Compare";
this.ShowCompareMenuItem.Click += new System.EventHandler(this.ShowCompareMenuItem_Click);
//
// ShowOnMenuItem
//
this.ShowOnMenuItem.Name = "ShowOnMenuItem";
this.ShowOnMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowOnMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowOnMenuItem.Text = "&On";
this.ShowOnMenuItem.Click += new System.EventHandler(this.ShowOnMenuItem_Click);
//
// ShowDomainMenuItem
//
this.ShowDomainMenuItem.Name = "ShowDomainMenuItem";
this.ShowDomainMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowDomainMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowDomainMenuItem.Text = "&Domain";
this.ShowDomainMenuItem.Click += new System.EventHandler(this.ShowDomainMenuItem_Click);
//
// ShowSizeMenuItem
//
this.ShowSizeMenuItem.Name = "ShowSizeMenuItem";
this.ShowSizeMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowSizeMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowSizeMenuItem.Text = "&Size";
this.ShowSizeMenuItem.Click += new System.EventHandler(this.ShowSizeMenuItem_Click);
//
// ShowEndianMenuItem
//
this.ShowEndianMenuItem.Name = "ShowEndianMenuItem";
this.ShowEndianMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowEndianMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowEndianMenuItem.Text = "&Endian";
this.ShowEndianMenuItem.Click += new System.EventHandler(this.ShowEndianMenuItem_Click);
//
// ShowDisplayTypeMenuItem
//
this.ShowDisplayTypeMenuItem.Name = "ShowDisplayTypeMenuItem";
this.ShowDisplayTypeMenuItem.Size = new System.Drawing.Size(152, 22);
this.ShowDisplayTypeMenuItem.Size = new System.Drawing.Size(141, 22);
this.ShowDisplayTypeMenuItem.Text = "&Display Type";
this.ShowDisplayTypeMenuItem.Click += new System.EventHandler(this.ShowDisplayTypeMenuItem_Click);
//
@ -736,13 +743,6 @@
this.CheatEditor.Size = new System.Drawing.Size(190, 264);
this.CheatEditor.TabIndex = 0;
//
// FloatingWindowMenuItem
//
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(199, 22);
this.FloatingWindowMenuItem.Text = "Floating Window";
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
//
// Cheats
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -594,10 +594,7 @@ namespace BizHawk.Client.EmuHawk
private void SelectAllMenuItem_Click(object sender, EventArgs e)
{
Enumerable
.Range(0, Global.CheatList.Count)
.ToList()
.ForEach(i => CheatListView.SelectItem(i, true));
CheatListView.SelectAll();
}
private void ToggleMenuItem_Click(object sender, EventArgs e)

View File

@ -113,6 +113,14 @@ namespace BizHawk.Client.EmuHawk
return lua;
}
public Lua SpawnCoroutineFromText(string text)
{
var lua = _lua.NewThread();
var main = lua.LoadString(text, string.Empty);
lua.Push(main);
return lua;
}
public ResumeResult ResumeScript(Lua script)
{
_eventLibrary.CurrentThread = script;

View File

@ -102,11 +102,15 @@
this.LuaListView = new BizHawk.Client.EmuHawk.VirtualListView();
this.Script = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.PathName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ConsoleBox = new System.Windows.Forms.GroupBox();
this.ConsoleTextBox = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.ScriptListContextMenu.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.ConsoleContextMenu.SuspendLayout();
this.groupBox1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.ConsoleBox.SuspendLayout();
this.SuspendLayout();
//
// ScriptListContextMenu
@ -120,14 +124,14 @@
this.ScriptContextSeparator,
this.StopAllScriptsContextItem});
this.ScriptListContextMenu.Name = "contextMenuStrip1";
this.ScriptListContextMenu.Size = new System.Drawing.Size(158, 142);
this.ScriptListContextMenu.Size = new System.Drawing.Size(165, 142);
this.ScriptListContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ScriptListContextMenu_Opening);
//
// ToggleScriptContextItem
//
this.ToggleScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1;
this.ToggleScriptContextItem.Name = "ToggleScriptContextItem";
this.ToggleScriptContextItem.Size = new System.Drawing.Size(157, 22);
this.ToggleScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.ToggleScriptContextItem.Text = "&Toggle";
this.ToggleScriptContextItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click);
//
@ -135,7 +139,7 @@
//
this.PauseScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause;
this.PauseScriptContextItem.Name = "PauseScriptContextItem";
this.PauseScriptContextItem.Size = new System.Drawing.Size(157, 22);
this.PauseScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.PauseScriptContextItem.Text = "Pause or Resume";
this.PauseScriptContextItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click);
//
@ -143,7 +147,7 @@
//
this.EditScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS;
this.EditScriptContextItem.Name = "EditScriptContextItem";
this.EditScriptContextItem.Size = new System.Drawing.Size(157, 22);
this.EditScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.EditScriptContextItem.Text = "&Edit";
this.EditScriptContextItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click);
//
@ -151,7 +155,7 @@
//
this.RemoveScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Close;
this.RemoveScriptContextItem.Name = "RemoveScriptContextItem";
this.RemoveScriptContextItem.Size = new System.Drawing.Size(157, 22);
this.RemoveScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.RemoveScriptContextItem.Text = "&Remove";
this.RemoveScriptContextItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click);
//
@ -159,20 +163,20 @@
//
this.InsertSeperatorContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator;
this.InsertSeperatorContextItem.Name = "InsertSeperatorContextItem";
this.InsertSeperatorContextItem.Size = new System.Drawing.Size(157, 22);
this.InsertSeperatorContextItem.Size = new System.Drawing.Size(164, 22);
this.InsertSeperatorContextItem.Text = "Insert Seperator";
this.InsertSeperatorContextItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
// ScriptContextSeparator
//
this.ScriptContextSeparator.Name = "ScriptContextSeparator";
this.ScriptContextSeparator.Size = new System.Drawing.Size(154, 6);
this.ScriptContextSeparator.Size = new System.Drawing.Size(161, 6);
//
// StopAllScriptsContextItem
//
this.StopAllScriptsContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
this.StopAllScriptsContextItem.Name = "StopAllScriptsContextItem";
this.StopAllScriptsContextItem.Size = new System.Drawing.Size(157, 22);
this.StopAllScriptsContextItem.Size = new System.Drawing.Size(164, 22);
this.StopAllScriptsContextItem.Text = "Stop All Scripts";
this.StopAllScriptsContextItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click);
//
@ -203,7 +207,7 @@
this.toolStripSeparator1,
this.ExitMenuItem});
this.FileSubMenu.Name = "FileSubMenu";
this.FileSubMenu.Size = new System.Drawing.Size(35, 20);
this.FileSubMenu.Size = new System.Drawing.Size(37, 20);
this.FileSubMenu.Text = "&File";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
//
@ -213,7 +217,7 @@
this.NewSessionMenuItem.Name = "NewSessionMenuItem";
this.NewSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.N)));
this.NewSessionMenuItem.Size = new System.Drawing.Size(232, 22);
this.NewSessionMenuItem.Size = new System.Drawing.Size(237, 22);
this.NewSessionMenuItem.Text = "&New Session";
this.NewSessionMenuItem.Click += new System.EventHandler(this.NewSessionMenuItem_Click);
//
@ -223,7 +227,7 @@
this.OpenSessionMenuItem.Name = "OpenSessionMenuItem";
this.OpenSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.O)));
this.OpenSessionMenuItem.Size = new System.Drawing.Size(232, 22);
this.OpenSessionMenuItem.Size = new System.Drawing.Size(237, 22);
this.OpenSessionMenuItem.Text = "&Open Session...";
this.OpenSessionMenuItem.Click += new System.EventHandler(this.OpenSessionMenuItem_Click);
//
@ -232,7 +236,7 @@
this.SaveSessionMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs;
this.SaveSessionMenuItem.Name = "SaveSessionMenuItem";
this.SaveSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveSessionMenuItem.Size = new System.Drawing.Size(232, 22);
this.SaveSessionMenuItem.Size = new System.Drawing.Size(237, 22);
this.SaveSessionMenuItem.Text = "&Save Session";
this.SaveSessionMenuItem.Click += new System.EventHandler(this.SaveSessionMenuItem_Click);
//
@ -241,21 +245,21 @@
this.SaveSessionAsMenuItem.Name = "SaveSessionAsMenuItem";
this.SaveSessionAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S)));
this.SaveSessionAsMenuItem.Size = new System.Drawing.Size(232, 22);
this.SaveSessionAsMenuItem.Size = new System.Drawing.Size(237, 22);
this.SaveSessionAsMenuItem.Text = "Save Session &As...";
this.SaveSessionAsMenuItem.Click += new System.EventHandler(this.SaveSessionAsMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(229, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(234, 6);
//
// RecentSessionsSubMenu
//
this.RecentSessionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripSeparator8});
this.RecentSessionsSubMenu.Name = "RecentSessionsSubMenu";
this.RecentSessionsSubMenu.Size = new System.Drawing.Size(232, 22);
this.RecentSessionsSubMenu.Size = new System.Drawing.Size(237, 22);
this.RecentSessionsSubMenu.Text = "Recent Sessions";
this.RecentSessionsSubMenu.DropDownOpened += new System.EventHandler(this.RecentSessionsSubMenu_DropDownOpened);
//
@ -270,7 +274,7 @@
this.toolStripSeparator3});
this.RecentScriptsSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
this.RecentScriptsSubMenu.Name = "RecentScriptsSubMenu";
this.RecentScriptsSubMenu.Size = new System.Drawing.Size(232, 22);
this.RecentScriptsSubMenu.Size = new System.Drawing.Size(237, 22);
this.RecentScriptsSubMenu.Text = "Recent Scripts";
this.RecentScriptsSubMenu.DropDownOpened += new System.EventHandler(this.RecentScriptsSubMenu_DropDownOpened);
//
@ -282,13 +286,13 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(229, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(234, 6);
//
// ExitMenuItem
//
this.ExitMenuItem.Name = "ExitMenuItem";
this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.ExitMenuItem.Size = new System.Drawing.Size(232, 22);
this.ExitMenuItem.Size = new System.Drawing.Size(237, 22);
this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
@ -311,7 +315,7 @@
this.StopAllScriptsMenuItem,
this.RegisteredFunctionsMenuItem});
this.ScriptSubMenu.Name = "ScriptSubMenu";
this.ScriptSubMenu.Size = new System.Drawing.Size(46, 20);
this.ScriptSubMenu.Size = new System.Drawing.Size(49, 20);
this.ScriptSubMenu.Text = "&Script";
this.ScriptSubMenu.DropDownOpened += new System.EventHandler(this.ScriptSubMenu_DropDownOpened);
//
@ -320,7 +324,7 @@
this.NewScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile;
this.NewScriptMenuItem.Name = "NewScriptMenuItem";
this.NewScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.NewScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.NewScriptMenuItem.Text = "New Script";
this.NewScriptMenuItem.Click += new System.EventHandler(this.NewScriptMenuItem_Click);
//
@ -329,7 +333,7 @@
this.OpenScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile;
this.OpenScriptMenuItem.Name = "OpenScriptMenuItem";
this.OpenScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.OpenScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.OpenScriptMenuItem.Text = "&Open Script...";
this.OpenScriptMenuItem.Click += new System.EventHandler(this.OpenScriptMenuItem_Click);
//
@ -338,7 +342,7 @@
this.RefreshScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1;
this.RefreshScriptMenuItem.Name = "RefreshScriptMenuItem";
this.RefreshScriptMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.RefreshScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.RefreshScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.RefreshScriptMenuItem.Text = "&Re&fresh";
this.RefreshScriptMenuItem.Click += new System.EventHandler(this.RefreshScriptMenuItem_Click);
//
@ -347,7 +351,7 @@
this.ToggleScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.checkbox;
this.ToggleScriptMenuItem.Name = "ToggleScriptMenuItem";
this.ToggleScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
this.ToggleScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.ToggleScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.ToggleScriptMenuItem.Text = "&Toggle";
this.ToggleScriptMenuItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click);
//
@ -355,7 +359,7 @@
//
this.PauseScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause;
this.PauseScriptMenuItem.Name = "PauseScriptMenuItem";
this.PauseScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.PauseScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.PauseScriptMenuItem.Text = "Pause or Resume";
this.PauseScriptMenuItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click);
//
@ -364,7 +368,7 @@
this.EditScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS;
this.EditScriptMenuItem.Name = "EditScriptMenuItem";
this.EditScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.EditScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.EditScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.EditScriptMenuItem.Text = "&Edit Script";
this.EditScriptMenuItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click);
//
@ -373,7 +377,7 @@
this.RemoveScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
this.RemoveScriptMenuItem.Name = "RemoveScriptMenuItem";
this.RemoveScriptMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.RemoveScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.RemoveScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.RemoveScriptMenuItem.Text = "&Remove Script";
this.RemoveScriptMenuItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click);
//
@ -382,21 +386,21 @@
this.InsertSeparatorMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator;
this.InsertSeparatorMenuItem.Name = "InsertSeparatorMenuItem";
this.InsertSeparatorMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(212, 22);
this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(218, 22);
this.InsertSeparatorMenuItem.Text = "Insert Separator";
this.InsertSeparatorMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(209, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(215, 6);
//
// MoveUpMenuItem
//
this.MoveUpMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp;
this.MoveUpMenuItem.Name = "MoveUpMenuItem";
this.MoveUpMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
this.MoveUpMenuItem.Size = new System.Drawing.Size(212, 22);
this.MoveUpMenuItem.Size = new System.Drawing.Size(218, 22);
this.MoveUpMenuItem.Text = "Move &Up";
this.MoveUpMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click);
//
@ -405,28 +409,28 @@
this.MoveDownMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown;
this.MoveDownMenuItem.Name = "MoveDownMenuItem";
this.MoveDownMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
this.MoveDownMenuItem.Size = new System.Drawing.Size(212, 22);
this.MoveDownMenuItem.Size = new System.Drawing.Size(218, 22);
this.MoveDownMenuItem.Text = "Move &Down";
this.MoveDownMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click);
//
// SelectAllMenuItem
//
this.SelectAllMenuItem.Name = "SelectAllMenuItem";
this.SelectAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.SelectAllMenuItem.Size = new System.Drawing.Size(212, 22);
this.SelectAllMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
this.SelectAllMenuItem.Size = new System.Drawing.Size(218, 22);
this.SelectAllMenuItem.Text = "Select &All";
this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(209, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(215, 6);
//
// StopAllScriptsMenuItem
//
this.StopAllScriptsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
this.StopAllScriptsMenuItem.Name = "StopAllScriptsMenuItem";
this.StopAllScriptsMenuItem.Size = new System.Drawing.Size(212, 22);
this.StopAllScriptsMenuItem.Size = new System.Drawing.Size(218, 22);
this.StopAllScriptsMenuItem.Text = "Stop All Scripts";
this.StopAllScriptsMenuItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click);
//
@ -434,7 +438,7 @@
//
this.RegisteredFunctionsMenuItem.Name = "RegisteredFunctionsMenuItem";
this.RegisteredFunctionsMenuItem.ShortcutKeyDisplayString = "F12";
this.RegisteredFunctionsMenuItem.Size = new System.Drawing.Size(212, 22);
this.RegisteredFunctionsMenuItem.Size = new System.Drawing.Size(218, 22);
this.RegisteredFunctionsMenuItem.Text = "&Registered Functions...";
this.RegisteredFunctionsMenuItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click);
//
@ -451,66 +455,66 @@
this.toolStripSeparator5,
this.RestoreDefaultSettingsMenuItem});
this.OptionsSubMenu.Name = "OptionsSubMenu";
this.OptionsSubMenu.Size = new System.Drawing.Size(56, 20);
this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20);
this.OptionsSubMenu.Text = "&Options";
this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened);
//
// AutoloadConsoleMenuItem
//
this.AutoloadConsoleMenuItem.Name = "AutoloadConsoleMenuItem";
this.AutoloadConsoleMenuItem.Size = new System.Drawing.Size(192, 22);
this.AutoloadConsoleMenuItem.Size = new System.Drawing.Size(199, 22);
this.AutoloadConsoleMenuItem.Text = "Autoload Console";
this.AutoloadConsoleMenuItem.Click += new System.EventHandler(this.AutoloadConsoleMenuItem_Click);
//
// AutoloadSessionMenuItem
//
this.AutoloadSessionMenuItem.Name = "AutoloadSessionMenuItem";
this.AutoloadSessionMenuItem.Size = new System.Drawing.Size(192, 22);
this.AutoloadSessionMenuItem.Size = new System.Drawing.Size(199, 22);
this.AutoloadSessionMenuItem.Text = "Autoload Session";
this.AutoloadSessionMenuItem.Click += new System.EventHandler(this.AutoloadSessionMenuItem_Click);
//
// DisableScriptsOnLoadMenuItem
//
this.DisableScriptsOnLoadMenuItem.Name = "DisableScriptsOnLoadMenuItem";
this.DisableScriptsOnLoadMenuItem.Size = new System.Drawing.Size(192, 22);
this.DisableScriptsOnLoadMenuItem.Size = new System.Drawing.Size(199, 22);
this.DisableScriptsOnLoadMenuItem.Text = "Disable Scripts on Load";
this.DisableScriptsOnLoadMenuItem.Click += new System.EventHandler(this.DisableScriptsOnLoadMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(189, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(196, 6);
//
// SaveWindowPositionMenuItem
//
this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem";
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(192, 22);
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(199, 22);
this.SaveWindowPositionMenuItem.Text = "Save Window Position";
this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click);
//
// AlwaysOnTopMenuItem
//
this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(192, 22);
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(199, 22);
this.AlwaysOnTopMenuItem.Text = "Always On Top";
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
//
// FloatingWindowMenuItem
//
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(192, 22);
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(199, 22);
this.FloatingWindowMenuItem.Text = "Floating Window";
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(189, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(196, 6);
//
// RestoreDefaultSettingsMenuItem
//
this.RestoreDefaultSettingsMenuItem.Name = "RestoreDefaultSettingsMenuItem";
this.RestoreDefaultSettingsMenuItem.Size = new System.Drawing.Size(192, 22);
this.RestoreDefaultSettingsMenuItem.Size = new System.Drawing.Size(199, 22);
this.RestoreDefaultSettingsMenuItem.Text = "Restore Default Settings";
this.RestoreDefaultSettingsMenuItem.Click += new System.EventHandler(this.RestoreDefaultSettingsMenuItem_Click);
//
@ -520,20 +524,20 @@
this.FunctionsListMenuItem,
this.OnlineDocsMenuItem});
this.HelpSubMenu.Name = "HelpSubMenu";
this.HelpSubMenu.Size = new System.Drawing.Size(40, 20);
this.HelpSubMenu.Size = new System.Drawing.Size(44, 20);
this.HelpSubMenu.Text = "&Help";
//
// FunctionsListMenuItem
//
this.FunctionsListMenuItem.Name = "FunctionsListMenuItem";
this.FunctionsListMenuItem.Size = new System.Drawing.Size(189, 22);
this.FunctionsListMenuItem.Size = new System.Drawing.Size(202, 22);
this.FunctionsListMenuItem.Text = "&Lua Functions List";
this.FunctionsListMenuItem.Click += new System.EventHandler(this.FunctionsListMenuItem_Click);
//
// OnlineDocsMenuItem
//
this.OnlineDocsMenuItem.Name = "OnlineDocsMenuItem";
this.OnlineDocsMenuItem.Size = new System.Drawing.Size(189, 22);
this.OnlineDocsMenuItem.Size = new System.Drawing.Size(202, 22);
this.OnlineDocsMenuItem.Text = "Documentation online...";
this.OnlineDocsMenuItem.Click += new System.EventHandler(this.OnlineDocsMenuItem_Click);
//
@ -546,7 +550,7 @@
this.OutputBox.Location = new System.Drawing.Point(6, 17);
this.OutputBox.Name = "OutputBox";
this.OutputBox.ReadOnly = true;
this.OutputBox.Size = new System.Drawing.Size(246, 283);
this.OutputBox.Size = new System.Drawing.Size(246, 307);
this.OutputBox.TabIndex = 2;
this.OutputBox.Text = "";
this.OutputBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OutputBox_KeyDown);
@ -557,20 +561,20 @@
this.ClearConsoleContextItem,
this.RegisteredFunctionsContextItem});
this.ConsoleContextMenu.Name = "contextMenuStrip2";
this.ConsoleContextMenu.Size = new System.Drawing.Size(176, 48);
this.ConsoleContextMenu.Size = new System.Drawing.Size(185, 48);
this.ConsoleContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ConsoleContextMenu_Opening);
//
// ClearConsoleContextItem
//
this.ClearConsoleContextItem.Name = "ClearConsoleContextItem";
this.ClearConsoleContextItem.Size = new System.Drawing.Size(175, 22);
this.ClearConsoleContextItem.Size = new System.Drawing.Size(184, 22);
this.ClearConsoleContextItem.Text = "&Clear";
this.ClearConsoleContextItem.Click += new System.EventHandler(this.ClearConsoleContextItem_Click);
//
// RegisteredFunctionsContextItem
//
this.RegisteredFunctionsContextItem.Name = "RegisteredFunctionsContextItem";
this.RegisteredFunctionsContextItem.Size = new System.Drawing.Size(175, 22);
this.RegisteredFunctionsContextItem.Size = new System.Drawing.Size(184, 22);
this.RegisteredFunctionsContextItem.Text = "&Registered Functions";
this.RegisteredFunctionsContextItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click);
//
@ -581,7 +585,7 @@
this.groupBox1.Controls.Add(this.OutputBox);
this.groupBox1.Location = new System.Drawing.Point(310, 71);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(258, 304);
this.groupBox1.Size = new System.Drawing.Size(258, 328);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Output";
@ -599,7 +603,7 @@
//
this.OutputMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OutputMessages.AutoSize = true;
this.OutputMessages.Location = new System.Drawing.Point(13, 384);
this.OutputMessages.Location = new System.Drawing.Point(13, 499);
this.OutputMessages.Name = "OutputMessages";
this.OutputMessages.Size = new System.Drawing.Size(106, 13);
this.OutputMessages.TabIndex = 6;
@ -749,7 +753,7 @@
this.LuaListView.Location = new System.Drawing.Point(13, 71);
this.LuaListView.Name = "LuaListView";
this.LuaListView.selectedItem = -1;
this.LuaListView.Size = new System.Drawing.Size(291, 304);
this.LuaListView.Size = new System.Drawing.Size(291, 328);
this.LuaListView.TabIndex = 0;
this.LuaListView.UseCompatibleStateImageBehavior = false;
this.LuaListView.View = System.Windows.Forms.View.Details;
@ -767,12 +771,49 @@
this.PathName.Text = "Path";
this.PathName.Width = 195;
//
// ConsoleBox
//
this.ConsoleBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ConsoleBox.Controls.Add(this.ConsoleTextBox);
this.ConsoleBox.Location = new System.Drawing.Point(13, 405);
this.ConsoleBox.Name = "ConsoleBox";
this.ConsoleBox.Size = new System.Drawing.Size(495, 100);
this.ConsoleBox.TabIndex = 7;
this.ConsoleBox.TabStop = false;
this.ConsoleBox.Text = "Console";
//
// ConsoleTextBox
//
this.ConsoleTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ConsoleTextBox.Location = new System.Drawing.Point(6, 19);
this.ConsoleTextBox.Multiline = true;
this.ConsoleTextBox.Name = "ConsoleTextBox";
this.ConsoleTextBox.Size = new System.Drawing.Size(483, 72);
this.ConsoleTextBox.TabIndex = 0;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(514, 441);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 23);
this.button1.TabIndex = 8;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// LuaConsole
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(584, 402);
this.ClientSize = new System.Drawing.Size(584, 517);
this.Controls.Add(this.button1);
this.Controls.Add(this.ConsoleBox);
this.Controls.Add(this.OutputMessages);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.groupBox1);
@ -795,6 +836,8 @@
this.groupBox1.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ConsoleBox.ResumeLayout(false);
this.ConsoleBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -874,5 +917,8 @@
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
private System.Windows.Forms.ToolStripButton RefreshScriptToolbarItem;
private System.Windows.Forms.ToolStripMenuItem RefreshScriptMenuItem;
private System.Windows.Forms.GroupBox ConsoleBox;
private System.Windows.Forms.TextBox ConsoleTextBox;
private System.Windows.Forms.Button button1;
}
}

View File

@ -9,6 +9,7 @@ using System.Windows.Forms;
using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
using LuaInterface;
namespace BizHawk.Client.EmuHawk
{
@ -353,6 +354,11 @@ namespace BizHawk.Client.EmuHawk
/// <param name="includeFrameWaiters">should frame waiters be waken up? only use this immediately before a frame of emulation</param>
public void ResumeScripts(bool includeFrameWaiters)
{
foreach (var blah in onTheFlyList)
{
var result = LuaImp.ResumeScript(blah);
}
if (_luaList.Any())
{
if (LuaImp.GuiLibrary.SurfaceIsNull)
@ -817,10 +823,7 @@ namespace BizHawk.Client.EmuHawk
private void SelectAllMenuItem_Click(object sender, EventArgs e)
{
for (var i = 0; i < _luaList.Count; i++)
{
LuaListView.SelectItem(i, true);
}
LuaListView.SelectAll();
}
private void StopAllScriptsMenuItem_Click(object sender, EventArgs e)
@ -1105,6 +1108,13 @@ namespace BizHawk.Client.EmuHawk
#endregion
private List<Lua> onTheFlyList = new List<Lua>();
private void button1_Click(object sender, EventArgs e)
{
onTheFlyList.Add(LuaImp.SpawnCoroutineFromText(ConsoleTextBox.Text));
}
#endregion
}
}

View File

@ -31,6 +31,7 @@ namespace BizHawk.Client.EmuHawk
{
Location = StartLocation;
}
PopulateListView();
}
@ -89,6 +90,7 @@ namespace BizHawk.Client.EmuHawk
var nlf = GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions[guid];
GlobalWin.Tools.LuaConsole.LuaImp.RegisteredFunctions.Remove(nlf);
}
PopulateListView();
}
}
@ -119,15 +121,15 @@ namespace BizHawk.Client.EmuHawk
private void FunctionView_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete && !e.Control && !e.Alt && !e.Shift) //Delete
if (e.KeyCode == Keys.Delete && !e.Control && !e.Alt && !e.Shift) // Delete
{
RemoveFunctionButton();
}
else if (e.KeyCode == Keys.Space && !e.Control && !e.Alt && !e.Shift) //Space
else if (e.KeyCode == Keys.Space && !e.Control && !e.Alt && !e.Shift) // Space
{
CallFunction();
}
else if (e.KeyCode == Keys.Enter && !e.Control && !e.Alt && !e.Shift) //Enter
else if (e.KeyCode == Keys.Enter && !e.Control && !e.Alt && !e.Shift) // Enter
{
CallFunction();
}

View File

@ -1591,13 +1591,6 @@ namespace BizHawk.Client.EmuHawk
{
RemoveAddresses();
}
else if (e.KeyCode == Keys.A && e.Control && !e.Alt && !e.Shift) // Select All
{
for (var i = 0; i < _searches.Count; i++)
{
WatchListView.SelectItem(i, true);
}
}
else if (e.KeyCode == Keys.C && e.Control && !e.Alt && !e.Shift) // Copy
{
if (SelectedIndices.Count > 0)

View File

@ -101,6 +101,7 @@
this.WatchesOnScreenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SaveWindowPositionMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AlwaysOnTopMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.RestoreWindowSizeMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ColumnsSubMenu = new System.Windows.Forms.ToolStripMenuItem();
@ -116,7 +117,6 @@
this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.FloatingWindowMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ListViewContextMenu.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
@ -710,7 +710,7 @@
// SelectAllMenuItem
//
this.SelectAllMenuItem.Name = "SelectAllMenuItem";
this.SelectAllMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.SelectAllMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
this.SelectAllMenuItem.Size = new System.Drawing.Size(224, 22);
this.SelectAllMenuItem.Text = "Select &All";
this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click);
@ -783,6 +783,13 @@
this.AlwaysOnTopMenuItem.Text = "&Always On Top";
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
//
// FloatingWindowMenuItem
//
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(217, 22);
this.FloatingWindowMenuItem.Text = "&Floating Window";
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
@ -918,13 +925,6 @@
this.NotesColumn.Text = "Notes";
this.NotesColumn.Width = 128;
//
// FloatingWindowMenuItem
//
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(217, 22);
this.FloatingWindowMenuItem.Text = "&Floating Window";
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
//
// RamWatch
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -821,10 +821,7 @@ namespace BizHawk.Client.EmuHawk
private void SelectAllMenuItem_Click(object sender, EventArgs e)
{
for (var i = 0; i < _watches.Count; i++)
{
WatchListView.SelectItem(i, true);
}
WatchListView.SelectAll();
}
#endregion
@ -1075,13 +1072,6 @@ namespace BizHawk.Client.EmuHawk
{
RemoveWatchMenuItem_Click(sender, e);
}
else if (e.KeyCode == Keys.A && e.Control && !e.Alt && !e.Shift) // Select All
{
for (var x = 0; x < _watches.Count; x++)
{
WatchListView.SelectItem(x, true);
}
}
else if (e.KeyCode == Keys.C && e.Control && !e.Alt && !e.Shift) // Copy
{
CopyWatchesToClipBoard();