Charlie Kindel 2 年之前
父節點
當前提交
1b2dc4023c

+ 2 - 2
Terminal.Gui/Core/SearchCollectionNavigator.cs

@@ -140,8 +140,8 @@ namespace Terminal.Gui {
 		public static bool IsCompatibleKey (KeyEvent kb)
 		{
 			// For some reason, at least on Windows/Windows Terminal, `$` is coming through with `IsAlt == true`
-			//return !kb.IsAlt && !kb.IsCapslock && !kb.IsCtrl && !kb.IsScrolllock && !kb.IsNumlock;
-			return !kb.IsCapslock && !kb.IsCtrl && !kb.IsScrolllock && !kb.IsNumlock;
+			return !kb.IsAlt && !kb.IsCapslock && !kb.IsCtrl && !kb.IsScrolllock && !kb.IsNumlock;
+			//return !kb.IsCapslock && !kb.IsCtrl && !kb.IsScrolllock && !kb.IsNumlock;
 		}
 	}
 }

+ 0 - 1
Terminal.Gui/Views/ListView.cs

@@ -691,7 +691,6 @@ namespace Terminal.Gui {
 
 		int lastSelectedItem = -1;
 		private bool allowsMultipleSelection = true;
-		private System.Timers.Timer searchTimer;
 
 		/// <summary>
 		/// Invokes the <see cref="SelectedItemChanged"/> event if it is defined.

+ 2 - 2
UICatalog/Scenarios/Keys.cs

@@ -51,8 +51,8 @@ namespace UICatalog.Scenarios {
 		public override void Init (Toplevel top, ColorScheme colorScheme)
 		{
 			Application.Init ();
-			Top = top != null ? top : Application.Top;
-
+			Top = top != null ? top : Application.Top != null ? top : Application.Top;
+			
 			Win = new TestWindow ($"CTRL-Q to Close - Scenario: {GetName ()}") {
 				X = 0,
 				Y = 0,

+ 58 - 104
UICatalog/Scenarios/SearchCollectionNavigatorTester.cs

@@ -19,6 +19,59 @@ namespace UICatalog.Scenarios {
 			Top.ColorScheme = Colors.Base;
 		}
 
+		System.Collections.Generic.List<string> _items = new string [] {
+				"a",
+				"b",
+				"bb",
+				"c",
+				"ccc",
+				"ccc",
+				"cccc",
+				"ddd",
+				"dddd",
+				"dddd",
+				"ddddd",
+				"dddddd",
+				"ddddddd",
+				"this",
+				"this is a test",
+				"this was a test",
+				"this and",
+				"that and that",
+				"the",
+				"think",
+				"thunk",
+				"thunks",
+				"zip",
+				"zap",
+				"zoo",
+				"@jack",
+				"@sign",
+				"@at",
+				"@ateme",
+				"n@",
+				"n@brown",
+				".net",
+				"$100.00",
+				"$101.00",
+				"$101.10",
+				"$101.11",
+				"$200.00",
+				"$210.99",
+				"$$",
+				"appricot",
+				"arm",
+				"丗丙业丞",
+				"丗丙丛",
+				"text",
+				"egg",
+				"candle",
+				" <- space",
+				"q",
+				"quit",
+				"quitter"
+			}.ToList<string> ();
+
 		public override void Setup ()
 		{
 			var allowMarking = new MenuItem ("Allow _Marking", "", null) {
@@ -46,6 +99,8 @@ namespace UICatalog.Scenarios {
 
 			Top.Add (menu);
 
+			_items.Sort (StringComparer.OrdinalIgnoreCase);
+
 			CreateListView ();
 			var vsep = new LineView (Terminal.Gui.Graphs.Orientation.Vertical) {
 				X = Pos.Right (_listView),
@@ -81,58 +136,8 @@ namespace UICatalog.Scenarios {
 				ColorScheme = Colors.TopLevel
 			};
 			Top.Add (_listView);
-
-			System.Collections.Generic.List<string> items = new string [] {
-				"a",
-				"b",
-				"bb",
-				"c",
-				"ccc",
-				"ccc",
-				"cccc",
-				"ddd",
-				"dddd",
-				"dddd",
-				"ddddd",
-				"dddddd",
-				"ddddddd",
-				"this",
-				"this is a test",
-				"this was a test",
-				"this and",
-				"that and that",
-				"the",
-				"think",
-				"thunk",
-				"thunks",
-				"zip",
-				"zap",
-				"zoo",
-				"@jack",
-				"@sign",
-				"@at",
-				"@ateme",
-				"n@",
-				"n@brown",
-				".net",
-				"$100.00",
-				"$101.00",
-				"$101.10",
-				"$101.11",
-				"appricot",
-				"arm",
-				"丗丙业丞",
-				"丗丙丛",
-				"text",
-				"egg",
-				"candle",
-				" <- space",
-				"q",
-				"quit",
-				"quitter"
-			}.ToList<string> ();
-			items.Sort (StringComparer.OrdinalIgnoreCase);
-			_listView.SetSource (items);
+			
+			_listView.SetSource (_items);
 		}
 
 		TreeView _treeView = null;
@@ -157,63 +162,12 @@ namespace UICatalog.Scenarios {
 				ColorScheme = Colors.TopLevel
 			};
 			Top.Add (_treeView);
-
-			System.Collections.Generic.List<string> items = new string [] {                         
-				"a",
-				"b",
-				"bb",
-				"c",
-				"ccc",
-				"ccc",
-				"cccc",
-				"ddd",
-				"dddd",
-				"dddd",
-				"ddddd",
-				"dddddd",
-				"ddddddd",
-				"this",
-				"this is a test",
-				"this was a test",
-				"this and",
-				"that and that",
-				"the",
-				"think",
-				"thunk",
-				"thunks",
-				"zip",
-				"zap",
-				"zoo",
-				"@jack",
-				"@sign",
-				"@at",
-				"@ateme",
-				"n@",
-				"n@brown",
-				".net",
-				"$100.00",
-				"$101.00",
-				"$101.10",
-				"$101.11",
-				"appricot",
-				"arm",
-				"丗丙业丞",
-				"丗丙丛",
-				"text",
-				"egg",
-				"candle",
-				" <- space",
-				"q",
-				"quit",
-				"quitter"
-			}.ToList<string> ();
 			
-			items.Sort (StringComparer.OrdinalIgnoreCase);
 			var root = new TreeNode ("Alpha examples");
 			//root.Children = items.Where (i => char.IsLetterOrDigit (i [0])).Select (i => new TreeNode (i)).Cast<ITreeNode>().ToList ();
 			//_treeView.AddObject (root);
 			root = new TreeNode ("Non-Alpha examples");
-			root.Children = items.Where (i => !char.IsLetterOrDigit (i [0])).Select (i => new TreeNode (i)).Cast<ITreeNode> ().ToList ();
+			root.Children = _items.Where (i => !char.IsLetterOrDigit (i [0])).Select (i => new TreeNode (i)).Cast<ITreeNode> ().ToList ();
 			_treeView.AddObject (root);
 			_treeView.ExpandAll ();
 		}