Tig 9 月之前
父节点
当前提交
1e99319367

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

@@ -803,7 +803,7 @@ public class ListView : View, IDesignable
     }
 
     /// <inheritdoc/>
-    public override bool OnProcessKeyDown (Key a)
+    public override bool OnKeyDown (Key a)
     {
         // Enable user to find & select an item by typing text
         if (CollectionNavigatorBase.IsCompatibleKey (a))

+ 1 - 1
Terminal.Gui/Views/TableView/TableView.cs

@@ -988,7 +988,7 @@ public class TableView : View
     }
 
     /// <inheritdoc/>
-    public override bool OnProcessKeyDown (Key keyEvent)
+    public override bool OnKeyDown (Key keyEvent)
     {
         if (TableIsNullOrInvisible ())
         {

+ 1 - 1
Terminal.Gui/Views/TreeView/TreeView.cs

@@ -1182,7 +1182,7 @@ public class TreeView<T> : View, ITreeView where T : class
     }
 
     /// <inheritdoc/>
-    public override bool OnProcessKeyDown (Key keyEvent)
+    public override bool OnKeyDown (Key keyEvent)
     {
         if (!Enabled)
         {

+ 22 - 22
UICatalog/UICatalog.cs

@@ -620,28 +620,28 @@ public class UICatalogApp
                                                 );
             ScenarioList.Style.ColumnStyles.Add (1, new () { MaxWidth = 1 });
 
-            // Enable user to find & select a scenario by typing text
-            // TableView does not (currently) have built-in CollectionNavigator support (the ability for the 
-            // user to type and the items that match get selected). We implement it in the app instead. 
-            ScenarioList.KeyDown += (s, a) =>
-                                    {
-                                        if (CollectionNavigatorBase.IsCompatibleKey (a))
-                                        {
-                                            int? newItem =
-                                                _scenarioCollectionNav?.GetNextMatchingItem (
-                                                                                             ScenarioList.SelectedRow,
-                                                                                             (char)a
-                                                                                            );
-
-                                            if (newItem is int v && newItem != -1)
-                                            {
-                                                ScenarioList.SelectedRow = v;
-                                                ScenarioList.EnsureSelectedCellIsVisible ();
-                                                ScenarioList.SetNeedsDisplay ();
-                                                a.Handled = true;
-                                            }
-                                        }
-                                    };
+            //// Enable user to find & select a scenario by typing text
+            //// TableView does not (currently) have built-in CollectionNavigator support (the ability for the 
+            //// user to type and the items that match get selected). We implement it in the app instead. 
+            //ScenarioList.KeyDown += (s, a) =>
+            //                        {
+            //                            if (CollectionNavigatorBase.IsCompatibleKey (a))
+            //                            {
+            //                                int? newItem =
+            //                                    _scenarioCollectionNav?.GetNextMatchingItem (
+            //                                                                                 ScenarioList.SelectedRow,
+            //                                                                                 (char)a
+            //                                                                                );
+
+            //                                if (newItem is int v && newItem != -1)
+            //                                {
+            //                                    ScenarioList.SelectedRow = v;
+            //                                    ScenarioList.EnsureSelectedCellIsVisible ();
+            //                                    ScenarioList.SetNeedsDisplay ();
+            //                                    a.Handled = true;
+            //                                }
+            //                            }
+            //                        };
             ScenarioList.CellActivated += ScenarioView_OpenSelectedItem;
 
             // TableView typically is a grid where nav keys are biased for moving left/right.