@@ -19,10 +19,10 @@ namespace ResultsPanel
19
19
{
20
20
public class PluginUI : DockPanelControl
21
21
{
22
- public ToolStripMenuItem clearEntriesContextMenuItem ;
22
+ public ToolStripMenuItem clearEntries ;
23
23
public ToolStripMenuItem copyEntryContextMenuItem ;
24
- public ToolStripMenuItem ignoreEntryContextMenuItem ;
25
- public ToolStripMenuItem clearIgnoredEntriesContextMenuItem ;
24
+ public ToolStripMenuItem ignoreEntry ;
25
+ public ToolStripMenuItem clearIgnoredEntries ;
26
26
public ToolStripMenuItem nextEntry ;
27
27
public ToolStripMenuItem previousEntry ;
28
28
@@ -268,25 +268,25 @@ public void InitializeGraphics()
268
268
public void InitializeContextMenu ( )
269
269
{
270
270
ContextMenuStrip menu = new ContextMenuStrip ( ) ;
271
- this . clearEntriesContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearEntries" ) , null , new EventHandler ( this . ClearOutputClick ) ) ;
272
- this . clearEntriesContextMenuItem . ShortcutKeys = this . pluginMain . ClearResults ;
273
- menu . Items . Add ( this . clearEntriesContextMenuItem ) ;
271
+
272
+ this . clearEntries = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearEntries" ) , null , new EventHandler ( this . ClearOutputClick ) ) ;
274
273
this . copyEntryContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.CopyEntry" ) , null , new EventHandler ( this . CopyTextClick ) ) ;
275
- this . copyEntryContextMenuItem . ShortcutKeys = this . pluginMain . CopyEntry ;
274
+ this . ignoreEntry = new ToolStripMenuItem ( TextHelper . GetString ( "Label.IgnoreEntry" ) , null , new EventHandler ( this . IgnoreEntryClick ) ) ;
275
+ this . clearIgnoredEntries = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearIgnoredEntries" ) , null , new EventHandler ( this . ClearIgnoredEntriesClick ) ) ;
276
+ this . nextEntry = new ToolStripMenuItem ( TextHelper . GetString ( "Label.NextEntry" ) , null , new EventHandler ( this . NextEntryClick ) ) ;
277
+ this . previousEntry = new ToolStripMenuItem ( TextHelper . GetString ( "Label.PreviousEntry" ) , null , new EventHandler ( this . PreviousEntryClick ) ) ;
278
+
279
+ this . copyEntryContextMenuItem . ShortcutKeyDisplayString = DataConverter . KeysToString ( PluginMain . CopyEntryKeys ) ;
280
+ this . ignoreEntry . ShortcutKeyDisplayString = DataConverter . KeysToString ( PluginMain . IgnoreEntryKeys ) ;
281
+
282
+ menu . Items . Add ( this . clearEntries ) ;
276
283
menu . Items . Add ( this . copyEntryContextMenuItem ) ;
277
- this . ignoreEntryContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.IgnoreEntry" ) , null , new EventHandler ( this . IgnoreEntryClick ) ) ;
278
- this . ignoreEntryContextMenuItem . ShortcutKeys = this . pluginMain . IgnoreEntry ;
279
- menu . Items . Add ( this . ignoreEntryContextMenuItem ) ;
280
- this . clearIgnoredEntriesContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearIgnoredEntries" ) , null , new EventHandler ( this . ClearIgnoredEntriesClick ) ) ;
281
- this . clearIgnoredEntriesContextMenuItem . ShortcutKeys = this . pluginMain . ClearIgnoredEntries ;
282
- menu . Items . Add ( this . clearIgnoredEntriesContextMenuItem ) ;
284
+ menu . Items . Add ( this . ignoreEntry ) ;
285
+ menu . Items . Add ( this . clearIgnoredEntries ) ;
283
286
menu . Items . Add ( new ToolStripSeparator ( ) ) ;
284
- this . nextEntry = new ToolStripMenuItem ( TextHelper . GetString ( "Label.NextEntry" ) , null , new EventHandler ( this . NextEntry ) ) ;
285
- this . nextEntry . ShortcutKeys = this . pluginMain . NextError ;
286
287
menu . Items . Add ( this . nextEntry ) ;
287
- this . previousEntry = new ToolStripMenuItem ( TextHelper . GetString ( "Label.PreviousEntry" ) , null , new EventHandler ( this . PreviousEntry ) ) ;
288
- this . previousEntry . ShortcutKeys = this . pluginMain . PrevError ;
289
288
menu . Items . Add ( this . previousEntry ) ;
289
+
290
290
this . entriesView . ContextMenuStrip = menu ;
291
291
menu . Font = PluginBase . Settings . DefaultFont ;
292
292
menu . Renderer = new DockPanelStripRenderer ( false ) ;
@@ -397,7 +397,7 @@ public void ClearIgnoredEntriesClick(Object sender, System.EventArgs e)
397
397
ClearIgnoredEntries ( ) ;
398
398
}
399
399
400
- public bool ClearIgnoredEntries ( )
400
+ public Boolean ClearIgnoredEntries ( )
401
401
{
402
402
if ( this . ignoredEntries . Count == 0 ) return false ;
403
403
this . ignoredEntries . Clear ( ) ;
@@ -462,9 +462,9 @@ private void PluginUIResize(object sender, EventArgs e)
462
462
/// </summary>
463
463
private void ContextMenuOpening ( object sender , System . ComponentModel . CancelEventArgs e )
464
464
{
465
- this . nextEntry . Enabled = this . previousEntry . Enabled = this . clearEntriesContextMenuItem . Enabled = this . entriesView . Items . Count > 0 ;
466
- this . ignoreEntryContextMenuItem . Enabled = this . copyEntryContextMenuItem . Enabled = this . entriesView . SelectedItems . Count > 0 ;
467
- this . clearIgnoredEntriesContextMenuItem . Enabled = this . ignoredEntries . Count > 0 ;
465
+ this . nextEntry . Enabled = this . previousEntry . Enabled = this . clearEntries . Enabled = this . entriesView . Items . Count > 0 ;
466
+ this . ignoreEntry . Enabled = this . copyEntryContextMenuItem . Enabled = this . entriesView . SelectedItems . Count > 0 ;
467
+ this . clearIgnoredEntries . Enabled = this . ignoredEntries . Count > 0 ;
468
468
}
469
469
470
470
/// <summary>
@@ -566,10 +566,9 @@ private void MBSafeSetSelAndFocus(ScintillaControl sci, Int32 line, Int32 startP
566
566
/// <summary>
567
567
/// Clears the output
568
568
/// </summary>
569
- public bool ClearOutput ( )
569
+ public Boolean ClearOutput ( )
570
570
{
571
- if ( ! this . clearEntriesContextMenuItem . Enabled ) return false ;
572
-
571
+ if ( this . allListViewItems . Count == 0 ) return false ;
573
572
this . ClearSquiggles ( ) ;
574
573
this . allListViewItems . Clear ( ) ;
575
574
this . toolStripTextBoxFilter . Text = "" ;
@@ -950,9 +949,17 @@ private void ClearSquiggles()
950
949
/// <summary>
951
950
/// Goes to the next entry in the result list.
952
951
/// </summary>
953
- public void NextEntry ( Object sender , System . EventArgs e )
952
+ public void NextEntryClick ( Object sender , System . EventArgs e )
953
+ {
954
+ NextEntry ( ) ;
955
+ }
956
+
957
+ /// <summary>
958
+ /// Goes to the next entry in the result list.
959
+ /// </summary>
960
+ public Boolean NextEntry ( )
954
961
{
955
- if ( this . entriesView . Items . Count == 0 ) return ;
962
+ if ( this . entriesView . Items . Count == 0 ) return false ;
956
963
if ( this . entryIndex >= 0 && this . entryIndex < this . entriesView . Items . Count )
957
964
{
958
965
this . entriesView . Items [ this . entryIndex ] . ForeColor = this . entriesView . ForeColor ;
@@ -963,14 +970,23 @@ public void NextEntry(Object sender, System.EventArgs e)
963
970
this . entriesView . Items [ this . entryIndex ] . ForeColor = PluginBase . MainForm . GetThemeColor ( "ListView.Highlight" , SystemColors . Highlight ) ;
964
971
this . entriesView . EnsureVisible ( this . entryIndex ) ;
965
972
this . EntriesViewDoubleClick ( null , null ) ;
973
+ return true ;
974
+ }
975
+
976
+ /// <summary>
977
+ /// Goes to the previous entry in the result list.
978
+ /// </summary>
979
+ public void PreviousEntryClick ( Object sender , System . EventArgs e )
980
+ {
981
+ PreviousEntry ( ) ;
966
982
}
967
983
968
984
/// <summary>
969
985
/// Goes to the previous entry in the result list.
970
986
/// </summary>
971
- public void PreviousEntry ( Object sender , System . EventArgs e )
987
+ public Boolean PreviousEntry ( )
972
988
{
973
- if ( this . entriesView . Items . Count == 0 ) return ;
989
+ if ( this . entriesView . Items . Count == 0 ) return false ;
974
990
if ( this . entryIndex >= 0 && this . entryIndex < this . entriesView . Items . Count )
975
991
{
976
992
this . entriesView . Items [ this . entryIndex ] . ForeColor = this . entriesView . ForeColor ;
@@ -981,6 +997,7 @@ public void PreviousEntry(Object sender, System.EventArgs e)
981
997
this . entriesView . Items [ this . entryIndex ] . ForeColor = PluginBase . MainForm . GetThemeColor ( "ListView.Highlight" , SystemColors . Highlight ) ;
982
998
this . entriesView . EnsureVisible ( this . entryIndex ) ;
983
999
this . EntriesViewDoubleClick ( null , null ) ;
1000
+ return true ;
984
1001
}
985
1002
986
1003
#endregion
0 commit comments