Sfoglia il codice sorgente

In the middle of another refactoroing

Tig 9 mesi fa
parent
commit
af110d92d0
100 ha cambiato i file con 568 aggiunte e 473 eliminazioni
  1. 2 2
      CommunityToolkitExample/LoginView.cs
  2. 1 1
      Example/Example.cs
  3. 1 1
      NativeAot/Program.cs
  4. 2 2
      ReactiveExample/LoginView.cs
  5. 1 1
      SelfContained/Program.cs
  6. 0 2
      Terminal.Gui/Application/Application.cs
  7. 2 2
      Terminal.Gui/FileServices/DefaultFileOperations.cs
  8. 5 8
      Terminal.Gui/Input/Command.cs
  9. 8 1
      Terminal.Gui/Input/KeyBindings.cs
  10. 2 1
      Terminal.Gui/View/Adornment/Margin.cs
  11. 59 43
      Terminal.Gui/View/View.Command.cs
  12. 1 1
      Terminal.Gui/View/View.Keyboard.cs
  13. 1 0
      Terminal.Gui/View/View.Mouse.cs
  14. 6 6
      Terminal.Gui/Views/Button.cs
  15. 31 14
      Terminal.Gui/Views/CheckBox.cs
  16. 3 3
      Terminal.Gui/Views/ColorPicker.cs
  17. 2 2
      Terminal.Gui/Views/DatePicker.cs
  18. 6 6
      Terminal.Gui/Views/FileDialog.cs
  19. 2 1
      Terminal.Gui/Views/Label.cs
  20. 35 29
      Terminal.Gui/Views/ListView.cs
  21. 1 1
      Terminal.Gui/Views/Menuv2.cs
  22. 1 1
      Terminal.Gui/Views/MessageBox.cs
  23. 2 2
      Terminal.Gui/Views/NumericUpDown.cs
  24. 44 30
      Terminal.Gui/Views/RadioGroup.cs
  25. 59 35
      Terminal.Gui/Views/Shortcut.cs
  26. 1 1
      Terminal.Gui/Views/Slider.cs
  27. 3 3
      Terminal.Gui/Views/StatusBar.cs
  28. 2 2
      Terminal.Gui/Views/TextView.cs
  29. 1 1
      Terminal.Gui/Views/TreeView/TreeView.cs
  30. 2 2
      Terminal.Gui/Views/Wizard/Wizard.cs
  31. 3 3
      UICatalog/KeyBindingsDialog.cs
  32. 2 2
      UICatalog/Scenarios/ASCIICustomButton.cs
  33. 1 1
      UICatalog/Scenarios/AdornmentEditor.cs
  34. 3 3
      UICatalog/Scenarios/Adornments.cs
  35. 4 4
      UICatalog/Scenarios/AllViewsTester.cs
  36. 5 5
      UICatalog/Scenarios/Bars.cs
  37. 16 16
      UICatalog/Scenarios/Buttons.cs
  38. 8 8
      UICatalog/Scenarios/CharacterMap.cs
  39. 1 1
      UICatalog/Scenarios/ChineseUI.cs
  40. 1 1
      UICatalog/Scenarios/Clipping.cs
  41. 2 2
      UICatalog/Scenarios/ComboBoxIteration.cs
  42. 4 4
      UICatalog/Scenarios/ComputedLayout.cs
  43. 1 1
      UICatalog/Scenarios/ConfigurationEditor.cs
  44. 1 1
      UICatalog/Scenarios/ContentScrolling.cs
  45. 2 2
      UICatalog/Scenarios/CsvEditor.cs
  46. 5 5
      UICatalog/Scenarios/Dialogs.cs
  47. 1 1
      UICatalog/Scenarios/DimAutoDemo.cs
  48. 16 16
      UICatalog/Scenarios/DynamicMenuBar.cs
  49. 11 11
      UICatalog/Scenarios/DynamicStatusBar.cs
  50. 5 5
      UICatalog/Scenarios/Editor.cs
  51. 1 1
      UICatalog/Scenarios/FileDialogExamples.cs
  52. 1 1
      UICatalog/Scenarios/GraphViewExample.cs
  53. 1 1
      UICatalog/Scenarios/Images.cs
  54. 2 2
      UICatalog/Scenarios/InteractiveTree.cs
  55. 1 1
      UICatalog/Scenarios/InvertColors.cs
  56. 3 3
      UICatalog/Scenarios/LineDrawing.cs
  57. 2 2
      UICatalog/Scenarios/ListColumns.cs
  58. 2 2
      UICatalog/Scenarios/ListViewWithSelection.cs
  59. 2 2
      UICatalog/Scenarios/ListsAndCombos.cs
  60. 3 3
      UICatalog/Scenarios/Localization.cs
  61. 3 3
      UICatalog/Scenarios/MenuBarScenario.cs
  62. 1 1
      UICatalog/Scenarios/MessageBoxes.cs
  63. 1 1
      UICatalog/Scenarios/Mouse.cs
  64. 2 2
      UICatalog/Scenarios/MultiColouredTable.cs
  65. 3 3
      UICatalog/Scenarios/NumericUpDownDemo.cs
  66. 4 4
      UICatalog/Scenarios/Progress.cs
  67. 3 3
      UICatalog/Scenarios/ProgressBarStyles.cs
  68. 1 1
      UICatalog/Scenarios/RunTExample.cs
  69. 6 6
      UICatalog/Scenarios/RuneWidthGreaterThanOne.cs
  70. 3 3
      UICatalog/Scenarios/Scrolling.cs
  71. 1 1
      UICatalog/Scenarios/SendKeys.cs
  72. 7 6
      UICatalog/Scenarios/Shortcuts.cs
  73. 1 1
      UICatalog/Scenarios/SingleBackgroundWorker.cs
  74. 1 1
      UICatalog/Scenarios/Sliders.cs
  75. 4 4
      UICatalog/Scenarios/TableEditor.cs
  76. 1 1
      UICatalog/Scenarios/Text.cs
  77. 8 8
      UICatalog/Scenarios/Threading.cs
  78. 1 1
      UICatalog/Scenarios/TimeAndDate.cs
  79. 2 2
      UICatalog/Scenarios/VkeyPacketSimulator.cs
  80. 2 2
      UICatalog/Scenarios/WindowsAndFrameViews.cs
  81. 1 1
      UICatalog/Scenarios/WizardAsView.cs
  82. 3 3
      UICatalog/Scenarios/Wizards.cs
  83. 1 1
      UICatalog/UICatalog.cs
  84. 3 3
      UnitTests/Application/MainLoopTests.cs
  85. 4 4
      UnitTests/Dialogs/DialogTests.cs
  86. 2 2
      UnitTests/Dialogs/MessageBoxTests.cs
  87. 4 0
      UnitTests/TestHelpers.cs
  88. 3 3
      UnitTests/View/HotKeyTests.cs
  89. 1 1
      UnitTests/View/Navigation/EnabledTests.cs
  90. 1 1
      UnitTests/View/Navigation/HasFocusTests.cs
  91. 22 15
      UnitTests/View/ViewCommandTests.cs
  92. 10 10
      UnitTests/Views/ButtonTests.cs
  93. 12 12
      UnitTests/Views/CheckBoxTests.cs
  94. 1 1
      UnitTests/Views/LabelTests.cs
  95. 3 3
      UnitTests/Views/ListViewTests.cs
  96. 1 1
      UnitTests/Views/MenuBarTests.cs
  97. 14 14
      UnitTests/Views/RadioGroupTests.cs
  98. 1 1
      UnitTests/Views/ScrollBarViewTests.cs
  99. 23 22
      UnitTests/Views/ShortcutTests.cs
  100. 7 7
      UnitTests/Views/TextFieldTests.cs

+ 2 - 2
CommunityToolkitExample/LoginView.cs

@@ -19,13 +19,13 @@ internal partial class LoginView : IRecipient<Message<LoginActions>>
                                      {
                                          ViewModel.Password = passwordInput.Text;
                                      };
-        loginButton.Accept += (_, _) =>
+        loginButton.Accepted += (_, _) =>
                               {
                                   if (!ViewModel.CanLogin) { return; }
                                   ViewModel.LoginCommand.Execute (null);
                               };
 
-        clearButton.Accept += (_, _) =>
+        clearButton.Accepted += (_, _) =>
                               {
                                   ViewModel.ClearCommand.Execute (null);
                               };

+ 1 - 1
Example/Example.cs

@@ -63,7 +63,7 @@ public class ExampleWindow : Window
         };
 
         // When login button is clicked display a message popup
-        btnLogin.Accept += (s, e) =>
+        btnLogin.Accepted += (s, e) =>
                            {
                                if (userNameText.Text == "admin" && passwordText.Text == "password")
                                {

+ 1 - 1
NativeAot/Program.cs

@@ -93,7 +93,7 @@ public class ExampleWindow : Window
         };
 
         // When login button is clicked display a message popup
-        btnLogin.Accept += (s, e) =>
+        btnLogin.Accepted += (s, e) =>
         {
             if (userNameText.Text == "admin" && passwordText.Text == "password")
             {

+ 2 - 2
ReactiveExample/LoginView.cs

@@ -108,7 +108,7 @@ public class LoginView : Window, IViewFor<LoginViewModel>
 
                 login
                     .Events ()
-                    .Accept
+                    .Accepted
                     .InvokeCommand (ViewModel, x => x.Login)
                     .DisposeWith (_disposable);
             })
@@ -120,7 +120,7 @@ public class LoginView : Window, IViewFor<LoginViewModel>
 
                 clear
                     .Events ()
-                    .Accept
+                    .Accepted
                     .InvokeCommand (ViewModel, x => x.ClearCommand)
                     .DisposeWith (_disposable);
             })

+ 1 - 1
SelfContained/Program.cs

@@ -92,7 +92,7 @@ public class ExampleWindow : Window
         };
 
         // When login button is clicked display a message popup
-        btnLogin.Accept += (s, e) =>
+        btnLogin.Accepted += (s, e) =>
                            {
                                if (userNameText.Text == "admin" && passwordText.Text == "password")
                                {

+ 0 - 2
Terminal.Gui/Application/Application.cs

@@ -214,8 +214,6 @@ public static partial class Application
 
         AddApplicationKeyBindings ();
 
-        Colors.Reset ();
-
         // Reset synchronization context to allow the user to run async/await,
         // as the main loop has been ended, the synchronization context from
         // gui.cs does no longer process any callbacks. See #1084 for more details:

+ 2 - 2
Terminal.Gui/FileServices/DefaultFileOperations.cs

@@ -135,14 +135,14 @@ public class DefaultFileOperations : IFileOperations
         var confirm = false;
         var btnOk = new Button { IsDefault = true, Text = Strings.btnOk };
 
-        btnOk.Accept += (s, e) =>
+        btnOk.Accepted += (s, e) =>
                          {
                              confirm = true;
                              Application.RequestStop ();
                          };
         var btnCancel = new Button { Text = Strings.btnCancel };
 
-        btnCancel.Accept += (s, e) =>
+        btnCancel.Accepted += (s, e) =>
                              {
                                  confirm = false;
                                  Application.RequestStop ();

+ 5 - 8
Terminal.Gui/Input/Command.cs

@@ -15,9 +15,8 @@ public enum Command
     /// <summary>
     ///     Accepts the current state of the View (e.g. list selection, button press, checkbox state, etc.).
     ///     <para>
-    ///         The default implementation in <see cref="View"/> calls <see cref="View.RaiseAcceptEvent"/> which raises the
-    ///         <see cref="View.Accept"/> event. If the event is not handled,
-    ///         the command is invoked on
+    ///         The default implementation in <see cref="View"/> calls <see cref="View.RaiseAccepted"/>. If the event is not handled,
+    ///         the command is invoked on:
     ///             - Any peer-view that is a <see cref="Button"/> with <see cref="Button.IsDefault"/> set to <see langword="true"/>.
     ///             - The <see cref="View.SuperView"/>. This enables default Accept behavior.
     ///     </para>
@@ -28,17 +27,15 @@ public enum Command
     ///     Performs a hot key action (e.g. setting focus, accepting, and/or moving focus to the next View).
     ///     <para>
     ///         The default implementation in <see cref="View"/> calls <see cref="View.SetFocus"/> and then
-    ///         <see cref="View.RaiseHotKeyCommandEvent"/> which raises the
-    ///         <see cref="View.HotKeyCommand"/> event.
+    ///         <see cref="View.RaiseHotKeyHandled"/>.
     ///     </para>
     /// </summary>
     HotKey,
 
     /// <summary>
-    ///     Selects an item (e.g. a list item or menu item) without necessarily accepting it.
+    ///     Selects the View or an item in the View (e.g. a list item or menu item) without necessarily accepting it.
     ///     <para>
-    ///         The default implementation in <see cref="View"/> calls <see cref="View.RaiseSelectEvent"/> which raises the
-    ///         <see cref="View.Select"/> event.
+    ///         The default implementation in <see cref="View"/> calls <see cref="View.RaiseSelected"/>.
     ///     </para>
     /// </summary>
     Select,

+ 8 - 1
Terminal.Gui/Input/KeyBindings.cs

@@ -284,7 +284,6 @@ public class KeyBindings
         return Array.Empty<Command> ();
     }
 
-    // TODO: Consider having this return all keys bound to the commands
     /// <summary>Gets the first Key bound to the set of commands specified by <paramref name="commands"/>.</summary>
     /// <param name="commands">The set of commands to search.</param>
     /// <returns>The first <see cref="Key"/> bound to the set of commands specified by <paramref name="commands"/>. <see langword="null"/> if the set of caommands was not found.</returns>
@@ -293,6 +292,14 @@ public class KeyBindings
         return Bindings.FirstOrDefault (a => a.Value.Commands.SequenceEqual (commands)).Key;
     }
 
+    /// <summary>Gets Keys bound to the set of commands specified by <paramref name="commands"/>.</summary>
+    /// <param name="commands">The set of commands to search.</param>
+    /// <returns>The <see cref="Key"/>s bound to the set of commands specified by <paramref name="commands"/>. An empty list if the set of caommands was not found.</returns>
+    public IEnumerable<Key> GetKeysFromCommands (params Command [] commands)
+    {
+        return Bindings.Where (a => a.Value.Commands.SequenceEqual (commands)).Select (a => a.Key);
+    }
+
     /// <summary>Removes a <see cref="KeyBinding"/> from the collection.</summary>
     /// <param name="key"></param>
     /// <param name="boundViewForAppScope">Optional View for <see cref="KeyBindingScope.Application"/> bindings.</param>

+ 2 - 1
Terminal.Gui/View/Adornment/Margin.cs

@@ -18,7 +18,8 @@ public class Margin : Adornment
     {
         /* Do nothing; View.CreateAdornment requires a constructor that takes a parent */
 
-        HighlightStyle |= HighlightStyle.Pressed;
+        // BUGBUG: We should not set HighlightStyle.Pressed here, but wherever it is actually needed
+       // HighlightStyle |= HighlightStyle.Pressed;
         Highlight += Margin_Highlight;
         LayoutStarted += Margin_LayoutStarted;
 

+ 59 - 43
Terminal.Gui/View/View.Command.cs

@@ -12,40 +12,56 @@ public partial class View // Command APIs
     /// </summary>
     private void SetupCommands ()
     {
-        AddCommand (Command.Accept, RaiseAcceptEvent);
+        // Enter - Raise Accepted
+        AddCommand (Command.Accept, RaiseAccepted);
 
-        AddCommand (
-                    Command.HotKey,
+        // HotKey - SetFocus and raise HotKeyHandled
+        AddCommand (Command.HotKey,
                     () =>
                     {
                         SetFocus ();
 
-                        return RaiseHotKeyCommandEvent ();
+                        return RaiseHotKeyHandled ();
                     });
 
-        AddCommand (Command.Select, RaiseSelectEvent);
+        // Space or single-click - Raise Selected
+        AddCommand (Command.Select, () =>
+                                    {
+                                        bool? cancelled = RaiseSelected ();
+                                        if (cancelled is null or false && CanFocus)
+                                        {
+                                            SetFocus ();
+
+                                            return true;
+                                        }
+
+                                        return cancelled is true;
+                                    });
     }
 
     /// <summary>
-    ///     Called when the <see cref="Command.Accept"/> command is invoked. Raises <see cref="Accept"/>
-    ///     event.
+    ///     Called when the View's state has been accepted by the user. Calls <see cref="OnAccepted"/> which can be cancelled; if not cancelled raises <see cref="Accepted"/>.
+    ///     event. The default <see cref="Command.Accept"/> handler calls this method.
     /// </summary>
+    /// <remarks>
+    ///     The <see cref="Accepted"/> event should raised after the state of the View has changed (after <see cref="Selected"/> is raised).
+    /// </remarks>
     /// <returns>
     ///     If <see langword="true"/> the event was canceled. If <see langword="false"/> the event was raised but not canceled.
     ///     If <see langword="null"/> no event was raised.
     /// </returns>
-    protected bool? RaiseAcceptEvent ()
+    protected bool? RaiseAccepted ()
     {
         HandledEventArgs args = new ();
 
         // Best practice is to invoke the virtual method first.
         // This allows derived classes to handle the event and potentially cancel it.
-        args.Handled = OnAccept (args) || args.Handled;
+        args.Handled = OnAccepted (args) || args.Handled;
 
         if (!args.Handled)
         {
             // If the event is not canceled by the virtual method, raise the event to notify any external subscribers.
-            Accept?.Invoke (this, args);
+            Accepted?.Invoke (this, args);
         }
 
         // Accept is a special case where if the event is not canceled, the event is
@@ -68,108 +84,108 @@ public partial class View // Command APIs
             return SuperView?.InvokeCommand (Command.Accept) == true;
         }
 
-        return Accept is null ? null : args.Handled;
+        return Accepted is null ? null : args.Handled;
     }
 
+    // TODO: Change this to CancelEventArgs
     /// <summary>
-    ///     Called when the <see cref="Command.Accept"/> command is received. Set <see cref="HandledEventArgs.Handled"/> to
+    ///     Called when the View's state has been accepted by the user. Set <see cref="HandledEventArgs.Handled"/> to
     ///     <see langword="true"/> to stop processing.
     /// </summary>
     /// <param name="args"></param>
     /// <returns><see langword="true"/> to stop processing.</returns>
-    protected virtual bool OnAccept (HandledEventArgs args) { return false; }
+    protected virtual bool OnAccepted (HandledEventArgs args) { return false; }
 
     /// <summary>
-    ///     Cancelable event raised when the <see cref="Command.Accept"/> command is invoked. Set
-    ///     <see cref="HandledEventArgs.Handled"/>
-    ///     to cancel the event.
+    ///     Cancelable event raised when the View's state has been accepted by the user. Set
+    ///     <see cref="HandledEventArgs.Handled"/> to cancel the event.
     /// </summary>
-    public event EventHandler<HandledEventArgs>? Accept;
+    public event EventHandler<HandledEventArgs>? Accepted;
 
     /// <summary>
-    ///     Called when the <see cref="Command.Select"/> command is invoked. Raises <see cref="Select"/>
-    ///     event.
+    ///     Called when the user has selected the View or otherwise changed the state of the View. Calls <see cref="OnSelected"/> which can be cancelled; if not cancelled raises <see cref="Accepted"/>.
+    ///     event. The default <see cref="Command.Select"/> handler calls this method.
     /// </summary>
+    /// <remarks>
+    ///     The <see cref="Selected"/> event should raised after the state of the View has been changed and before see <see cref="Accepted"/>.
+    /// </remarks>
     /// <returns>
     ///     If <see langword="true"/> the event was canceled. If <see langword="false"/> the event was raised but not canceled.
     ///     If <see langword="null"/> no event was raised.
     /// </returns>
-    protected bool? RaiseSelectEvent ()
+    protected bool? RaiseSelected ()
     {
         HandledEventArgs args = new ();
 
         // Best practice is to invoke the virtual method first.
         // This allows derived classes to handle the event and potentially cancel it.
-        if (OnSelect (args) || args.Handled)
+        if (OnSelected (args) || args.Handled)
         {
             return true;
         }
 
         // If the event is not canceled by the virtual method, raise the event to notify any external subscribers.
-        Select?.Invoke (this, args);
-
-        if ((Select is null || !args.Handled) && CanFocus)
-        {
-            SetFocus ();
-        }
+        Selected?.Invoke (this, args);
 
-        return Select is null ? null : args.Handled;
+        return Selected is null ? null : args.Handled;
     }
 
     /// <summary>
-    ///     Called when the <see cref="Command.Select"/> command is received. Set <see cref="HandledEventArgs.Handled"/> to
+    ///     Called when the user has selected the View or otherwise changed the state of the View. Set <see cref="HandledEventArgs.Handled"/> to
     ///     <see langword="true"/> to stop processing.
     /// </summary>
     /// <param name="args"></param>
     /// <returns><see langword="true"/> to stop processing.</returns>
-    protected virtual bool OnSelect (HandledEventArgs args) { return false; }
+    protected virtual bool OnSelected (HandledEventArgs args) { return false; }
 
     /// <summary>
-    ///     Cancelable event raised when the <see cref="Command.Select"/> command is invoked. Set
+    ///     Cancelable event raised when the user has selected the View or otherwise changed the state of the View. Set
     ///     <see cref="HandledEventArgs.Handled"/>
     ///     to cancel the event.
     /// </summary>
-    public event EventHandler<HandledEventArgs>? Select;
+    public event EventHandler<HandledEventArgs>? Selected;
+
 
+    // TODO: What does this event really do? "Called when the user has pressed the View's hot key or otherwise invoked the View's hot key command.???"
     /// <summary>
-    ///     Called when the <see cref="Command.HotKey"/> command is invoked. Raises <see cref="HotKey"/>
-    ///     event.
+    ///     Called when the View has handled the user pressing the View's <see cref="HotKey"/>. Calls <see cref="OnHotKeyHandled"/> which can be cancelled; if not cancelled raises <see cref="Accepted"/>.
+    ///     event. The default <see cref="Command.HotKey"/> handler calls this method.
     /// </summary>
     /// <returns>
     ///     If <see langword="true"/> the event was handled. If <see langword="false"/> the event was raised but not handled.
     ///     If <see langword="null"/> no event was raised.
     /// </returns>
-    protected bool? RaiseHotKeyCommandEvent ()
+    protected bool? RaiseHotKeyHandled ()
     {
         HandledEventArgs args = new ();
 
         // Best practice is to invoke the virtual method first.
         // This allows derived classes to handle the event and potentially cancel it.
-        if (OnHotKeyCommand (args) || args.Handled)
+        if (OnHotKeyHandled (args) || args.Handled)
         {
             return true;
         }
 
         // If the event is not canceled by the virtual method, raise the event to notify any external subscribers.
-        HotKeyCommand?.Invoke (this, args);
+        HotKeyHandled?.Invoke (this, args);
 
-        return HotKeyCommand is null ? null : args.Handled;
+        return HotKeyHandled is null ? null : args.Handled;
     }
 
     /// <summary>
-    ///     Called when the <see cref="Command.HotKey"/> command is received. Set <see cref="HandledEventArgs.Handled"/> to
+    ///     Called when the View has handled the user pressing the View's <see cref="HotKey"/>. Set <see cref="HandledEventArgs.Handled"/> to
     ///     <see langword="true"/> to stop processing.
     /// </summary>
     /// <param name="args"></param>
     /// <returns><see langword="true"/> to stop processing.</returns>
-    protected virtual bool OnHotKeyCommand (HandledEventArgs args) { return false; }
+    protected virtual bool OnHotKeyHandled (HandledEventArgs args) { return false; }
 
     /// <summary>
     ///     Cancelable event raised when the <see cref="Command.HotKey"/> command is invoked. Set
     ///     <see cref="HandledEventArgs.Handled"/>
     ///     to cancel the event.
     /// </summary>
-    public event EventHandler<HandledEventArgs>? HotKeyCommand;
+    public event EventHandler<HandledEventArgs>? HotKeyHandled;
 
     #endregion Default Implementation
 
@@ -227,7 +243,7 @@ public partial class View // Command APIs
     /// <param name="keyBinding"></param>
     /// <returns>
     ///     <see langword="null"/> if no command was found.
-    ///     <see langword="true"/> if the command was invoked the command was handled.
+    ///     <see langword="true"/> if the command was invoked the command was handled (or cancelled)
     ///     <see langword="false"/> if the command was invoked and the command was not handled.
     /// </returns>
     public bool? InvokeCommands (Command [] commands, Key? key = null, KeyBinding? keyBinding = null)
@@ -263,7 +279,7 @@ public partial class View // Command APIs
     /// <param name="keyBinding"></param>
     /// <returns>
     ///     <see langword="null"/> if no command was found. <see langword="true"/> if the command was invoked, and it
-    ///     handled the command. <see langword="false"/> if the command was invoked, and it did not handle the command.
+    ///     handled (or cancelled) the command. <see langword="false"/> if the command was invoked, and it did not handle (or cancel) the command.
     /// </returns>
     public bool? InvokeCommand (Command command, Key? key = null, KeyBinding? keyBinding = null)
     {

+ 1 - 1
Terminal.Gui/View/View.Keyboard.cs

@@ -39,7 +39,7 @@ public partial class View // Keyboard APIs
     ///     <para>
     ///         A HotKey is a keypress that causes a visible UI item to perform an action. For example, in a Dialog,
     ///         with a Button with the text of "_Text" <c>Alt+T</c> will cause the button to gain focus and to raise its
-    ///         <see cref="Accept"/> event.
+    ///         <see cref="Accepted"/> event.
     ///         Or, in a
     ///         <see cref="Menu"/> with "_File _Edit", <c>Alt+F</c> will select (show) the "_File" menu. If the "_File" menu
     ///         has a

+ 1 - 0
Terminal.Gui/View/View.Mouse.cs

@@ -399,6 +399,7 @@ public partial class View // Mouse APIs
 
             if (SetPressedHighlight (HighlightStyle.None))
             {
+                // BUGBUG: If we retrun true here we never generate a moues click!
                 return true;
             }
 

+ 6 - 6
Terminal.Gui/Views/Button.cs

@@ -8,12 +8,12 @@
 namespace Terminal.Gui;
 
 /// <summary>
-///     A View that raises the <see cref="View.Accept"/> event when clicked with the mouse or when the
+///     A View that raises the <see cref="View.Accepted"/> event when clicked with the mouse or when the
 ///     <see cref="View.HotKey"/>, <c>Enter</c>, or <c>Space</c> key is pressed.
 /// </summary>
 /// <remarks>
 ///     <para>
-///         Provides a button showing text that raises the <see cref="View.Accept"/> event when clicked on with a mouse or
+///         Provides a button showing text that raises the <see cref="View.Accepted"/> event when clicked on with a mouse or
 ///         when the user presses <c>Enter</c>, <c>Space</c> or the <see cref="View.HotKey"/>. The hot key is the first
 ///         letter or digit
 ///         following the first underscore ('_') in the button text.
@@ -21,13 +21,13 @@ namespace Terminal.Gui;
 ///     <para>Use <see cref="View.HotKeySpecifier"/> to change the hot key specifier from the default of ('_').</para>
 ///     <para>
 ///         When the button is configured as the default (<see cref="IsDefault"/>) and the user causes the button to be
-///         accepted the <see cref="Button"/>'s <see cref="View.Accept"/> event will be raised. If the Accept event is not
+///         accepted the <see cref="Button"/>'s <see cref="View.Accepted"/> event will be raised. If the Accept event is not
 ///         handled, the Accept event on the <see cref="View.SuperView"/>. will be raised. This enables default Accept
 ///         behavior.
 ///     </para>
 ///     <para>
 ///         Set <see cref="View.WantContinuousButtonPressed"/> to <see langword="true"/> to have the
-///         <see cref="View.Accept"/> event
+///         <see cref="View.Accepted"/> event
 ///         invoked repeatedly while the button is pressed.
 ///     </para>
 /// </remarks>
@@ -74,7 +74,7 @@ public class Button : View, IDesignable
                     {
                         bool cachedIsDefault = IsDefault; // Supports "Swap Default" in Buttons scenario where IsDefault changes
 
-                        bool? handled = RaiseAcceptEvent ();
+                        bool? handled = RaiseAccepted ();
 
                         if (handled == true)
                         {
@@ -159,7 +159,7 @@ public class Button : View, IDesignable
     ///     <see langword="true"/>
     ///     <see cref="Command.Accept"/> will be invoked when the user presses <c>Enter</c> and no other peer-
     ///     <see cref="View"/> processes the key.
-    ///     If <see cref="View.Accept"/> is not handled, the Gets or sets whether the <see cref="Button"/> will show an
+    ///     If <see cref="View.Accepted"/> is not handled, the Gets or sets whether the <see cref="Button"/> will show an
     ///     indicator indicating it is the default Button. If <see langword="true"/>
     ///     <see cref="Command.Accept"/> command on the <see cref="View.SuperView"/> will be invoked.
     /// </summary>

+ 31 - 14
Terminal.Gui/Views/CheckBox.cs

@@ -23,13 +23,39 @@ public class CheckBox : View
         CanFocus = true;
 
         // Select (Space key and single-click) - Advance state and raise Select event
-        AddCommand (Command.Select, () => AdvanceCheckState () is false);
+        AddCommand (Command.Select, () =>
+                                    {
+                                        bool? cancelled = AdvanceCheckState ();
 
-        // Accept (Enter key and double-click) - Raise Accept event - DO NOT advance state
-        AddCommand (Command.Accept, () => RaiseAcceptEvent ());
+                                        if (cancelled is null or false)
+                                        {
+                                            if (RaiseSelected () == true)
+                                            {
+                                                return true;
+                                            }
+                                        }
+
+                                        return cancelled is false;
+                                    });
+
+        // Accept (Enter key) - Raise Accept event - DO NOT advance state
+        AddCommand (Command.Accept, () => RaiseAccepted ());
 
         // Hotkey - Advance state and raise Select event - DO NOT raise Accept
-        AddCommand (Command.HotKey, () => AdvanceCheckState () is false);
+        AddCommand (Command.HotKey, () =>
+                                    {
+                                        bool? cancelled = AdvanceCheckState ();
+
+                                        if (cancelled is null or false)
+                                        {
+                                            if (RaiseSelected () == true)
+                                            {
+                                                return true;
+                                            }
+                                        }
+
+                                        return cancelled;
+                                    });
 
         TitleChanged += Checkbox_TitleChanged;
 
@@ -41,8 +67,7 @@ public class CheckBox : View
     {
         if (e.MouseEvent.Flags.HasFlag (MouseFlags.Button1Clicked))
         {
-            // AdvanceCheckState returns false if the state was changed
-            e.Handled = AdvanceCheckState () is false;
+            e.Handled = InvokeCommand (Command.Select) is true;
         }
     }
 
@@ -215,14 +240,6 @@ public class CheckBox : View
 
         bool? cancelled = ChangeCheckedState (e.NewValue);
 
-        if (cancelled is null or false)
-        {
-            if (RaiseSelectEvent () == true)
-            {
-                return true;
-            }
-        }
-
         return cancelled;
     }
 

+ 3 - 3
Terminal.Gui/Views/ColorPicker.cs

@@ -64,7 +64,7 @@ public class ColorPicker : View
                     Width = textFieldWidth
                 };
                 tfValue.HasFocusChanged += UpdateSingleBarValueFromTextField;
-                tfValue.Accept += (s, _)=>UpdateSingleBarValueFromTextField(s);
+                tfValue.Accepted += (s, _)=>UpdateSingleBarValueFromTextField(s);
                 _textFields.Add (bar, tfValue);
             }
 
@@ -154,7 +154,7 @@ public class ColorPicker : View
         _tfName.Autocomplete = auto;
 
         _tfName.HasFocusChanged += UpdateValueFromName;
-        _tfName.Accept += (s, _) => UpdateValueFromName ();
+        _tfName.Accepted += (s, _) => UpdateValueFromName ();
     }
 
     private void CreateTextField ()
@@ -184,7 +184,7 @@ public class ColorPicker : View
         Add (_tfHex);
 
         _tfHex.HasFocusChanged += UpdateValueFromTextField;
-        _tfHex.Accept += (_,_)=> UpdateValueFromTextField();
+        _tfHex.Accepted += (_,_)=> UpdateValueFromTextField();
     }
 
     private void DisposeOldViews ()

+ 2 - 2
Terminal.Gui/Views/DatePicker.cs

@@ -227,7 +227,7 @@ public class DatePicker : View
             ShadowStyle = ShadowStyle.None
         };
 
-        _previousMonthButton.Accept += (sender, e) =>
+        _previousMonthButton.Accepted += (sender, e) =>
                                         {
                                             Date = _date.AddMonths (-1);
                                             CreateCalendar ();
@@ -247,7 +247,7 @@ public class DatePicker : View
             ShadowStyle = ShadowStyle.None
         };
 
-        _nextMonthButton.Accept += (sender, e) =>
+        _nextMonthButton.Accepted += (sender, e) =>
                                     {
                                         Date = _date.AddMonths (1);
                                         CreateCalendar ();

+ 6 - 6
Terminal.Gui/Views/FileDialog.cs

@@ -78,7 +78,7 @@ public class FileDialog : Dialog
             Y = Pos.AnchorEnd (),
             IsDefault = true, Text = Style.OkButtonText
         };
-        _btnOk.Accept += (s, e) => Accept (true);
+        _btnOk.Accepted += (s, e) => Accept (true);
 
 
         _btnCancel = new Button
@@ -88,7 +88,7 @@ public class FileDialog : Dialog
             Text = Strings.btnCancel
         };
 
-        _btnCancel.Accept += (s, e) =>
+        _btnCancel.Accepted += (s, e) =>
         {
             Canceled = true;
             Application.RequestStop ();
@@ -96,15 +96,15 @@ public class FileDialog : Dialog
 
         _btnUp = new Button { X = 0, Y = 1, NoPadding = true };
         _btnUp.Text = GetUpButtonText ();
-        _btnUp.Accept += (s, e) => _history.Up ();
+        _btnUp.Accepted += (s, e) => _history.Up ();
 
         _btnBack = new Button { X = Pos.Right (_btnUp) + 1, Y = 1, NoPadding = true };
         _btnBack.Text = GetBackButtonText ();
-        _btnBack.Accept += (s, e) => _history.Back ();
+        _btnBack.Accepted += (s, e) => _history.Back ();
 
         _btnForward = new Button { X = Pos.Right (_btnBack) + 1, Y = 1, NoPadding = true };
         _btnForward.Text = GetForwardButtonText ();
-        _btnForward.Accept += (s, e) => _history.Forward ();
+        _btnForward.Accepted += (s, e) => _history.Forward ();
 
         _tbPath = new TextField { Width = Dim.Fill (), CaptionColor = new Color (Color.Black) };
 
@@ -182,7 +182,7 @@ public class FileDialog : Dialog
             Y = Pos.AnchorEnd (), Text = GetToggleSplitterText (false)
         };
 
-        _btnToggleSplitterCollapse.Accept += (s, e) =>
+        _btnToggleSplitterCollapse.Accepted += (s, e) =>
                                               {
                                                   Tile tile = _splitContainer.Tiles.ElementAt (0);
 

+ 2 - 1
Terminal.Gui/Views/Label.cs

@@ -27,13 +27,14 @@ public class Label : View
         Height = Dim.Auto (DimAutoStyle.Text);
         Width = Dim.Auto (DimAutoStyle.Text);
 
-        // Things this view knows how to do
+        // On HoKey, pass it to the next view
         AddCommand (Command.HotKey, InvokeHotKeyOnNext);
 
         TitleChanged += Label_TitleChanged;
         MouseClick += Label_MouseClick;
     }
 
+    // TODO: base raises Select, but we want to raise HotKey. This can be simplified?
     private void Label_MouseClick (object sender, MouseEventEventArgs e)
     {
         if (!CanFocus)

+ 35 - 29
Terminal.Gui/Views/ListView.cs

@@ -6,7 +6,7 @@ using static Terminal.Gui.SpinnerStyle;
 namespace Terminal.Gui;
 
 /// <summary>Implement <see cref="IListDataSource"/> to provide custom rendering for a <see cref="ListView"/>.</summary>
-public interface IListDataSource: IDisposable
+public interface IListDataSource : IDisposable
 {
     /// <summary>
     /// Event to raise when an item is added, removed, or moved, or the entire list is refreshed.
@@ -137,31 +137,47 @@ public class ListView : View, IDesignable
         AddCommand (Command.ScrollLeft, () => ScrollHorizontal (-1));
         AddCommand (Command.ScrollRight, () => ScrollHorizontal (1));
 
-        AddCommand (Command.Accept, () => OnOpenSelectedItem ());
-        AddCommand (Command.Open, () => OnOpenSelectedItem ());
-        AddCommand (Command.Select, () =>
+        // Accept (Enter key) - Raise Accept event - DO NOT advance state
+        AddCommand (Command.Accept, () =>
                                     {
-                                        if (RaiseSelectEvent () == true)
+                                        if (OnOpenSelectedItem () && RaiseAccepted () == true)
                                         {
-                                            return true;
-
+                                                return true;
                                         }
+
+                                        return false;
+                                    });
+
+        // Select (Space key and single-click) - If markable, change mark and raise Select event
+        AddCommand (Command.Select, () =>
+                                    {
                                         if (_allowsMarking)
                                         {
-                                            return MarkUnmarkSelectedItem ();
+                                            if (MarkUnmarkSelectedItem () && RaiseSelected () == true)
+                                            {
+                                                return true;
+                                            }
                                         }
 
                                         return false;
                                     });
-        AddCommand(Command.HotKey, () =>
-                                   {
-                                       if (SelectedItem == -1)
-                                       {
-                                           SelectedItem = 0;
-                                       }
 
-                                       return !SetFocus ();
-                                   });
+
+        // Hotkey - If none set, select and raise Select event. SetFocus. - DO NOT raise Accept
+        AddCommand (Command.HotKey, () =>
+                                    {
+                                        if (SelectedItem == -1)
+                                        {
+                                            SelectedItem = 0;
+                                            if (RaiseSelected () == true)
+                                            {
+                                                return true;
+
+                                            }
+                                        }
+
+                                        return !SetFocus ();
+                                    });
 
 
         // Default keybindings for all ListViews
@@ -179,10 +195,6 @@ public class ListView : View, IDesignable
         KeyBindings.Add (Key.Home, Command.Start);
 
         KeyBindings.Add (Key.End, Command.End);
-
-        // BUGBUG: This should just be Command.Accept
-        KeyBindings.Remove (Key.Enter);
-        KeyBindings.Add (Key.Enter, Command.Open);
     }
 
     /// <summary>Gets or sets whether this <see cref="ListView"/> allows items to be marked.</summary>
@@ -476,9 +488,9 @@ public class ListView : View, IDesignable
 
         _selected = Viewport.Y + me.Position.Y;
 
-        if (MarkUnmarkSelectedItem())
+        if (MarkUnmarkSelectedItem ())
         {
-           // return true;
+            // return true;
         }
 
         OnSelectedChanged ();
@@ -486,7 +498,7 @@ public class ListView : View, IDesignable
 
         if (me.Flags == MouseFlags.Button1DoubleClicked)
         {
-            return OnOpenSelectedItem ();
+            return InvokeCommand (Command.Accept) is true;
         }
 
         return true;
@@ -774,12 +786,6 @@ public class ListView : View, IDesignable
 
         object value = _source.ToList () [_selected];
 
-        // By default, Command.Accept calls OnAccept, so we need to call it here to ensure that the event is fired.
-        if (RaiseAcceptEvent () == true)
-        {
-            return true;
-        }
-
         OpenSelectedItem?.Invoke (this, new ListViewItemEventArgs (_selected, value));
 
         // BUGBUG: this should not blindly return true.

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

@@ -76,7 +76,7 @@ public class Menuv2 : Bar
             // TODO: instead, add a property (a style enum?) to Shortcut to control this
             //shortcut.AlignmentModes = AlignmentModes.EndToStart;
 
-            shortcut.Accept += ShortcutOnAccept;
+            shortcut.Accepted += ShortcutOnAccept;
 
             void ShortcutOnAccept (object sender, HandledEventArgs e)
             {

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

@@ -408,7 +408,7 @@ public static class MessageBox
             int buttonId = n;
             Button b = buttonList [n];
 
-            b.Accept += (s, e) =>
+            b.Accepted += (s, e) =>
                          {
                              Clicked = buttonId;
                              Application.RequestStop ();

+ 2 - 2
Terminal.Gui/Views/NumericUpDown.cs

@@ -86,8 +86,8 @@ public class NumericUpDown<T> : View where T : notnull
 
         CanFocus = true;
 
-        _down.Accept += OnDownButtonOnAccept;
-        _up.Accept += OnUpButtonOnAccept;
+        _down.Accepted += OnDownButtonOnAccept;
+        _up.Accepted += OnUpButtonOnAccept;
 
         Add (_down, _number, _up);
 

+ 44 - 30
Terminal.Gui/Views/RadioGroup.cs

@@ -1,4 +1,6 @@
 #nullable enable
+using System.Diagnostics;
+
 namespace Terminal.Gui;
 
 /// <summary>Displays a group of labels with an idicator of which one is selected.</summary>
@@ -76,32 +78,35 @@ public class RadioGroup : View, IDesignable, IOrientation
                     Command.Select,
                     () =>
                     {
+                        bool cursorChanged = false;
                         if (SelectedItem == Cursor)
                         {
-                            if (!MoveDownRight ())
+                            cursorChanged = MoveDownRight ();
+                            if (!cursorChanged)
                             {
-                                MoveHome ();
+                                cursorChanged = MoveHome ();
                             }
                         }
 
-                        if (ChangeSelectedItem (Cursor) is true)
-                        {
-                            return true;
-                        };
-
-                        if (RaiseSelectEvent () == true)
+                        if (SelectedItem != Cursor)
                         {
-                            return true;
+                            if (ChangeSelectedItem (Cursor) && RaiseSelected () == true)
+                            {
+                                return true;
+                            }
                         }
 
-                        return false;
+                        return cursorChanged;
                     });
 
         // Accept (Enter key) - Raise Accept event - DO NOT advance state
-        AddCommand (Command.Accept, RaiseAcceptEvent);
+        AddCommand (Command.Accept, RaiseAccepted);
 
-        AddCommand (
-                    Command.HotKey,
+        // Hotkey - ctx may indicate a radio item hotkey was pressed. Beahvior depends on HasFocus
+        //          If HasFocus and it's this.HotKey invoke Select command - DO NOT raise Accept
+        //          If it's a radio item HotKey select that item and raise Seelcted event - DO NOT raise Accept
+        //          If nothing is selected, select first and raise Selected event - DO NOT raise Accept
+        AddCommand (Command.HotKey,
                     ctx =>
                     {
                         var item = ctx.KeyBinding?.Context as int?;
@@ -123,12 +128,7 @@ public class RadioGroup : View, IDesignable, IOrientation
                             }
 
                             // If a RadioItem.HotKey is pressed we always set the selected item - never SetFocus
-                            if (ChangeSelectedItem (item.Value) == true)
-                            {
-                                return true;
-                            }
-
-                            if (RaiseSelectEvent () == true)
+                            if (ChangeSelectedItem (item.Value) && RaiseSelected () == true)
                             {
                                 return true;
                             }
@@ -136,11 +136,16 @@ public class RadioGroup : View, IDesignable, IOrientation
                             return false;
                         }
 
-                        if (SelectedItem == -1 && ChangeSelectedItem (0) == true)
+                        if (SelectedItem == -1 && ChangeSelectedItem (0))
                         {
-                            return true;
+                            if (RaiseSelected () == true)
+                            {
+                                return true;
+                            }
+                            return false;
                         }
 
+                        // Default Command.Hotkey sets focus
                         SetFocus ();
 
                         return true;
@@ -188,7 +193,7 @@ public class RadioGroup : View, IDesignable, IOrientation
     }
 
     /// <summary>
-    ///     Gets or sets whether double clicking on a Radio Item will cause the <see cref="View.Accept"/> event to be raised.
+    ///     Gets or sets whether double clicking on a Radio Item will cause the <see cref="View.Accepted"/> event to be raised.
     /// </summary>
     /// <remarks>
     ///     <para>
@@ -220,7 +225,7 @@ public class RadioGroup : View, IDesignable, IOrientation
 
                 if (c > -1)
                 {
-                    if (ChangeSelectedItem (c) == false)
+                    if (ChangeSelectedItem (c))
                     {
                         Cursor = c;
                         e.Handled = true;
@@ -233,7 +238,7 @@ public class RadioGroup : View, IDesignable, IOrientation
         {
             int savedSelectedItem = SelectedItem;
 
-            if (RaiseAcceptEvent () == true)
+            if (RaiseAccepted () == true)
             {
                 e.Handled = false;
                 _selected = savedSelectedItem;
@@ -322,14 +327,13 @@ public class RadioGroup : View, IDesignable, IOrientation
     /// </summary>
     /// <param name="value"></param>
     /// <returns>
-    ///     <see langword="true"/> if state change was canceled, <see langword="false"/> if the state changed, and
-    ///     <see langword="null"/> if the state was not changed for some other reason.
+    ///     <see langword="true"/> if the selected item changed.
     /// </returns>
-    private bool? ChangeSelectedItem (int value)
+    private bool ChangeSelectedItem (int value)
     {
         if (_selected == value || value > _radioLabels.Count - 1)
         {
-            return null;
+            return false;
         }
 
         int savedSelected = _selected;
@@ -341,7 +345,7 @@ public class RadioGroup : View, IDesignable, IOrientation
 
         SetNeedsDisplay ();
 
-        return false;
+        return true;
     }
 
     /// <inheritdoc/>
@@ -520,7 +524,17 @@ public class RadioGroup : View, IDesignable, IOrientation
 
     private void MoveEnd () { Cursor = Math.Max (_radioLabels.Count - 1, 0); }
 
-    private void MoveHome () { Cursor = 0; }
+    private bool MoveHome ()
+    {
+        if (Cursor != 0)
+        {
+            Cursor = 0;
+
+            return true;
+        }
+
+        return false;
+    }
 
     private bool MoveUpLeft ()
     {

+ 59 - 35
Terminal.Gui/Views/Shortcut.cs

@@ -11,7 +11,7 @@ namespace Terminal.Gui;
 /// <remarks>
 ///     <para>
 ///         The following user actions will invoke the <see cref="Command.Accept"/>, causing the
-///         <see cref="View.Accept"/> event to be fired:
+///         <see cref="View.Accepted"/> event to be fired:
 ///         - Clicking on the <see cref="Shortcut"/>.
 ///         - Pressing the key specified by <see cref="Key"/>.
 ///         - Pressing the HotKey specified by <see cref="CommandView"/>.
@@ -91,7 +91,7 @@ public class Shortcut : View, IOrientation, IDesignable
     public Shortcut (Key key, string commandText, Action action, string helpText = null)
     {
         Id = "_shortcut";
-        HighlightStyle = HighlightStyle.Pressed;
+        // Disabled for now due to bugs in highlight handling and mouse clicks - HighlightStyle = HighlightStyle.Pressed;
         CanFocus = true;
         Width = GetWidthDimAuto ();
         Height = Dim.Auto (DimAutoStyle.Content, 1);
@@ -100,9 +100,26 @@ public class Shortcut : View, IOrientation, IDesignable
         _orientationHelper.OrientationChanging += (sender, e) => OrientationChanging?.Invoke (this, e);
         _orientationHelper.OrientationChanged += (sender, e) => OrientationChanged?.Invoke (this, e);
 
-        AddCommand (Command.HotKey, ctx => DispatchAcceptCommand (ctx));
+        // Accept (Enter key) - 
         AddCommand (Command.Accept, ctx => DispatchAcceptCommand (ctx));
-        AddCommand (Command.Select, ctx => RaiseSelectEvent ());
+
+        // Hotkey - 
+        AddCommand (Command.HotKey, ctx =>
+                                    {
+                                        // The default HotKey handler sets Focus
+                                        SetFocus ();
+
+                                        if (DispatchAcceptCommand (ctx) == true)
+
+                                        {
+                                            return true;
+                                        }
+
+                                        return RaiseSelected ();
+                                    });
+
+        // Select (Space key or click) - 
+        AddCommand (Command.Select, ctx => RaiseSelected ());
 
         TitleChanged += Shortcut_TitleChanged; // This needs to be set before CommandView is set
 
@@ -128,8 +145,8 @@ public class Shortcut : View, IOrientation, IDesignable
         HelpView.MouseClick += HelpOrKeyView_MouseClick;
         KeyView.MouseClick += HelpOrKeyView_MouseClick;
 
-        HelpView.Select += HelpAndKeyViewOnSelect;
-        KeyView.Select += HelpAndKeyViewOnSelect;
+        HelpView.Selected += HelpAndKeyViewOnSelect;
+        KeyView.Selected += HelpAndKeyViewOnSelect;
 
         LayoutStarted += OnLayoutStarted;
         Initialized += OnInitialized;
@@ -388,7 +405,7 @@ public class Shortcut : View, IOrientation, IDesignable
         {
             // If the subview (likely CommandView) didn't handle the mouse click, invoke the Select command.
             // e.Handled = CommandView.InvokeCommand (Command.Select) == true;
-            e.Handled = InvokeCommand (Command.Accept) == true;
+            e.Handled = InvokeCommand (Command.HotKey) == true;
         }
 
         //if (CanFocus)
@@ -498,7 +515,7 @@ public class Shortcut : View, IOrientation, IDesignable
 
             if (_commandView is { })
             {
-                _commandView.Accept -= CommandViewOnAccept;
+                _commandView.Accepted -= CommandViewOnSelected;
                 Remove (_commandView);
                 _commandView?.Dispose ();
             }
@@ -523,11 +540,12 @@ public class Shortcut : View, IOrientation, IDesignable
 
             Title = _commandView.Text;
 
-            _commandView.Select += CommandViewOnAccept;
+            _commandView.Selected += CommandViewOnSelected;
 
-            void CommandViewOnAccept (object sender, HandledEventArgs e)
+            void CommandViewOnSelected (object sender, HandledEventArgs e)
             {
-                // Always eat CommandView.Accept
+                // Always eat CommandView.Select
+                SetFocus ();
                 e.Handled = true;
             }
 
@@ -535,12 +553,18 @@ public class Shortcut : View, IOrientation, IDesignable
 
             void CommandViewOnMouseClick (object sender, MouseEventEventArgs e)
             {
-                //if (!e.Handled)
+                if (!e.Handled)
                 {
-                    // If the subview (likely CommandView) didn't handle the mouse click, invoke the command.
-                    InvokeCommand (Command.HotKey);
+                    // If the subview (likely CommandView) didn't handle the mouse click, invoke the Accept Command.
+                    InvokeCommand (Command.Accept);
+
+                    // Always eat the mouseclick
                     e.Handled = true;
                 }
+
+                // Always Setfocus and invoke Select
+                SetFocus ();
+                InvokeCommand (Command.Select);
             }
 
 
@@ -548,7 +572,7 @@ public class Shortcut : View, IOrientation, IDesignable
             SetHelpViewDefaultLayout ();
             SetKeyViewDefaultLayout ();
             ShowHide ();
-            UpdateKeyBinding (Key.Empty);
+            UpdateKeyBindings (Key.Empty);
         }
     }
 
@@ -645,7 +669,7 @@ public class Shortcut : View, IOrientation, IDesignable
             Key oldKey = _key;
             _key = value;
 
-            UpdateKeyBinding (oldKey);
+            UpdateKeyBindings (oldKey);
 
             KeyView.Text = Key == Key.Empty ? string.Empty : $"{Key}";
             ShowHide ();
@@ -679,7 +703,7 @@ public class Shortcut : View, IOrientation, IDesignable
 
             _keyBindingScope = value;
 
-            UpdateKeyBinding (Key.Empty);
+            UpdateKeyBindings (Key.Empty);
         }
     }
 
@@ -732,16 +756,20 @@ public class Shortcut : View, IOrientation, IDesignable
         HelpView.HighlightStyle = HighlightStyle.None;
     }
 
-    private void UpdateKeyBinding (Key oldKey)
+    private void UpdateKeyBindings (Key oldKey)
     {
         if (Key != null && Key.IsValid)
         {
-            // Disable the command view HotKey bindings
-            CommandView.KeyBindings.Remove (Key);
-            CommandView.KeyBindings.Remove (CommandView.HotKey);
-            CommandView.KeyBindings.Remove (CommandView.HotKey.WithShift);
-            CommandView.KeyBindings.Remove (CommandView.HotKey.WithAlt);
-            CommandView.KeyBindings.Remove (CommandView.HotKey.WithShift.WithAlt);
+            //// Disable the command view HotKey bindings
+            //IEnumerable<Key> list = CommandView.KeyBindings.GetKeysFromCommands (Command.HotKey);
+            //foreach (Key cmdViewKey in list)
+            //{
+            //    CommandView.KeyBindings.Remove (cmdViewKey);
+            //    CommandView.KeyBindings.Remove (cmdViewKey.WithShift);
+            //    CommandView.KeyBindings.Remove (cmdViewKey.WithAlt);
+            //    CommandView.KeyBindings.Remove (cmdViewKey.WithShift.WithAlt);
+            //    KeyBindings.Add (cmdViewKey, Command.HotKey);
+            //}
 
             if (KeyBindingScope.FastHasFlags (KeyBindingScope.Application))
             {
@@ -751,7 +779,7 @@ public class Shortcut : View, IOrientation, IDesignable
                 }
 
                 Application.KeyBindings.Remove (Key);
-                Application.KeyBindings.Add (Key, this, Command.Accept);
+                Application.KeyBindings.Add (Key, this, Command.HotKey);
             }
             else
             {
@@ -761,7 +789,7 @@ public class Shortcut : View, IOrientation, IDesignable
                 }
 
                 KeyBindings.Remove (Key);
-                KeyBindings.Add (Key, KeyBindingScope | KeyBindingScope.HotKey, Command.Accept);
+                KeyBindings.Add (Key, KeyBindingScope | KeyBindingScope.HotKey, Command.HotKey);
             }
         }
     }
@@ -778,18 +806,15 @@ public class Shortcut : View, IOrientation, IDesignable
     ///     - if the user presses the HotKey specified by CommandView
     ///     - if HasFocus and the user presses Space or Enter (or any other key bound to Command.Accept).
     /// </summary>
-    protected bool? DispatchAcceptCommand (CommandContext ctx)
+    internal bool? DispatchAcceptCommand (CommandContext ctx)
     {
-        if (RaiseSelectEvent () == true)
-        {
-            return true;
-        }
-
+        // Invoke Select on the command view to cause it to change state if it wants to
+        // If this causes CommandView to raise Accept, we eat it
         CommandView.InvokeCommand (Command.Select);
 
         var cancel = false;
 
-        cancel = RaiseAcceptEvent () == true;
+        cancel = RaiseAccepted () == true;
 
         if (cancel is true)
         {
@@ -809,7 +834,6 @@ public class Shortcut : View, IOrientation, IDesignable
             _targetView.InvokeCommand (_command);
         }
 
-
         return cancel;
     }
 
@@ -818,7 +842,7 @@ public class Shortcut : View, IOrientation, IDesignable
     ///     mouse.
     /// </summary>
     /// <remarks>
-    ///     Note, the <see cref="View.Accept"/> event is fired first, and if cancelled, the event will not be invoked.
+    ///     Note, the <see cref="View.Accepted"/> event is fired first, and if cancelled, the event will not be invoked.
     /// </remarks>
     [CanBeNull]
     public Action Action { get; set; }

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

@@ -1781,7 +1781,7 @@ public class Slider<T> : View, IOrientation
     {
         SetFocusedOption ();
 
-        return RaiseAcceptEvent () == true;
+        return RaiseAccepted () == true;
     }
 
     internal bool MovePlus ()

+ 3 - 3
Terminal.Gui/Views/StatusBar.cs

@@ -113,10 +113,10 @@ public class StatusBar : Bar, IDesignable
             Text = "I'll Hide",
             // Visible = false
         };
-        button1.Accept += Button_Clicked;
+        button1.Accepted += Button_Clicked;
         Add (button1);
 
-        shortcut.Accept += (s, e) =>
+        shortcut.Accepted += (s, e) =>
                            {
                                button1.Visible = !button1.Visible;
                                button1.Enabled = button1.Visible;
@@ -134,7 +134,7 @@ public class StatusBar : Bar, IDesignable
         {
             Text = "Or me!",
         };
-        button2.Accept += (s, e) => Application.RequestStop ();
+        button2.Accepted += (s, e) => Application.RequestStop ();
 
         Add (button2);
 

+ 2 - 2
Terminal.Gui/Views/TextView.cs

@@ -2513,7 +2513,7 @@ public class TextView : View
     // BUGBUG: AllowsReturn is mis-named. It should be EnterKeyAccepts.
     /// <summary>
     ///     Gets or sets whether pressing ENTER in a <see cref="TextView"/> creates a new line of text
-    ///     in the view or invokes the <see cref="View.Accept"/> event.
+    ///     in the view or invokes the <see cref="View.Accepted"/> event.
     /// </summary>
     /// <remarks>
     ///     <para>
@@ -6047,7 +6047,7 @@ public class TextView : View
         {
             // By Default pressing ENTER should be ignored (OnAccept will return false or null). Only cancel if the
             // event was fired and set Cancel = true.
-            return RaiseAcceptEvent () is null or false;
+            return RaiseAccepted () is null or false;
         }
 
         SetWrapModel ();

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

@@ -446,7 +446,7 @@ public class TreeView<T> : View, ITreeView where T : class
     public bool? ActivateSelectedObjectIfAny ()
     {
         // By default, Command.Accept calls OnAccept, so we need to call it here to ensure that the event is fired.
-        if (RaiseAcceptEvent () == true)
+        if (RaiseAccepted () == true)
         {
             return true;
         }

+ 2 - 2
Terminal.Gui/Views/Wizard/Wizard.cs

@@ -85,8 +85,8 @@ public class Wizard : Dialog
         AddButton (BackButton);
         AddButton (NextFinishButton);
 
-        BackButton.Accept += BackBtn_Clicked;
-        NextFinishButton.Accept += NextfinishBtn_Clicked;
+        BackButton.Accepted += BackBtn_Clicked;
+        NextFinishButton.Accepted += NextfinishBtn_Clicked;
 
         Loaded += Wizard_Loaded;
         Closing += Wizard_Closing;

+ 3 - 3
UICatalog/KeyBindingsDialog.cs

@@ -44,11 +44,11 @@ internal class KeyBindingsDialog : Dialog
 
         var btnChange = new Button { X = Pos.Percent (50), Y = 1, Text = "Ch_ange" };
         Add (btnChange);
-        btnChange.Accept += RemapKey;
+        btnChange.Accepted += RemapKey;
 
         var close = new Button { Text = "Ok" };
 
-        close.Accept += (s, e) =>
+        close.Accepted += (s, e) =>
                          {
                              Application.RequestStop ();
                              ViewTracker.Instance.StartUsingNewKeyMap (CurrentBindings);
@@ -56,7 +56,7 @@ internal class KeyBindingsDialog : Dialog
         AddButton (close);
 
         var cancel = new Button { Text = "Cancel" };
-        cancel.Accept += (s, e) => Application.RequestStop ();
+        cancel.Accepted += (s, e) => Application.RequestStop ();
         AddButton (cancel);
 
         // Register event handler as the last thing in constructor to prevent early calls

+ 2 - 2
UICatalog/Scenarios/ASCIICustomButton.cs

@@ -198,7 +198,7 @@ public class ASCIICustomButtonTest : Scenario
                     Height = BUTTON_HEIGHT
                 };
                 button.Initialized += Button_Initialized;
-                button.Accept += Button_Clicked;
+                button.Accepted += Button_Clicked;
                 button.PointerEnter += Button_PointerEnter;
                 button.MouseClick += Button_MouseClick;
                 button.KeyDown += Button_KeyPress;
@@ -216,7 +216,7 @@ public class ASCIICustomButtonTest : Scenario
                 Height = BUTTON_HEIGHT
             };
             closeButton.Initialized += Button_Initialized;
-            closeButton.Accept += Button_Clicked;
+            closeButton.Accepted += Button_Clicked;
             closeButton.PointerEnter += Button_PointerEnter;
             closeButton.MouseClick += Button_MouseClick;
             closeButton.KeyDown += Button_KeyPress;

+ 1 - 1
UICatalog/Scenarios/AdornmentEditor.cs

@@ -146,7 +146,7 @@ public class AdornmentEditor : View
             Enabled = false
         };
 
-        copyTop.Accept += (s, e) =>
+        copyTop.Accepted += (s, e) =>
                           {
                               AdornmentToEdit.Thickness = new (_topEdit.Value);
                               _leftEdit.Value = _rightEdit.Value = _bottomEdit.Value = _topEdit.Value;

+ 3 - 3
UICatalog/Scenarios/Adornments.cs

@@ -57,7 +57,7 @@ public class Adornments : Scenario
 
         var button = new Button { X = Pos.Center (), Y = Pos.Center (), Text = "Press me!" };
 
-        button.Accept += (s, e) =>
+        button.Accepted += (s, e) =>
                              MessageBox.Query (20, 7, "Hi", $"Am I a {window.GetType ().Name}?", "Yes", "No");
 
         var label = new TextView
@@ -113,7 +113,7 @@ public class Adornments : Scenario
                                       Text = "some text",
                                       CanFocus = true
                                   };
-                                  textFieldInPadding.Accept += (s, e) => MessageBox.Query (20, 7, "TextField", textFieldInPadding.Text, "Ok");
+                                  textFieldInPadding.Accepted += (s, e) => MessageBox.Query (20, 7, "TextField", textFieldInPadding.Text, "Ok");
                                   window.Padding.Add (textFieldInPadding);
 
                                   var btnButtonInPadding = new Button
@@ -123,7 +123,7 @@ public class Adornments : Scenario
                                       Text = "_Button in Padding",
                                       CanFocus = true
                                   };
-                                  btnButtonInPadding.Accept += (s, e) => MessageBox.Query (20, 7, "Hi", "Button in Padding Pressed!", "Ok");
+                                  btnButtonInPadding.Accepted += (s, e) => MessageBox.Query (20, 7, "Hi", "Button in Padding Pressed!", "Ok");
                                   btnButtonInPadding.BorderStyle = LineStyle.Dashed;
                                   btnButtonInPadding.Border.Thickness = new (1, 1, 1, 1);
                                   window.Padding.Add (btnButtonInPadding);

+ 4 - 4
UICatalog/Scenarios/AllViewsTester.cs

@@ -160,7 +160,7 @@ public class AllViewsTester : Scenario
         _xRadioGroup.SelectedItemChanged += OnXRadioGroupOnSelectedItemChanged;
         _xText = new () { X = Pos.Right (label) + 1, Y = 0, Width = 4, Text = $"{_xVal}" };
 
-        _xText.Accept += (s, args) =>
+        _xText.Accepted += (s, args) =>
                          {
                              try
                              {
@@ -179,7 +179,7 @@ public class AllViewsTester : Scenario
         _locationFrame.Add (label);
         _yText = new () { X = Pos.Right (label) + 1, Y = 0, Width = 4, Text = $"{_yVal}" };
 
-        _yText.Accept += (s, args) =>
+        _yText.Accepted += (s, args) =>
                          {
                              try
                              {
@@ -211,7 +211,7 @@ public class AllViewsTester : Scenario
         _wRadioGroup.SelectedItemChanged += OnWRadioGroupOnSelectedItemChanged;
         _wText = new () { X = Pos.Right (label) + 1, Y = 0, Width = 4, Text = $"{_wVal}" };
 
-        _wText.Accept += (s, args) =>
+        _wText.Accepted += (s, args) =>
                          {
                              try
                              {
@@ -242,7 +242,7 @@ public class AllViewsTester : Scenario
         _sizeFrame.Add (label);
         _hText = new () { X = Pos.Right (label) + 1, Y = 0, Width = 4, Text = $"{_hVal}" };
 
-        _hText.Accept += (s, args) =>
+        _hText.Accepted += (s, args) =>
                          {
                              try
                              {

+ 5 - 5
UICatalog/Scenarios/Bars.cs

@@ -168,7 +168,7 @@ public class Bars : Scenario
         };
         popOverMenu.Add (toggleShortcut);
 
-        popOverMenu.Accept += PopOverMenuOnAccept;
+        popOverMenu.Accepted += PopOverMenuOnAccept;
 
         void PopOverMenuOnAccept (object o, HandledEventArgs handledEventArgs)
         {
@@ -255,7 +255,7 @@ public class Bars : Scenario
             {
                 foreach (Shortcut sh in barView.Subviews.Where (s => s is Shortcut)!)
                 {
-                    sh.Accept += (o, args) =>
+                    sh.Accepted += (o, args) =>
                                  {
                                      eventSource.Add ($"Accept: {sh!.SuperView.Id} {sh!.CommandView.Text}");
                                      eventLog.MoveDown ();
@@ -522,10 +522,10 @@ public class Bars : Scenario
             Text = "I'll Hide",
             // Visible = false
         };
-        button1.Accept += Button_Clicked;
+        button1.Accepted += Button_Clicked;
         bar.Add (button1);
 
-        shortcut.Accept += (s, e) =>
+        shortcut.Accepted += (s, e) =>
                                                     {
                                                         button1.Visible = !button1.Visible;
                                                         button1.Enabled = button1.Visible;
@@ -543,7 +543,7 @@ public class Bars : Scenario
         {
             Text = "Or me!",
         };
-        button2.Accept += (s, e) => Application.RequestStop ();
+        button2.Accepted += (s, e) => Application.RequestStop ();
 
         bar.Add (button2);
 

+ 16 - 16
UICatalog/Scenarios/Buttons.cs

@@ -36,7 +36,7 @@ public class Buttons : Scenario
         main.Add (defaultButton);
 
         // Note we handle Accept on main, not defaultButton
-        main.Accept += (s, e) => Application.RequestStop ();
+        main.Accepted += (s, e) => Application.RequestStop ();
 
         var swapButton = new Button
         {
@@ -47,14 +47,14 @@ public class Buttons : Scenario
             ColorScheme = Colors.ColorSchemes ["Error"]
         };
 
-        swapButton.Accept += (s, e) =>
+        swapButton.Accepted += (s, e) =>
                              {
                                  e.Handled = !swapButton.IsDefault;
                                  defaultButton.IsDefault = !defaultButton.IsDefault;
                                  swapButton.IsDefault = !swapButton.IsDefault;
                              };
 
-        defaultButton.Accept += (s, e) =>
+        defaultButton.Accepted += (s, e) =>
                                 {
                                     e.Handled = !defaultButton.IsDefault;
 
@@ -67,7 +67,7 @@ public class Buttons : Scenario
 
         static void DoMessage (Button button, string txt)
         {
-            button.Accept += (s, e) =>
+            button.Accepted += (s, e) =>
                              {
                                  string btnText = button.Text;
                                  MessageBox.Query ("Message", $"Did you click {txt}?", "Yes", "No");
@@ -111,7 +111,7 @@ public class Buttons : Scenario
         main.Add (
                   button = new () { X = 2, Y = Pos.Bottom (button) + 1, Height = 2, Text = "a Newline\nin the button" }
                  );
-        button.Accept += (s, e) =>
+        button.Accepted += (s, e) =>
                          {
                              MessageBox.Query ("Message", "Question?", "Yes", "No");
                              e.Handled = true;
@@ -119,7 +119,7 @@ public class Buttons : Scenario
 
         var textChanger = new Button { X = 2, Y = Pos.Bottom (button) + 1, Text = "Te_xt Changer" };
         main.Add (textChanger);
-        textChanger.Accept += (s, e) =>
+        textChanger.Accepted += (s, e) =>
                               {
                                   textChanger.Text += "!";
                                   e.Handled = true;
@@ -133,7 +133,7 @@ public class Buttons : Scenario
                       Text = "Lets see if this will move as \"Text Changer\" grows"
                   }
                  );
-        button.Accept += (sender, args) => { args.Handled = true; };
+        button.Accepted += (sender, args) => { args.Handled = true; };
 
         var removeButton = new Button
         {
@@ -143,7 +143,7 @@ public class Buttons : Scenario
         main.Add (removeButton);
 
         // This in interesting test case because `moveBtn` and below are laid out relative to this one!
-        removeButton.Accept += (s, e) =>
+        removeButton.Accepted += (s, e) =>
                                {
                                    removeButton.Visible = false;
                                    e.Handled = true;
@@ -169,7 +169,7 @@ public class Buttons : Scenario
             Text = "Move This \u263b Button v_ia Pos"
         };
 
-        moveBtn.Accept += (s, e) =>
+        moveBtn.Accepted += (s, e) =>
                           {
                               moveBtn.X = moveBtn.Frame.X + 5;
                               e.Handled = true;
@@ -186,7 +186,7 @@ public class Buttons : Scenario
             ColorScheme = Colors.ColorSchemes ["Error"],
         };
 
-        sizeBtn.Accept += (s, e) =>
+        sizeBtn.Accepted += (s, e) =>
                           {
                               sizeBtn.Width = sizeBtn.Frame.Width + 5;
                               e.Handled = true;
@@ -206,7 +206,7 @@ public class Buttons : Scenario
         // Demonstrates how changing the View.Frame property can move Views
         var moveBtnA = new Button { ColorScheme = Colors.ColorSchemes ["Error"], Text = "Move This Button via Frame" };
 
-        moveBtnA.Accept += (s, e) =>
+        moveBtnA.Accepted += (s, e) =>
                            {
                                moveBtnA.Frame = new (
                                                      moveBtnA.Frame.X + 5,
@@ -224,7 +224,7 @@ public class Buttons : Scenario
             Y = 2, ColorScheme = Colors.ColorSchemes ["Error"], Text = " ~  s  gui.cs   master ↑_10 = Сохранить"
         };
 
-        sizeBtnA.Accept += (s, e) =>
+        sizeBtnA.Accepted += (s, e) =>
                            {
                                sizeBtnA.Frame = new (
                                                      sizeBtnA.Frame.X,
@@ -297,7 +297,7 @@ public class Buttons : Scenario
             ColorScheme = Colors.ColorSchemes ["TopLevel"],
             Text = mhkb
         };
-        moveHotKeyBtn.Accept += (s, e) =>
+        moveHotKeyBtn.Accepted += (s, e) =>
                                 {
                                     moveHotKeyBtn.Text = MoveHotkey (moveHotKeyBtn.Text);
                                     e.Handled = true;
@@ -314,7 +314,7 @@ public class Buttons : Scenario
             ColorScheme = Colors.ColorSchemes ["TopLevel"],
             Text = muhkb
         };
-        moveUnicodeHotKeyBtn.Accept += (s, e) =>
+        moveUnicodeHotKeyBtn.Accepted += (s, e) =>
                                        {
                                            moveUnicodeHotKeyBtn.Text = MoveHotkey (moveUnicodeHotKeyBtn.Text);
                                            e.Handled = true;
@@ -398,7 +398,7 @@ public class Buttons : Scenario
             Title = $"Accept Cou_nt: {noRepeatAcceptCount}",
             WantContinuousButtonPressed = false
         };
-        noRepeatButton.Accept += (s, e) =>
+        noRepeatButton.Accepted += (s, e) =>
                                  {
                                      noRepeatButton.Title = $"Accept Cou_nt: {++noRepeatAcceptCount}";
                                      e.Handled = true;
@@ -420,7 +420,7 @@ public class Buttons : Scenario
             Title = $"Accept Co_unt: {acceptCount}",
             WantContinuousButtonPressed = true
         };
-        repeatButton.Accept += (s, e) =>
+        repeatButton.Accepted += (s, e) =>
                                {
                                    repeatButton.Title = $"Accept Co_unt: {++acceptCount}";
                                    e.Handled = true;

+ 8 - 8
UICatalog/Scenarios/CharacterMap.cs

@@ -77,7 +77,7 @@ public class CharacterMap : Scenario
         };
         top.Add (_errorLabel);
 
-        jumpEdit.Accept += JumpEditOnAccept;
+        jumpEdit.Accepted += JumpEditOnAccept;
 
         _categoryList = new () { X = Pos.Right (_charMap), Y = Pos.Bottom (jumpLabel), Height = Dim.Fill () };
         _categoryList.FullRowSelect = true;
@@ -477,7 +477,7 @@ internal class CharMap : View
             ShadowStyle = ShadowStyle.None,
             CanFocus = false
         };
-        up.Accept += (sender, args) => { args.Handled = ScrollVertical (-1) == true; };
+        up.Accepted += (sender, args) => { args.Handled = ScrollVertical (-1) == true; };
 
         var down = new Button
         {
@@ -492,7 +492,7 @@ internal class CharMap : View
             ShadowStyle = ShadowStyle.None,
             CanFocus = false
         };
-        down.Accept += (sender, args) => { ScrollVertical (1); };
+        down.Accepted += (sender, args) => { ScrollVertical (1); };
 
         var left = new Button
         {
@@ -507,7 +507,7 @@ internal class CharMap : View
             ShadowStyle = ShadowStyle.None,
             CanFocus = false
         };
-        left.Accept += (sender, args) => { ScrollHorizontal (-1); };
+        left.Accepted += (sender, args) => { ScrollHorizontal (-1); };
 
         var right = new Button
         {
@@ -522,7 +522,7 @@ internal class CharMap : View
             ShadowStyle = ShadowStyle.None,
             CanFocus = false
         };
-        right.Accept += (sender, args) => { ScrollHorizontal (1); };
+        right.Accepted += (sender, args) => { ScrollHorizontal (1); };
 
         Padding.Add (up, down, left, right);
     }
@@ -1015,18 +1015,18 @@ internal class CharMap : View
 
             var dlg = new Dialog { Title = title, Buttons = [copyGlyph, copyCP, cancel] };
 
-            copyGlyph.Accept += (s, a) =>
+            copyGlyph.Accepted += (s, a) =>
                                 {
                                     CopyGlyph ();
                                     dlg.RequestStop ();
                                 };
 
-            copyCP.Accept += (s, a) =>
+            copyCP.Accepted += (s, a) =>
                              {
                                  CopyCodePoint ();
                                  dlg.RequestStop ();
                              };
-            cancel.Accept += (s, a) => dlg.RequestStop ();
+            cancel.Accepted += (s, a) => dlg.RequestStop ();
 
             var rune = (Rune)SelectedCodePoint;
             var label = new Label { Text = "IsAscii: ", X = 0, Y = 0 };

+ 1 - 1
UICatalog/Scenarios/ChineseUI.cs

@@ -31,7 +31,7 @@ public class ChineseUI : Scenario
 
         var btn = new Button { X = 1, Y = 1, Text = "你" }; // v1: A
 
-        btn.Accept += (s, e) =>
+        btn.Accepted += (s, e) =>
                       {
                           int result = MessageBox.Query (
                                                          "Confirm",

+ 1 - 1
UICatalog/Scenarios/Clipping.cs

@@ -70,7 +70,7 @@ public class Clipping : Scenario
         };
 
         var testButton = new Button { X = 2, Y = 2, Text = "click me" };
-        testButton.Accept += (s, e) => { MessageBox.Query (10, 5, "Test", "test message", "Ok"); };
+        testButton.Accepted += (s, e) => { MessageBox.Query (10, 5, "Test", "test message", "Ok"); };
         embedded3.Add (testButton);
         embedded2.Add (embedded3);
 

+ 2 - 2
UICatalog/Scenarios/ComboBoxIteration.cs

@@ -60,7 +60,7 @@ public class ComboBoxIteration : Scenario
 
         var btnTwo = new Button { X = Pos.Right (comboBox) + 1, Text = "Two" };
 
-        btnTwo.Accept += (s, e) =>
+        btnTwo.Accepted += (s, e) =>
                           {
                               items = ["one", "two"];
                               comboBox.SetSource (items);
@@ -71,7 +71,7 @@ public class ComboBoxIteration : Scenario
 
         var btnThree = new Button { X = Pos.Right (comboBox) + 1, Y = Pos.Top (comboBox), Text = "Three" };
 
-        btnThree.Accept += (s, e) =>
+        btnThree.Accepted += (s, e) =>
                             {
                                 items =["one", "two", "three"];
                                 comboBox.SetSource (items);

+ 4 - 4
UICatalog/Scenarios/ComputedLayout.cs

@@ -363,7 +363,7 @@ public class ComputedLayout : Scenario
         var anchorButton = new Button { Text = "Button using AnchorEnd", Y = Pos.AnchorEnd () };
         anchorButton.X = Pos.AnchorEnd ();
 
-        anchorButton.Accept += (s, e) =>
+        anchorButton.Accepted += (s, e) =>
                                 {
                                     // This demonstrates how to have a dynamically sized button
                                     // Each time the button is clicked the button's text gets longer
@@ -411,7 +411,7 @@ public class ComputedLayout : Scenario
             Y = Pos.AnchorEnd () - 1
         };
 
-        leftButton.Accept += (s, e) =>
+        leftButton.Accepted += (s, e) =>
                               {
                                   // This demonstrates how to have a dynamically sized button
                                   // Each time the button is clicked the button's text gets longer
@@ -429,7 +429,7 @@ public class ComputedLayout : Scenario
             Y = Pos.AnchorEnd (2),
         };
 
-        centerButton.Accept += (s, e) =>
+        centerButton.Accepted += (s, e) =>
                                 {
                                     // This demonstrates how to have a dynamically sized button
                                     // Each time the button is clicked the button's text gets longer
@@ -447,7 +447,7 @@ public class ComputedLayout : Scenario
             Y = Pos.Y (centerButton)
         };
 
-        rightButton.Accept += (s, e) =>
+        rightButton.Accepted += (s, e) =>
                                {
                                    // This demonstrates how to have a dynamically sized button
                                    // Each time the button is clicked the button's text gets longer

+ 1 - 1
UICatalog/Scenarios/ConfigurationEditor.cs

@@ -70,7 +70,7 @@ public class ConfigurationEditor : Scenario
             Key = Key.F5.WithShift,
             Title = "Reload",
         };
-        reloadShortcut.Accept += (s, e) => { Reload (); };
+        reloadShortcut.Accepted += (s, e) => { Reload (); };
 
         var saveShortcut = new Shortcut ()
         {

+ 1 - 1
UICatalog/Scenarios/ContentScrolling.cs

@@ -362,7 +362,7 @@ public class ContentScrolling : Scenario
             Height = Dim.Auto (DimAutoStyle.Content, maximumContentDim: Dim.Percent (20)),
         };
 
-        charMap.Accept += (s, e) =>
+        charMap.Accepted += (s, e) =>
                               MessageBox.Query (20, 7, "Hi", $"Am I a {view.GetType ().Name}?", "Yes", "No");
 
         var buttonAnchored = new Button

+ 2 - 2
UICatalog/Scenarios/CsvEditor.cs

@@ -304,13 +304,13 @@ public class CsvEditor : Scenario
 
         var ok = new Button { Text = "Ok", IsDefault = true };
 
-        ok.Accept += (s, e) =>
+        ok.Accepted += (s, e) =>
                      {
                          okPressed = true;
                          Application.RequestStop ();
                      };
         var cancel = new Button { Text = "Cancel" };
-        cancel.Accept += (s, e) => { Application.RequestStop (); };
+        cancel.Accepted += (s, e) => { Application.RequestStop (); };
         var d = new Dialog { Title = title, Buttons = [ok, cancel] };
 
         var lbl = new Label { X = 0, Y = 1, Text = label };

+ 5 - 5
UICatalog/Scenarios/Dialogs.cs

@@ -185,7 +185,7 @@ public class Dialogs : Scenario
             X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefault = true, Text = "_Show Dialog"
         };
 
-        app.Accept += (s, e) =>
+        app.Accepted += (s, e) =>
                                    {
                                        Dialog dlg = CreateDemoDialog (
                                                                       widthEdit,
@@ -255,7 +255,7 @@ public class Dialogs : Scenario
                     button = new () { Text = NumberToWords.Convert (buttonId), IsDefault = buttonId == 0 };
                 }
 
-                button.Accept += (s, e) =>
+                button.Accepted += (s, e) =>
                                  {
                                      clicked = buttonId;
                                      Application.RequestStop ();
@@ -290,7 +290,7 @@ public class Dialogs : Scenario
                 Text = "_Add a button"
             };
 
-            add.Accept += (s, e) =>
+            add.Accepted += (s, e) =>
                           {
                               int buttonId = buttons.Count;
                               Button button;
@@ -308,7 +308,7 @@ public class Dialogs : Scenario
                                   button = new () { Text = NumberToWords.Convert (buttonId), IsDefault = buttonId == 0 };
                               }
 
-                              button.Accept += (s, e) =>
+                              button.Accepted += (s, e) =>
                                                {
                                                    clicked = buttonId;
                                                    Application.RequestStop ();
@@ -330,7 +330,7 @@ public class Dialogs : Scenario
                 Text = $"A_dd a {char.ConvertFromUtf32 (CODE_POINT)} to each button. This text is really long for a reason."
             };
 
-            addChar.Accept += (s, e) =>
+            addChar.Accepted += (s, e) =>
                               {
                                   foreach (Button button in buttons)
                                   {

+ 1 - 1
UICatalog/Scenarios/DimAutoDemo.cs

@@ -156,7 +156,7 @@ public class DimAutoDemo : Scenario
             Y = Pos.AnchorEnd ()
         };
 
-        resetButton.Accept += (s, e) =>
+        resetButton.Accepted += (s, e) =>
         {
             //movingButton.Y = Pos.Bottom (hlabel);
             //movingButton.X = 0;

+ 16 - 16
UICatalog/Scenarios/DynamicMenuBar.cs

@@ -203,7 +203,7 @@ public class DynamicMenuBar : Scenario
             {
                 X = Pos.X (lblShortcut), Y = Pos.Bottom (TextShortcutKey) + 1, Text = "Clear Shortcut"
             };
-            btnShortcut.Accept += (s, e) => { TextShortcutKey.Text = ""; };
+            btnShortcut.Accepted += (s, e) => { TextShortcutKey.Text = ""; };
             Add (btnShortcut);
 
             CkbIsTopLevel.CheckedStateChanging += (s, e) =>
@@ -393,7 +393,7 @@ public class DynamicMenuBar : Scenario
 
             var btnOk = new Button { IsDefault = true, Text = "Ok" };
 
-            btnOk.Accept += (s, e) =>
+            btnOk.Accepted += (s, e) =>
                             {
                                 if (string.IsNullOrEmpty (TextTitle.Text))
                                 {
@@ -407,7 +407,7 @@ public class DynamicMenuBar : Scenario
                             };
             var btnCancel = new Button { Text = "Cancel" };
 
-            btnCancel.Accept += (s, e) =>
+            btnCancel.Accepted += (s, e) =>
                                 {
                                     TextTitle.Text = string.Empty;
                                     Application.RequestStop ();
@@ -666,7 +666,7 @@ public class DynamicMenuBar : Scenario
             };
             Add (frmMenuDetails);
 
-            btnMenuBarUp.Accept += (s, e) =>
+            btnMenuBarUp.Accepted += (s, e) =>
                                     {
                                         int i = _currentSelectedMenuBar;
 
@@ -688,7 +688,7 @@ public class DynamicMenuBar : Scenario
                                         }
                                     };
 
-            btnMenuBarDown.Accept += (s, e) =>
+            btnMenuBarDown.Accepted += (s, e) =>
                                       {
                                           int i = _currentSelectedMenuBar;
 
@@ -710,7 +710,7 @@ public class DynamicMenuBar : Scenario
                                           }
                                       };
 
-            btnUp.Accept += (s, e) =>
+            btnUp.Accepted += (s, e) =>
                              {
                                  int i = _lstMenus.SelectedItem;
                                  MenuItem menuItem = DataContext.Menus.Count > 0 ? DataContext.Menus [i].MenuItem : null;
@@ -732,7 +732,7 @@ public class DynamicMenuBar : Scenario
                                  }
                              };
 
-            btnDown.Accept += (s, e) =>
+            btnDown.Accepted += (s, e) =>
                                {
                                    int i = _lstMenus.SelectedItem;
                                    MenuItem menuItem = DataContext.Menus.Count > 0 ? DataContext.Menus [i].MenuItem : null;
@@ -754,7 +754,7 @@ public class DynamicMenuBar : Scenario
                                    }
                                };
 
-            btnPreviowsParent.Accept += (s, e) =>
+            btnPreviowsParent.Accepted += (s, e) =>
                                          {
                                              if (_currentMenuBarItem != null && _currentMenuBarItem.Parent != null)
                                              {
@@ -787,7 +787,7 @@ public class DynamicMenuBar : Scenario
             Add (btnOk);
 
             var btnCancel = new Button { X = Pos.Right (btnOk) + 3, Y = Pos.Top (btnOk), Text = "Cancel" };
-            btnCancel.Accept += (s, e) => { SetFrameDetails (_currentEditMenuBarItem); };
+            btnCancel.Accepted += (s, e) => { SetFrameDetails (_currentEditMenuBarItem); };
             Add (btnCancel);
 
             txtDelimiter.TextChanging += (s, e) =>
@@ -813,7 +813,7 @@ public class DynamicMenuBar : Scenario
 
             _lstMenus.SelectedItemChanged += (s, e) => { SetFrameDetails (); };
 
-            btnOk.Accept += (s, e) =>
+            btnOk.Accepted += (s, e) =>
                              {
                                  if (string.IsNullOrEmpty (frmMenuDetails.TextTitle.Text) && _currentEditMenuBarItem != null)
                                  {
@@ -840,7 +840,7 @@ public class DynamicMenuBar : Scenario
                                  }
                              };
 
-            btnAdd.Accept += (s, e) =>
+            btnAdd.Accepted += (s, e) =>
                               {
                                   if (MenuBar == null)
                                   {
@@ -883,7 +883,7 @@ public class DynamicMenuBar : Scenario
                                   }
                               };
 
-            btnRemove.Accept += (s, e) =>
+            btnRemove.Accepted += (s, e) =>
                                 {
                                     MenuItem menuItem = (DataContext.Menus.Count > 0 && _lstMenus.SelectedItem > -1
                                                              ? DataContext.Menus [_lstMenus.SelectedItem].MenuItem
@@ -951,7 +951,7 @@ public class DynamicMenuBar : Scenario
                                    SetFrameDetails (menuBarItem);
                                };
 
-            btnNext.Accept += (s, e) =>
+            btnNext.Accepted += (s, e) =>
                                {
                                    if (_menuBar != null && _currentSelectedMenuBar + 1 < _menuBar.Menus.Length)
                                    {
@@ -961,7 +961,7 @@ public class DynamicMenuBar : Scenario
                                    SelectCurrentMenuBarItem ();
                                };
 
-            btnPrevious.Accept += (s, e) =>
+            btnPrevious.Accepted += (s, e) =>
                                    {
                                        if (_currentSelectedMenuBar - 1 > -1)
                                        {
@@ -980,7 +980,7 @@ public class DynamicMenuBar : Scenario
                                      }
                                  };
 
-            btnAddMenuBar.Accept += (s, e) =>
+            btnAddMenuBar.Accepted += (s, e) =>
                                      {
                                          var frameDetails = new DynamicMenuBarDetails (null);
                                          DynamicMenuItem item = frameDetails.EnterMenuItem ();
@@ -1015,7 +1015,7 @@ public class DynamicMenuBar : Scenario
                                          _menuBar.SetNeedsDisplay ();
                                      };
 
-            btnRemoveMenuBar.Accept += (s, e) =>
+            btnRemoveMenuBar.Accepted += (s, e) =>
                                         {
                                             if (_menuBar == null)
                                             {

+ 11 - 11
UICatalog/Scenarios/DynamicStatusBar.cs

@@ -134,7 +134,7 @@ public class DynamicStatusBar : Scenario
             {
                 X = Pos.X (_lblShortcut), Y = Pos.Bottom (TextShortcut) + 1, Text = "Clear Shortcut"
             };
-            _btnShortcut.Accept += (s, e) => { TextShortcut.Text = ""; };
+            _btnShortcut.Accepted += (s, e) => { TextShortcut.Text = ""; };
             Add (_btnShortcut);
         }
 
@@ -181,7 +181,7 @@ public class DynamicStatusBar : Scenario
 
             var btnOk = new Button { IsDefault = true, Text = "OK" };
 
-            btnOk.Accept += (s, e) =>
+            btnOk.Accepted += (s, e) =>
                               {
                                   if (string.IsNullOrEmpty (TextTitle.Text))
                                   {
@@ -196,7 +196,7 @@ public class DynamicStatusBar : Scenario
                               };
             var btnCancel = new Button { Text = "Cancel" };
 
-            btnCancel.Accept += (s, e) =>
+            btnCancel.Accepted += (s, e) =>
                                   {
                                       TextTitle.Text = string.Empty;
                                       Application.RequestStop ();
@@ -311,7 +311,7 @@ public class DynamicStatusBar : Scenario
             };
             Add (_frmStatusBarDetails);
 
-            _btnUp.Accept += (s, e) =>
+            _btnUp.Accepted += (s, e) =>
                               {
                                   int i = _lstItems.SelectedItem;
                                   Shortcut statusItem = DataContext.Items.Count > 0 ? DataContext.Items [i].Shortcut : null;
@@ -334,7 +334,7 @@ public class DynamicStatusBar : Scenario
                                   }
                               };
 
-            _btnDown.Accept += (s, e) =>
+            _btnDown.Accepted += (s, e) =>
                                 {
                                     int i = _lstItems.SelectedItem;
                                     Shortcut statusItem = DataContext.Items.Count > 0 ? DataContext.Items [i].Shortcut : null;
@@ -364,12 +364,12 @@ public class DynamicStatusBar : Scenario
             Add (_btnOk);
 
             var _btnCancel = new Button { X = Pos.Right (_btnOk) + 3, Y = Pos.Top (_btnOk), Text = "Cancel" };
-            _btnCancel.Accept += (s, e) => { SetFrameDetails (_currentEditStatusItem); };
+            _btnCancel.Accepted += (s, e) => { SetFrameDetails (_currentEditStatusItem); };
             Add (_btnCancel);
 
             _lstItems.SelectedItemChanged += (s, e) => { SetFrameDetails (); };
 
-            _btnOk.Accept += (s, e) =>
+            _btnOk.Accepted += (s, e) =>
                               {
                                   if (string.IsNullOrEmpty (_frmStatusBarDetails.TextTitle.Text) && _currentEditStatusItem != null)
                                   {
@@ -388,7 +388,7 @@ public class DynamicStatusBar : Scenario
                                   }
                               };
 
-            _btnAdd.Accept += (s, e) =>
+            _btnAdd.Accepted += (s, e) =>
                                {
                                    if (StatusBar == null)
                                    {
@@ -418,7 +418,7 @@ public class DynamicStatusBar : Scenario
                                    SetFrameDetails ();
                                };
 
-            _btnRemove.Accept += (s, e) =>
+            _btnRemove.Accepted += (s, e) =>
                                   {
                                       Shortcut statusItem = DataContext.Items.Count > 0
                                                                   ? DataContext.Items [_lstItems.SelectedItem].Shortcut
@@ -448,7 +448,7 @@ public class DynamicStatusBar : Scenario
                                    SetFrameDetails (statusItem);
                                };
 
-            _btnAddStatusBar.Accept += (s, e) =>
+            _btnAddStatusBar.Accepted += (s, e) =>
                                         {
                                             if (_statusBar != null)
                                             {
@@ -459,7 +459,7 @@ public class DynamicStatusBar : Scenario
                                             Add (_statusBar);
                                         };
 
-            _btnRemoveStatusBar.Accept += (s, e) =>
+            _btnRemoveStatusBar.Accepted += (s, e) =>
                                            {
                                                if (_statusBar == null)
                                                {

+ 5 - 5
UICatalog/Scenarios/Editor.cs

@@ -872,7 +872,7 @@ public class Editor : Scenario
 
             Text = "Find _Next"
         };
-        btnFindNext.Accept += (s, e) => FindNext ();
+        btnFindNext.Accepted += (s, e) => FindNext ();
         d.Add (btnFindNext);
 
         var btnFindPrevious = new Button
@@ -882,7 +882,7 @@ public class Editor : Scenario
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
             Text = "Find _Previous"
         };
-        btnFindPrevious.Accept += (s, e) => FindPrevious ();
+        btnFindPrevious.Accepted += (s, e) => FindPrevious ();
         d.Add (btnFindPrevious);
 
         txtToFind.TextChanged += (s, e) =>
@@ -1099,7 +1099,7 @@ public class Editor : Scenario
             IsDefault = true,
             Text = "Replace _Next"
         };
-        btnFindNext.Accept += (s, e) => ReplaceNext ();
+        btnFindNext.Accepted += (s, e) => ReplaceNext ();
         d.Add (btnFindNext);
 
         label = new ()
@@ -1129,7 +1129,7 @@ public class Editor : Scenario
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
             Text = "Replace _Previous"
         };
-        btnFindPrevious.Accept += (s, e) => ReplacePrevious ();
+        btnFindPrevious.Accepted += (s, e) => ReplacePrevious ();
         d.Add (btnFindPrevious);
 
         var btnReplaceAll = new Button
@@ -1139,7 +1139,7 @@ public class Editor : Scenario
             Enabled = !string.IsNullOrEmpty (txtToFind.Text),
             Text = "Replace _All"
         };
-        btnReplaceAll.Accept += (s, e) => ReplaceAll ();
+        btnReplaceAll.Accepted += (s, e) => ReplaceAll ();
         d.Add (btnReplaceAll);
 
         txtToFind.TextChanged += (s, e) =>

+ 1 - 1
UICatalog/Scenarios/FileDialogExamples.cs

@@ -245,7 +245,7 @@ public class FileDialogExamples : Scenario
 
     private void SetupHandler (Button btn)
     {
-        btn.Accept += (s, e) =>
+        btn.Accepted += (s, e) =>
                        {
                            try
                            {

+ 1 - 1
UICatalog/Scenarios/GraphViewExample.cs

@@ -185,7 +185,7 @@ public class GraphViewExample : Scenario
                 CanFocus = false
             }
         };
-        statusBar.Add (diagShortcut).Accept += DiagShortcut_Accept;
+        statusBar.Add (diagShortcut).Accepted += DiagShortcut_Accept;
 
         _graphs [_currentGraph++ % _graphs.Length] ();
 

+ 1 - 1
UICatalog/Scenarios/Images.cs

@@ -55,7 +55,7 @@ public class Images : Scenario
         };
         win.Add (imageView);
 
-        btnOpenImage.Accept += (_, _) =>
+        btnOpenImage.Accepted += (_, _) =>
                                {
                                    var ofd = new OpenDialog { Title = "Open Image", AllowsMultipleSelection = false };
                                    Application.Run (ofd);

+ 2 - 2
UICatalog/Scenarios/InteractiveTree.cs

@@ -82,13 +82,13 @@ public class InteractiveTree : Scenario
 
         var ok = new Button { Text = "Ok", IsDefault = true };
 
-        ok.Accept += (s, e) =>
+        ok.Accepted += (s, e) =>
                      {
                          okPressed = true;
                          Application.RequestStop ();
                      };
         var cancel = new Button { Text = "Cancel" };
-        cancel.Accept += (s, e) => Application.RequestStop ();
+        cancel.Accepted += (s, e) => Application.RequestStop ();
         var d = new Dialog { Title = title, Buttons = [ok, cancel] };
 
         var lbl = new Label { X = 0, Y = 1, Text = label };

+ 1 - 1
UICatalog/Scenarios/InvertColors.cs

@@ -36,7 +36,7 @@ public class InvertColors : Scenario
 
         var button = new Button { X = Pos.Center (), Y = foreColors.Length + 1, Text = "Invert color!" };
 
-        button.Accept += (s, e) =>
+        button.Accepted += (s, e) =>
                           {
                               foreach (Label label in labels)
                               {

+ 3 - 3
UICatalog/Scenarios/LineDrawing.cs

@@ -147,7 +147,7 @@ public class LineDrawing : Scenario
             IsDefault = true
         };
 
-        btnOk.Accept += (s, e) =>
+        btnOk.Accepted += (s, e) =>
                         {
                             accept = true;
                             e.Handled = true;
@@ -162,7 +162,7 @@ public class LineDrawing : Scenario
             Width = Dim.Auto ()
         };
 
-        btnCancel.Accept += (s, e) =>
+        btnCancel.Accepted += (s, e) =>
                             {
                                 e.Handled = true;
                                 Application.RequestStop ();
@@ -228,7 +228,7 @@ public class ToolsView : Window
 
         _addLayerBtn = new() { Text = "New Layer", X = Pos.Center (), Y = Pos.Bottom (_stylePicker) };
 
-        _addLayerBtn.Accept += (s, a) => AddLayer?.Invoke ();
+        _addLayerBtn.Accepted += (s, a) => AddLayer?.Invoke ();
         Add (_colors, _stylePicker, _addLayerBtn);
     }
 

+ 2 - 2
UICatalog/Scenarios/ListColumns.cs

@@ -275,13 +275,13 @@ public class ListColumns : Scenario
         var accepted = false;
         var ok = new Button { Text = "Ok", IsDefault = true };
 
-        ok.Accept += (s, e) =>
+        ok.Accepted += (s, e) =>
                      {
                          accepted = true;
                          Application.RequestStop ();
                      };
         var cancel = new Button { Text = "Cancel" };
-        cancel.Accept += (s, e) => { Application.RequestStop (); };
+        cancel.Accepted += (s, e) => { Application.RequestStop (); };
         var d = new Dialog { Title = prompt, Buttons = [ok, cancel] };
 
         var tf = new TextField { Text = getter (_listColView).ToString (), X = 0, Y = 0, Width = Dim.Fill () };

+ 2 - 2
UICatalog/Scenarios/ListViewWithSelection.cs

@@ -139,8 +139,8 @@ public class ListViewWithSelection : Scenario
         _listView.SelectedItemChanged += (s, a) => LogEvent (s as View, a, "SelectedItemChanged");
         _listView.OpenSelectedItem += (s, a) => LogEvent (s as View, a, "OpenSelectedItem");
         _listView.CollectionChanged += (s, a) => LogEvent (s as View, a, "CollectionChanged");
-        _listView.Accept += (s, a) => LogEvent (s as View, a, "Accept");
-        _listView.Select += (s, a) => LogEvent (s as View, a, "Select");
+        _listView.Accepted += (s, a) => LogEvent (s as View, a, "Accept");
+        _listView.Selected += (s, a) => LogEvent (s as View, a, "Select");
 
         bool? LogEvent (View sender, EventArgs args, string message)
         {

+ 2 - 2
UICatalog/Scenarios/ListsAndCombos.cs

@@ -147,13 +147,13 @@ public class ListsAndCombos : Scenario
                                 };
 
         var btnMoveUp = new Button { X = 1, Y = Pos.Bottom (lbListView), Text = "Move _Up" };
-        btnMoveUp.Accept += (s, e) => { listview.MoveUp (); };
+        btnMoveUp.Accepted += (s, e) => { listview.MoveUp (); };
 
         var btnMoveDown = new Button
         {
             X = Pos.Right (btnMoveUp) + 1, Y = Pos.Bottom (lbListView), Text = "Move _Down"
         };
-        btnMoveDown.Accept += (s, e) => { listview.MoveDown (); };
+        btnMoveDown.Accepted += (s, e) => { listview.MoveDown (); };
 
         win.Add (btnMoveUp, btnMoveDown);
 

+ 3 - 3
UICatalog/Scenarios/Localization.cs

@@ -152,14 +152,14 @@ public class Localization : Scenario
         {
             X = Pos.Right (_allowAnyCheckBox) + 1, Y = Pos.Bottom (textAndFileDialogLabel) + 1, Text = "Open"
         };
-        openDialogButton.Accept += (sender, e) => ShowFileDialog (false);
+        openDialogButton.Accepted += (sender, e) => ShowFileDialog (false);
         win.Add (openDialogButton);
 
         var saveDialogButton = new Button
         {
             X = Pos.Right (openDialogButton) + 1, Y = Pos.Bottom (textAndFileDialogLabel) + 1, Text = "Save"
         };
-        saveDialogButton.Accept += (sender, e) => ShowFileDialog (true);
+        saveDialogButton.Accepted += (sender, e) => ShowFileDialog (true);
         win.Add (saveDialogButton);
 
         var wizardLabel = new Label
@@ -173,7 +173,7 @@ public class Localization : Scenario
         win.Add (wizardLabel);
 
         var wizardButton = new Button { X = 2, Y = Pos.Bottom (wizardLabel) + 1, Text = "Open _wizard" };
-        wizardButton.Accept += (sender, e) => ShowWizard ();
+        wizardButton.Accepted += (sender, e) => ShowWizard ();
         win.Add (wizardButton);
 
         win.Unloaded += (sender, e) => Quit ();

+ 3 - 3
UICatalog/Scenarios/MenuBarScenario.cs

@@ -110,15 +110,15 @@ public class MenuBarScenario : Scenario
         menuBar.LayoutComplete += (s, e) => { _focusedView.Text = appWindow.MostFocused?.ToString () ?? "None"; };
 
         var openBtn = new Button { X = Pos.Center (), Y = 4, Text = "_Open Menu", IsDefault = true };
-        openBtn.Accept += (s, e) => { menuBar.OpenMenu (); };
+        openBtn.Accepted += (s, e) => { menuBar.OpenMenu (); };
         appWindow.Add (openBtn);
 
         var hideBtn = new Button { X = Pos.Center (), Y = Pos.Bottom (openBtn), Text = "Toggle Menu._Visible" };
-        hideBtn.Accept += (s, e) => { menuBar.Visible = !menuBar.Visible; };
+        hideBtn.Accepted += (s, e) => { menuBar.Visible = !menuBar.Visible; };
         appWindow.Add (hideBtn);
 
         var enableBtn = new Button { X = Pos.Center (), Y = Pos.Bottom (hideBtn), Text = "_Toggle Menu.Enable" };
-        enableBtn.Accept += (s, e) => { menuBar.Enabled = !menuBar.Enabled; };
+        enableBtn.Accepted += (s, e) => { menuBar.Enabled = !menuBar.Enabled; };
         appWindow.Add (enableBtn);
 
         appWindow.Add (menuBar);

+ 1 - 1
UICatalog/Scenarios/MessageBoxes.cs

@@ -228,7 +228,7 @@ public class MessageBoxes : Scenario
             X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefault = true, Text = "_Show MessageBox"
         };
 
-        app.Accept += (s, e) =>
+        app.Accepted += (s, e) =>
                                        {
                                            try
                                            {

+ 1 - 1
UICatalog/Scenarios/Mouse.cs

@@ -241,7 +241,7 @@ public class Mouse : Scenario
         };
         win.Add (label, winLog);
 
-        clearButton.Accept += (s, e) =>
+        clearButton.Accepted += (s, e) =>
                               {
                                   appLogList.Clear ();
                                   appLog.SetSource (appLogList);

+ 2 - 2
UICatalog/Scenarios/MultiColouredTable.cs

@@ -104,13 +104,13 @@ public class MultiColouredTable : Scenario
 
         var ok = new Button { Text = "Ok", IsDefault = true };
 
-        ok.Accept += (s, e) =>
+        ok.Accepted += (s, e) =>
                      {
                          okPressed = true;
                          Application.RequestStop ();
                      };
         var cancel = new Button { Text = "Cancel" };
-        cancel.Accept += (s, e) => { Application.RequestStop (); };
+        cancel.Accepted += (s, e) => { Application.RequestStop (); };
         var d = new Dialog { Title = title, Buttons = [ok, cancel] };
 
         var lbl = new Label { X = 0, Y = 1, Text = label };

+ 3 - 3
UICatalog/Scenarios/NumericUpDownDemo.cs

@@ -114,7 +114,7 @@ internal class NumericUpDownEditor<T> : View where T : notnull
                 Width = 8,
                 Title = "Value",
             };
-            _value.Accept += ValuedOnAccept;
+            _value.Accepted += ValuedOnAccept;
 
             void ValuedOnAccept (object? sender, EventArgs e)
             {
@@ -169,7 +169,7 @@ internal class NumericUpDownEditor<T> : View where T : notnull
                 Title = "Format",
                 Width = Dim.Width (_value),
             };
-            _format.Accept += FormatOnAccept;
+            _format.Accepted += FormatOnAccept;
 
             void FormatOnAccept (object? o, EventArgs eventArgs)
             {
@@ -217,7 +217,7 @@ internal class NumericUpDownEditor<T> : View where T : notnull
                 Width = Dim.Width (_value),
             };
 
-            _increment.Accept += IncrementOnAccept;
+            _increment.Accepted += IncrementOnAccept;
 
             void IncrementOnAccept (object? o, EventArgs eventArgs)
             {

+ 4 - 4
UICatalog/Scenarios/Progress.cs

@@ -142,7 +142,7 @@ public class Progress : Scenario
 
         var startBoth = new Button { X = Pos.Center (), Y = Pos.Bottom (mainLoopTimeoutDemo) + 1, Text = "Start Both" };
 
-        startBoth.Accept += (s, e) =>
+        startBoth.Accepted += (s, e) =>
                              {
                                  systemTimerDemo.Start ();
                                  mainLoopTimeoutDemo.Start ();
@@ -193,15 +193,15 @@ public class Progress : Scenario
             Add (LeftFrame);
 
             var startButton = new Button { X = Pos.Right (LeftFrame) + 1, Y = 0, Text = "Start Timer" };
-            startButton.Accept += (s, e) => Start ();
+            startButton.Accepted += (s, e) => Start ();
             var pulseButton = new Button { X = Pos.Right (startButton) + 2, Y = Pos.Y (startButton), Text = "Pulse" };
-            pulseButton.Accept += (s, e) => Pulse ();
+            pulseButton.Accepted += (s, e) => Pulse ();
 
             var stopbutton = new Button
             {
                 X = Pos.Right (pulseButton) + 2, Y = Pos.Top (pulseButton), Text = "Stop Timer"
             };
-            stopbutton.Accept += (s, e) => Stop ();
+            stopbutton.Accepted += (s, e) => Stop ();
 
             Add (startButton);
             Add (pulseButton);

+ 3 - 3
UICatalog/Scenarios/ProgressBarStyles.cs

@@ -72,7 +72,7 @@ public class ProgressBarStyles : Scenario
         };
         container.Add (fgColorPickerBtn);
 
-        fgColorPickerBtn.Accept += (s, e) =>
+        fgColorPickerBtn.Accepted += (s, e) =>
                                     {
                                         if (!LineDrawing.PromptForColor (
                                                                          fgColorPickerBtn.Text,
@@ -102,7 +102,7 @@ public class ProgressBarStyles : Scenario
         };
         container.Add (bgColorPickerBtn);
 
-        bgColorPickerBtn.Accept += (s, e) =>
+        bgColorPickerBtn.Accepted += (s, e) =>
                                     {
                                         if (!LineDrawing.PromptForColor (
                                                                          fgColorPickerBtn.Text,
@@ -172,7 +172,7 @@ public class ProgressBarStyles : Scenario
         };
         container.Add (continuousPB);
 
-        button.Accept += (s, e) =>
+        button.Accepted += (s, e) =>
                           {
                               if (_fractionTimer == null)
                               {

+ 1 - 1
UICatalog/Scenarios/RunTExample.cs

@@ -61,7 +61,7 @@ public class RunTExample : Scenario
             };
 
             // When login button is clicked display a message popup
-            btnLogin.Accept += (s, e) =>
+            btnLogin.Accepted += (s, e) =>
                                {
                                    if (_usernameText.Text == "admin" && passwordText.Text == "password")
                                    {

+ 6 - 6
UICatalog/Scenarios/RuneWidthGreaterThanOne.cs

@@ -106,7 +106,7 @@ public class RuneWidthGreaterThanOne : Scenario
         _label.Text = "Enter your name 你:";
         _text.Text = "gui.cs 你:";
         _button.Text = "Say Hello 你";
-        _button.Accept += MixedMessage;
+        _button.Accepted += MixedMessage;
         _labelR.X = Pos.AnchorEnd (21);
         _labelR.Y = 18;
         _labelR.Text = "This is a test text 你";
@@ -126,7 +126,7 @@ public class RuneWidthGreaterThanOne : Scenario
         _label.Text = "Enter your name:";
         _text.Text = "gui.cs";
         _button.Text = "Say Hello";
-        _button.Accept += NarrowMessage;
+        _button.Accepted += NarrowMessage;
         _labelR.X = Pos.AnchorEnd (19);
         _labelR.Y = 18;
         _labelR.Text = "This is a test text";
@@ -143,15 +143,15 @@ public class RuneWidthGreaterThanOne : Scenario
         switch (_lastRunesUsed)
         {
             case "Narrow":
-                _button.Accept -= NarrowMessage;
+                _button.Accepted -= NarrowMessage;
 
                 break;
             case "Mixed":
-                _button.Accept -= MixedMessage;
+                _button.Accepted -= MixedMessage;
 
                 break;
             case "Wide":
-                _button.Accept -= WideMessage;
+                _button.Accepted -= WideMessage;
 
                 break;
         }
@@ -165,7 +165,7 @@ public class RuneWidthGreaterThanOne : Scenario
         _label.Text = "あなたの名前を入力してください:";
         _text.Text = "ティラミス";
         _button.Text = "こんにちはと言う";
-        _button.Accept += WideMessage;
+        _button.Accepted += WideMessage;
         _labelR.X = Pos.AnchorEnd (29);
         _labelR.Y = 18;
         _labelR.Text = "あなたの名前を入力してください";

+ 3 - 3
UICatalog/Scenarios/Scrolling.cs

@@ -77,7 +77,7 @@ public class Scrolling : Scenario
         scrollView.Add (verticalRuler);
 
         var pressMeButton = new Button { X = 3, Y = 3, Text = "Press me!" };
-        pressMeButton.Accept += (s, e) => MessageBox.Query (20, 7, "MessageBox", "Neat?", "Yes", "No");
+        pressMeButton.Accepted += (s, e) => MessageBox.Query (20, 7, "MessageBox", "Neat?", "Yes", "No");
         scrollView.Add (pressMeButton);
 
         var aLongButton = new Button
@@ -88,7 +88,7 @@ public class Scrolling : Scenario
             Width = Dim.Fill (3),
             Text = "A very long button. Should be wide enough to demo clipping!"
         };
-        aLongButton.Accept += (s, e) => MessageBox.Query (20, 7, "MessageBox", "Neat?", "Yes", "No");
+        aLongButton.Accepted += (s, e) => MessageBox.Query (20, 7, "MessageBox", "Neat?", "Yes", "No");
         scrollView.Add (aLongButton);
 
         scrollView.Add (
@@ -130,7 +130,7 @@ public class Scrolling : Scenario
         // TODO: Use Pos.Width instead of (Right-Left) when implemented (#502)
         anchorButton.X = Pos.AnchorEnd (0) - (Pos.Right (anchorButton) - Pos.Left (anchorButton));
 
-        anchorButton.Accept += (s, e) =>
+        anchorButton.Accepted += (s, e) =>
                                {
                                    // This demonstrates how to have a dynamically sized button
                                    // Each time the button is clicked the button's text gets longer

+ 1 - 1
UICatalog/Scenarios/SendKeys.cs

@@ -100,7 +100,7 @@ public class SendKeys : Scenario
             txtInput.SetFocus ();
         }
 
-        button.Accept += (s, e) => ProcessInput ();
+        button.Accepted += (s, e) => ProcessInput ();
 
         win.KeyDown += (s, e) =>
                        {

+ 7 - 6
UICatalog/Scenarios/Shortcuts.cs

@@ -146,7 +146,7 @@ public class Shortcuts : Scenario
             KeyBindingScope = KeyBindingScope.HotKey,
         };
         Button button = (Button)vShortcut4.CommandView;
-        vShortcut4.Accept += Button_Clicked;
+        vShortcut4.Accepted += Button_Clicked;
 
         Application.Top.Add (vShortcut4);
 
@@ -343,7 +343,7 @@ public class Shortcuts : Scenario
             HelpText = "App Scope",
             CanFocus = false
         };
-        hShortcut3.Accept += (o, args) =>
+        hShortcut3.Accepted += (o, args) =>
         {
             Application.RequestStop ();
         };
@@ -354,27 +354,28 @@ public class Shortcuts : Scenario
         {
             if (sh is Shortcut shortcut)
             {
-                shortcut.Select += (o, args) =>
+                shortcut.Selected += (o, args) =>
                 {
                     eventSource.Add ($"{shortcut!.Id}.Select: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
                     eventLog.MoveDown ();
                     //args.Handled = true;
                 };
 
-                shortcut.CommandView.Select += (o, args) =>
+                shortcut.CommandView.Selected += (o, args) =>
                 {
                     eventSource.Add ($"{shortcut!.Id}.CommandView.Select: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
                     eventLog.MoveDown ();
                 };
 
-                shortcut.Accept += (o, args) =>
+                shortcut.Accepted += (o, args) =>
                 {
                     eventSource.Add ($"{shortcut!.Id}.Accept: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
                     eventLog.MoveDown ();
+                    // We don't want this to exit the Scenario
                     args.Handled = true;
                 };
 
-                shortcut.CommandView.Accept += (o, args) =>
+                shortcut.CommandView.Accepted += (o, args) =>
                 {
                     eventSource.Add ($"{shortcut!.Id}.CommandView.Accept: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}");
                     eventLog.MoveDown ();

+ 1 - 1
UICatalog/Scenarios/SingleBackgroundWorker.cs

@@ -91,7 +91,7 @@ public class SingleBackgroundWorker : Scenario
 
             var cancel = new Button { Text = "Cancel Worker" };
 
-            cancel.Accept += (s, e) =>
+            cancel.Accepted += (s, e) =>
                              {
                                  if (_worker == null)
                                  {

+ 1 - 1
UICatalog/Scenarios/Sliders.cs

@@ -595,7 +595,7 @@ public class Sliders : Scenario
 
         foreach (Slider slider in app.Subviews.Where (v => v is Slider)!)
         {
-            slider.Accept += (o, args) =>
+            slider.Accepted += (o, args) =>
                              {
                                  eventSource.Add ($"Accept: {string.Join(",", slider.GetSetOptions ())}");
                                  eventLog.MoveDown ();

+ 4 - 4
UICatalog/Scenarios/TableEditor.cs

@@ -878,13 +878,13 @@ public class TableEditor : Scenario
 
         var ok = new Button { Text = "Ok", IsDefault = true };
 
-        ok.Accept += (s, e) =>
+        ok.Accepted += (s, e) =>
                      {
                          okPressed = true;
                          Application.RequestStop ();
                      };
         var cancel = new Button { Text = "Cancel" };
-        cancel.Accept += (s, e) => { Application.RequestStop (); };
+        cancel.Accepted += (s, e) => { Application.RequestStop (); };
         var d = new Dialog { Title = title, Buttons = [ok, cancel] };
 
         var lbl = new Label { X = 0, Y = 1, Text = _tableView.Table.ColumnNames [e.Col] };
@@ -1076,13 +1076,13 @@ public class TableEditor : Scenario
         var accepted = false;
         var ok = new Button { Text = "Ok", IsDefault = true };
 
-        ok.Accept += (s, e) =>
+        ok.Accepted += (s, e) =>
                      {
                          accepted = true;
                          Application.RequestStop ();
                      };
         var cancel = new Button { Text = "Cancel" };
-        cancel.Accept += (s, e) => { Application.RequestStop (); };
+        cancel.Accepted += (s, e) => { Application.RequestStop (); };
         var d = new Dialog
         {
             Title = prompt,

+ 1 - 1
UICatalog/Scenarios/Text.cs

@@ -442,7 +442,7 @@ public class Text : Scenario
 
         win.Add (acceptView);
 
-        win.Accept += WinOnAccept;
+        win.Accepted += WinOnAccept;
 
         Application.Run (win);
         win.Dispose ();

+ 8 - 8
UICatalog/Scenarios/Threading.cs

@@ -56,7 +56,7 @@ public class Threading : Scenario
                 };
 
         _btnActionCancel = new Button { X = 1, Y = 1, Text = "Cancelable Load Items" };
-        _btnActionCancel.Accept += (s, e) => Application.Invoke (CallLoadItemsAsync);
+        _btnActionCancel.Accepted += (s, e) => Application.Invoke (CallLoadItemsAsync);
 
         win.Add (new Label { X = Pos.X (_btnActionCancel), Y = Pos.Y (_btnActionCancel) + 4, Text = "Data Items:" });
 
@@ -84,24 +84,24 @@ public class Threading : Scenario
         var text = new TextField { X = 1, Y = 3, Width = 100, Text = "Type anything after press the button" };
 
         var btnAction = new Button { X = 80, Y = 10, Text = "Load Data Action" };
-        btnAction.Accept += (s, e) => _action.Invoke ();
+        btnAction.Accepted += (s, e) => _action.Invoke ();
         var btnLambda = new Button { X = 80, Y = 12, Text = "Load Data Lambda" };
-        btnLambda.Accept += (s, e) => _lambda.Invoke ();
+        btnLambda.Accepted += (s, e) => _lambda.Invoke ();
         var btnHandler = new Button { X = 80, Y = 14, Text = "Load Data Handler" };
-        btnHandler.Accept += (s, e) => _handler.Invoke (null, EventArgs.Empty);
+        btnHandler.Accepted += (s, e) => _handler.Invoke (null, EventArgs.Empty);
         var btnSync = new Button { X = 80, Y = 16, Text = "Load Data Synchronous" };
-        btnSync.Accept += (s, e) => _sync.Invoke ();
+        btnSync.Accepted += (s, e) => _sync.Invoke ();
         var btnMethod = new Button { X = 80, Y = 18, Text = "Load Data Method" };
-        btnMethod.Accept += async (s, e) => await MethodAsync ();
+        btnMethod.Accepted += async (s, e) => await MethodAsync ();
         var btnClearData = new Button { X = 80, Y = 20, Text = "Clear Data" };
 
-        btnClearData.Accept += (s, e) =>
+        btnClearData.Accepted += (s, e) =>
                                 {
                                     _itemsList.Source = null;
                                     LogJob ("Cleaning Data");
                                 };
         var btnQuit = new Button { X = 80, Y = 22, Text = "Quit" };
-        btnQuit.Accept += (s, e) => Application.RequestStop ();
+        btnQuit.Accepted += (s, e) => Application.RequestStop ();
 
         win.Add (
                  _itemsList,

+ 1 - 1
UICatalog/Scenarios/TimeAndDate.cs

@@ -126,7 +126,7 @@ public class TimeAndDate : Scenario
             X = Pos.Center (), Y = Pos.Bottom (win) - 5, Text = "Swap Long/Short & Read/Read Only"
         };
 
-        swapButton.Accept += (s, e) =>
+        swapButton.Accepted += (s, e) =>
                              {
                                  longTime.ReadOnly = !longTime.ReadOnly;
                                  shortTime.ReadOnly = !shortTime.ReadOnly;

+ 2 - 2
UICatalog/Scenarios/VkeyPacketSimulator.cs

@@ -244,7 +244,7 @@ public class VkeyPacketSimulator : Scenario
                              }
                          };
 
-        btnInput.Accept += (s, e) =>
+        btnInput.Accepted += (s, e) =>
                            {
                                if (!tvInput.HasFocus && _keyboardStrokes.Count == 0)
                                {
@@ -252,7 +252,7 @@ public class VkeyPacketSimulator : Scenario
                                }
                            };
 
-        btnOutput.Accept += (s, e) =>
+        btnOutput.Accepted += (s, e) =>
                             {
                                 if (!tvOutput.HasFocus && _keyboardStrokes.Count == 0)
                                 {

+ 2 - 2
UICatalog/Scenarios/WindowsAndFrameViews.cs

@@ -52,7 +52,7 @@ public class WindowsAndFrameViews : Scenario
             ColorScheme = Colors.ColorSchemes ["Error"],
             Text = $"Padding of container is {padding}"
         };
-        paddingButton.Accept += (s, e) => About ();
+        paddingButton.Accepted += (s, e) => About ();
         win.Add (paddingButton);
 
         win.Add (
@@ -97,7 +97,7 @@ public class WindowsAndFrameViews : Scenario
                 X = Pos.Center (), Y = 0, ColorScheme = Colors.ColorSchemes ["Error"], Text = "Press me! (Y = 0)"
             };
 
-            pressMeButton.Accept += (s, e) =>
+            pressMeButton.Accepted += (s, e) =>
                                         MessageBox.ErrorQuery (loopWin.Title, "Neat?", "Yes", "No");
             loopWin.Add (pressMeButton);
 

+ 1 - 1
UICatalog/Scenarios/WizardAsView.cs

@@ -122,7 +122,7 @@ public class WizardAsView : Scenario
             Text = "Press Me to Rename Step", X = Pos.Right (buttonLbl), Y = Pos.Top (buttonLbl)
         };
 
-        button.Accept += (s, e) =>
+        button.Accepted += (s, e) =>
                           {
                               secondStep.Title = "2nd Step";
 

+ 3 - 3
UICatalog/Scenarios/Wizards.cs

@@ -109,7 +109,7 @@ public class Wizards : Scenario
             X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefault = true, Text = "_Show Wizard"
         };
 
-        showWizardButton.Accept += (s, e) =>
+        showWizardButton.Accepted += (s, e) =>
                                    {
                                        try
                                        {
@@ -193,7 +193,7 @@ public class Wizards : Scenario
                                            };
                                            secondStep.Add (radioGroup2);
 
-                                           button.Accept += (s, e) =>
+                                           button.Accepted += (s, e) =>
                                                             {
                                                                 secondStep.Title = "2nd Step";
 
@@ -299,7 +299,7 @@ public class Wizards : Scenario
                                                Y = Pos.AnchorEnd ()
                                            };
 
-                                           hideHelpBtn.Accept += (s, e) =>
+                                           hideHelpBtn.Accepted += (s, e) =>
                                                                  {
                                                                      if (fourthStep.HelpText.Length > 0)
                                                                      {

+ 1 - 1
UICatalog/UICatalog.cs

@@ -515,7 +515,7 @@ public class UICatalogApp
                     Title = "Show/Hide Status Bar",
                     CanFocus = false,
                 };
-                statusBarShortcut.Accept += (sender, args) =>
+                statusBarShortcut.Accepted += (sender, args) =>
                                             {
                                                 StatusBar.Visible = !StatusBar.Visible;
                                                 args.Handled = true;

+ 3 - 3
UnitTests/Application/MainLoopTests.cs

@@ -682,7 +682,7 @@ public class MainLoopTests
 
         var btnLaunch = new Button { Text = "Open Window" };
 
-        btnLaunch.Accept += (s, e) => action ();
+        btnLaunch.Accepted += (s, e) => action ();
 
         var top = new Toplevel ();
         top.Add (btnLaunch);
@@ -918,11 +918,11 @@ public class MainLoopTests
 
         btn = new Button { Text = "Click Me" };
 
-        btn.Accept += RunAsyncTest;
+        btn.Accepted += RunAsyncTest;
 
         var totalbtn = new Button { X = Pos.Right (btn), Text = "total" };
 
-        totalbtn.Accept += (s, e) => { MessageBox.Query ("Count", $"Count is {total}", "Ok"); };
+        totalbtn.Accepted += (s, e) => { MessageBox.Query ("Count", $"Count is {total}", "Ok"); };
 
         startWindow.Add (btn);
         startWindow.Add (totalbtn);

+ 4 - 4
UnitTests/Dialogs/DialogTests.cs

@@ -1058,18 +1058,18 @@ public class DialogTests
         Button btn3 = null;
         string expected = null;
 
-        btn1.Accept += (s, e) =>
+        btn1.Accepted += (s, e) =>
                        {
                            btn2 = new () { Text = "Show Sub" };
                            btn3 = new () { Text = "Close" };
-                           btn3.Accept += (s, e) => RequestStop ();
+                           btn3.Accepted += (s, e) => RequestStop ();
 
-                           btn2.Accept += (s, e) =>
+                           btn2.Accepted += (s, e) =>
                                           {
                                               // Don't test MessageBox in Dialog unit tests!
                                               var subBtn = new Button { Text = "Ok", IsDefault = true };
                                               var subDlg = new Dialog { Text = "ya", Width = 20, Height = 5, Buttons = [subBtn] };
-                                              subBtn.Accept += (s, e) => RequestStop (subDlg);
+                                              subBtn.Accepted += (s, e) => RequestStop (subDlg);
                                               Run (subDlg);
                                           };
 

+ 2 - 2
UnitTests/Dialogs/MessageBoxTests.cs

@@ -37,7 +37,7 @@ public class MessageBoxTests
 
                                              Button btn = Application.Navigation!.GetFocused () as Button;
 
-                                             btn.Accept += (sender, e) => { btnAcceptCount++; };
+                                             btn.Accepted += (sender, e) => { btnAcceptCount++; };
 
                                              // Click
                                              Application.OnKeyDown (Key.Enter);
@@ -120,7 +120,7 @@ public class MessageBoxTests
 
                                              Button btn = Application.Navigation!.GetFocused () as Button;
 
-                                             btn.Accept += (sender, e) => { btnAcceptCount++; };
+                                             btn.Accepted += (sender, e) => { btnAcceptCount++; };
 
                                              Application.OnKeyDown (Key.Space);
 

+ 4 - 0
UnitTests/TestHelpers.cs

@@ -100,6 +100,10 @@ public class AutoInitShutdownAttribute : BeforeAfterTestAttribute
             }
         }
 
+        // Reset to defaults
+        Locations = ConfigLocations.DefaultOnly;
+        Reset();
+
         // Enable subsequent tests that call Init to get all config files (the default).
         Locations = ConfigLocations.All;
     }

+ 3 - 3
UnitTests/View/HotKeyTests.cs

@@ -357,9 +357,9 @@ public class HotKeyTests
             Title = "_Test"
         };
         Application.Top.Add (view);
-        view.HotKeyCommand += (s, e) => hotKeyRaised = true;
-        view.Accept += (s, e) => acceptRaised = true;
-        view.Select += (s, e) => selectRaised = true;
+        view.HotKeyHandled += (s, e) => hotKeyRaised = true;
+        view.Accepted += (s, e) => acceptRaised = true;
+        view.Selected += (s, e) => selectRaised = true;
 
         Assert.Equal (KeyCode.T, view.HotKey);
         Assert.False (Application.OnKeyDown (Key.T)); // wasn't handled

+ 1 - 1
UnitTests/View/Navigation/EnabledTests.cs

@@ -258,7 +258,7 @@ public class EnabledTests () : TestsAllViews
         var wasClicked = false;
         var button = new Button { Text = "Click Me" };
         button.IsDefault = true;
-        button.Accept += (s, e) => wasClicked = !wasClicked;
+        button.Accepted += (s, e) => wasClicked = !wasClicked;
         var win = new Window { Width = Dim.Fill (), Height = Dim.Fill () };
         win.Add (button);
         var top = new Toplevel ();

+ 1 - 1
UnitTests/View/Navigation/HasFocusTests.cs

@@ -80,7 +80,7 @@ public class HasFocusTests () : TestsAllViews
     {
         var wasClicked = false;
         var view = new Button { Text = "Click Me" };
-        view.Accept += (s, e) => wasClicked = !wasClicked;
+        view.Accepted += (s, e) => wasClicked = !wasClicked;
 
         view.NewKeyDownEvent (Key.Space);
         Assert.True (wasClicked);

+ 22 - 15
UnitTests/View/ViewCommandTests.cs

@@ -42,7 +42,7 @@ public class ViewCommandTests (ITestOutputHelper output)
         var view = new View ();
         var acceptInvoked = false;
 
-        view.Accept += ViewOnAccept;
+        view.Accepted += ViewOnAccept;
 
         bool? ret = view.InvokeCommand (Command.Accept);
         Assert.True (ret);
@@ -63,7 +63,7 @@ public class ViewCommandTests (ITestOutputHelper output)
         var view = new View ();
         var accepted = false;
 
-        view.Accept += ViewOnAccept;
+        view.Accepted += ViewOnAccept;
 
         view.InvokeCommand (Command.Accept);
         Assert.True (accepted);
@@ -130,19 +130,26 @@ public class ViewCommandTests (ITestOutputHelper output)
     #endregion OnAccept/Accept tests
 
     #region OnSelect/Select tests
-    [Fact]
-    public void Select_Command_Raises_SetsFocus ()
+
+    [Theory]
+    [CombinatorialData]
+    public void Select_Command_Raises_SetsFocus (bool canFocus)
     {
-        var view = new ViewEventTester ();
+        var view = new ViewEventTester ()
+        {
+            CanFocus = canFocus
+        };
+
+        Assert.Equal (canFocus, view.CanFocus);
         Assert.False (view.HasFocus);
 
-        Assert.False (view.InvokeCommand (Command.Select)); // false means it was not handled
+        Assert.Equal (canFocus, view.InvokeCommand (Command.Select));
 
         Assert.Equal (1, view.OnSelectCount);
 
         Assert.Equal (1, view.SelectCount);
 
-        Assert.True (view.HasFocus);
+        Assert.Equal (canFocus, view.HasFocus);
     }
 
     [Fact]
@@ -165,7 +172,7 @@ public class ViewCommandTests (ITestOutputHelper output)
         var view = new View ();
         var SelectInvoked = false;
 
-        view.Select += ViewOnSelect;
+        view.Selected += ViewOnSelect;
 
         bool? ret = view.InvokeCommand (Command.Select);
         Assert.True (ret);
@@ -186,7 +193,7 @@ public class ViewCommandTests (ITestOutputHelper output)
         var view = new View ();
         var Selected = false;
 
-        view.Select += ViewOnSelect;
+        view.Selected += ViewOnSelect;
 
         view.InvokeCommand (Command.Select);
         Assert.True (Selected);
@@ -228,20 +235,20 @@ public class ViewCommandTests (ITestOutputHelper output)
         {
             CanFocus = true;
 
-            Accept += (s, a) =>
+            Accepted += (s, a) =>
                       {
                           a.Handled = HandleAccept;
                           AcceptCount++;
                       };
 
-            HotKeyCommand += (s, a) =>
+            HotKeyHandled += (s, a) =>
                              {
                                  a.Handled = HandleHotKeyCommand;
                                  HotKeyCommandCount++;
                              };
 
 
-            Select += (s, a) =>
+            Selected += (s, a) =>
                              {
                                  a.Handled = HandleSelect;
                                  SelectCount++;
@@ -253,7 +260,7 @@ public class ViewCommandTests (ITestOutputHelper output)
         public bool HandleOnAccept { get; set; }
 
         /// <inheritdoc />
-        protected override bool OnAccept (HandledEventArgs args)
+        protected override bool OnAccepted (HandledEventArgs args)
         {
             OnAcceptCount++;
 
@@ -267,7 +274,7 @@ public class ViewCommandTests (ITestOutputHelper output)
         public bool HandleOnHotKeyCommand { get; set; }
 
         /// <inheritdoc />
-        protected override bool OnHotKeyCommand (HandledEventArgs args)
+        protected override bool OnHotKeyHandled (HandledEventArgs args)
         {
             OnHotKeyCommandCount++;
 
@@ -282,7 +289,7 @@ public class ViewCommandTests (ITestOutputHelper output)
         public bool HandleOnSelect { get; set; }
 
         /// <inheritdoc />
-        protected override bool OnSelect (HandledEventArgs args)
+        protected override bool OnSelected (HandledEventArgs args)
         {
             OnSelectCount++;
 

+ 10 - 10
UnitTests/Views/ButtonTests.cs

@@ -249,7 +249,7 @@ public class ButtonTests (ITestOutputHelper output)
     {
         var clicked = false;
         var btn = new Button { Text = "_Test" };
-        btn.Accept += (s, e) => clicked = true;
+        btn.Accepted += (s, e) => clicked = true;
 
         Assert.Equal (KeyCode.T, btn.HotKey);
         Assert.False (btn.NewKeyDownEvent (Key.T)); // Button processes, but does not handle
@@ -280,7 +280,7 @@ public class ButtonTests (ITestOutputHelper output)
         button.CanFocus = focused;
 
         int acceptInvoked = 0;
-        button.Accept += (s, e) => acceptInvoked++;
+        button.Accepted += (s, e) => acceptInvoked++;
 
         superView.Add (button);
         button.SetFocus ();
@@ -308,7 +308,7 @@ public class ButtonTests (ITestOutputHelper output)
         button.CanFocus = focused;
 
         int acceptInvoked = 0;
-        button.Accept += (s, e) => acceptInvoked++;
+        button.Accepted += (s, e) => acceptInvoked++;
 
         superView.Add (button);
         button.SetFocus ();
@@ -339,7 +339,7 @@ public class ButtonTests (ITestOutputHelper output)
         button.CanFocus = focused;
 
         int acceptInvoked = 0;
-        button.Accept += (s, e) => acceptInvoked++;
+        button.Accepted += (s, e) => acceptInvoked++;
 
         superView.Add (button);
         button.SetFocus ();
@@ -363,7 +363,7 @@ public class ButtonTests (ITestOutputHelper output)
         var pressed = 0;
         var btn = new Button { Text = "Press Me" };
 
-        btn.Accept += (s, e) => pressed++;
+        btn.Accepted += (s, e) => pressed++;
 
         // The Button class supports the Default and Accept command
         Assert.Contains (Command.HotKey, btn.GetSupportedCommands ());
@@ -414,7 +414,7 @@ public class ButtonTests (ITestOutputHelper output)
     {
         var clicked = false;
         var btn = new Button { Text = "_Test" };
-        btn.Accept += (s, e) => clicked = true;
+        btn.Accepted += (s, e) => clicked = true;
         var top = new Toplevel ();
         top.Add (btn);
         Application.Begin (top);
@@ -483,7 +483,7 @@ public class ButtonTests (ITestOutputHelper output)
         var button = new Button ();
         var accepted = false;
 
-        button.Accept += ButtonOnAccept;
+        button.Accepted += ButtonOnAccept;
         button.InvokeCommand (Command.HotKey);
 
         Assert.True (accepted);
@@ -500,7 +500,7 @@ public class ButtonTests (ITestOutputHelper output)
         var button = new Button ();
         var acceptInvoked = false;
 
-        button.Accept += ButtonAccept;
+        button.Accepted += ButtonAccept;
 
         bool? ret = button.InvokeCommand (Command.Accept);
         Assert.True (ret);
@@ -610,7 +610,7 @@ public class ButtonTests (ITestOutputHelper output)
 
         var acceptCount = 0;
 
-        button.Accept += (s, e) => acceptCount++;
+        button.Accepted += (s, e) => acceptCount++;
 
         me.Flags = pressed;
         button.NewMouseEvent (me);
@@ -645,7 +645,7 @@ public class ButtonTests (ITestOutputHelper output)
 
         var acceptCount = 0;
 
-        button.Accept += (s, e) => acceptCount++;
+        button.Accepted += (s, e) => acceptCount++;
 
         me.Flags = pressed;
         button.NewMouseEvent (me);

+ 12 - 12
UnitTests/Views/CheckBoxTests.cs

@@ -181,10 +181,10 @@ public class CheckBoxTests (ITestOutputHelper output)
         ckb.CheckedStateChanging += (s, e) => checkedStateChangingCount++;
 
         int selectCount = 0;
-        ckb.Select += (s, e) => selectCount++;
+        ckb.Selected += (s, e) => selectCount++;
 
         int acceptCount = 0;
-        ckb.Accept += (s, e) => acceptCount++;
+        ckb.Accepted += (s, e) => acceptCount++;
 
         Assert.Equal (CheckState.UnChecked, ckb.CheckedState);
         Assert.Equal (0, checkedStateChangingCount);
@@ -228,7 +228,7 @@ public class CheckBoxTests (ITestOutputHelper output)
         var ckb = new CheckBox ();
         var acceptInvoked = false;
 
-        ckb.Accept += ViewOnAccept;
+        ckb.Accepted += ViewOnAccept;
 
         bool? ret = ckb.InvokeCommand (Command.Accept);
         Assert.True (ret);
@@ -256,10 +256,10 @@ public class CheckBoxTests (ITestOutputHelper output)
         checkBox.CheckedStateChanging += (s, e) => checkedStateChangingCount++;
 
         int selectCount = 0;
-        checkBox.Select += (s, e) => selectCount++;
+        checkBox.Selected += (s, e) => selectCount++;
 
         int acceptCount = 0;
-        checkBox.Accept += (s, e) => acceptCount++;
+        checkBox.Accepted += (s, e) => acceptCount++;
 
         checkBox.HasFocus = true;
         Assert.True (checkBox.HasFocus);
@@ -300,10 +300,10 @@ public class CheckBoxTests (ITestOutputHelper output)
         checkBox.CheckedStateChanging += (s, e) => checkedStateChangingCount++;
 
         int selectCount = 0;
-        checkBox.Select += (s, e) => selectCount++;
+        checkBox.Selected += (s, e) => selectCount++;
 
         int acceptCount = 0;
-        checkBox.Accept += (s, e) => acceptCount++;
+        checkBox.Accepted += (s, e) => acceptCount++;
 
         checkBox.HasFocus = true;
         Assert.True (checkBox.HasFocus);
@@ -544,7 +544,7 @@ public class CheckBoxTests (ITestOutputHelper output)
         var cb = new CheckBox ();
         var accepted = false;
 
-        cb.Accept += CheckBoxOnAccept;
+        cb.Accepted += CheckBoxOnAccept;
         cb.InvokeCommand (Command.HotKey);
 
         Assert.False (accepted);
@@ -559,24 +559,24 @@ public class CheckBoxTests (ITestOutputHelper output)
     [InlineData (CheckState.Checked)]
     [InlineData (CheckState.UnChecked)]
     [InlineData (CheckState.None)]
-    public void Select_Handle_Event_Does_Not_Prevent_Change (CheckState initialState)
+    public void Selected_Handle_Event_Does_Not_Prevent_Change (CheckState initialState)
     {
         var ckb = new CheckBox { AllowCheckStateNone = true };
         var checkedInvoked = false;
 
         ckb.CheckedState = initialState;
 
-        ckb.Select += OnSelect;
+        ckb.Selected += OnSelected;
 
         Assert.Equal (initialState, ckb.CheckedState);
         bool? ret = ckb.InvokeCommand (Command.Select);
-        Assert.False (ret);
+        Assert.True (ret);
         Assert.True (checkedInvoked);
         Assert.NotEqual (initialState, ckb.CheckedState);
 
         return;
 
-        void OnSelect (object sender, HandledEventArgs e)
+        void OnSelected (object sender, HandledEventArgs e)
         {
             checkedInvoked = true;
             e.Handled = true;

+ 1 - 1
UnitTests/Views/LabelTests.cs

@@ -74,7 +74,7 @@ public class LabelTests (ITestOutputHelper output)
         var label = new Label ();
         var accepted = false;
 
-        label.Accept += LabelOnAccept;
+        label.Accepted += LabelOnAccept;
         label.InvokeCommand (Command.HotKey);
 
         Assert.False (accepted);

+ 3 - 3
UnitTests/Views/ListViewTests.cs

@@ -414,7 +414,7 @@ Item 6",
         var listView = new ListView ();
         var accepted = false;
 
-        listView.Accept += OnAccept;
+        listView.Accepted += OnAccept;
         listView.InvokeCommand (Command.HotKey);
 
         Assert.False (accepted);
@@ -435,7 +435,7 @@ Item 6",
         var opened = false;
         var selectedValue = string.Empty;
 
-        listView.Accept += Accept;
+        listView.Accepted += Accept;
         listView.OpenSelectedItem += OpenSelectedItem;
 
         listView.InvokeCommand (Command.Accept);
@@ -466,7 +466,7 @@ Item 6",
         var opened = false;
         var selectedValue = string.Empty;
 
-        listView.Accept += Accept;
+        listView.Accepted += Accept;
         listView.OpenSelectedItem += OpenSelectedItem;
 
         listView.InvokeCommand (Command.Accept);

+ 1 - 1
UnitTests/Views/MenuBarTests.cs

@@ -238,7 +238,7 @@ public class MenuBarTests (ITestOutputHelper output)
 
         var btnClicked = false;
         var btn = new Button { Y = 4, Text = "Test" };
-        btn.Accept += (s, e) => btnClicked = true;
+        btn.Accepted += (s, e) => btnClicked = true;
         var top = new Toplevel ();
         top.Add (menu, btn);
         Application.Begin (top);

+ 14 - 14
UnitTests/Views/RadioGroupTests.cs

@@ -91,10 +91,10 @@ public class RadioGroupTests (ITestOutputHelper output)
         rg.SelectedItemChanged += (s, e) => selectedItemChangedCount++;
 
         var selectCount = 0;
-        rg.Select += (s, e) => selectCount++;
+        rg.Selected += (s, e) => selectCount++;
 
         var acceptCount = 0;
-        rg.Accept += (s, e) => acceptCount++;
+        rg.Accepted += (s, e) => acceptCount++;
 
         // By default the first item is selected
         Assert.Equal (0, rg.SelectedItem);
@@ -186,7 +186,7 @@ public class RadioGroupTests (ITestOutputHelper output)
         Assert.Equal (0, rg.SelectedItem);
         Assert.Equal (1, rg.Cursor);
 
-        //    Selected != Cursor - Select Cursor and raise Select event - DO NOT raise Accept
+        //    Selected != Cursor - Raise HotKey event - Since we're focused, this should just advance
         Assert.True (Application.OnKeyDown (rg.HotKey));
         Assert.Equal (1, rg.SelectedItem);
         Assert.Equal (1, rg.Cursor);
@@ -220,10 +220,10 @@ public class RadioGroupTests (ITestOutputHelper output)
         rg.SelectedItemChanged += (s, e) => selectedItemChangedCount++;
 
         var selectCount = 0;
-        rg.Select += (s, e) => selectCount++;
+        rg.Selected += (s, e) => selectCount++;
 
         var acceptCount = 0;
-        rg.Accept += (s, e) => acceptCount++;
+        rg.Accepted += (s, e) => acceptCount++;
 
         // By default the first item is selected
         Assert.Equal (0, rg.SelectedItem);
@@ -297,10 +297,10 @@ public class RadioGroupTests (ITestOutputHelper output)
         rg.SelectedItemChanged += (s, e) => selectedItemChangedCount++;
 
         var selectCount = 0;
-        rg.Select += (s, e) => selectCount++;
+        rg.Selected += (s, e) => selectCount++;
 
         var acceptCount = 0;
-        rg.Accept += (s, e) => acceptCount++;
+        rg.Accepted += (s, e) => acceptCount++;
 
         // By default the first item is selected
         Assert.Equal (0, rg.SelectedItem);
@@ -492,7 +492,7 @@ public class RadioGroupTests (ITestOutputHelper output)
         var group = new RadioGroup { RadioLabels = new [] { "_Left", "_Right", "Cen_tered", "_Justified" } };
         var accepted = false;
 
-        group.Accept += OnAccept;
+        group.Accepted += OnAccept;
         group.InvokeCommand (Command.HotKey);
 
         Assert.False (accepted);
@@ -508,7 +508,7 @@ public class RadioGroupTests (ITestOutputHelper output)
         var group = new RadioGroup { RadioLabels = new [] { "_Left", "_Right", "Cen_tered", "_Justified" } };
         var accepted = false;
 
-        group.Accept += OnAccept;
+        group.Accepted += OnAccept;
         group.InvokeCommand (Command.Accept);
 
         Assert.True (accepted);
@@ -627,10 +627,10 @@ public class RadioGroupTests (ITestOutputHelper output)
         radioGroup.SelectedItemChanged += (s, e) => selectedItemChanged++;
 
         var selectCount = 0;
-        radioGroup.Select += (s, e) => selectCount++;
+        radioGroup.Selected += (s, e) => selectCount++;
 
         var acceptCount = 0;
-        radioGroup.Accept += (s, e) => acceptCount++;
+        radioGroup.Accepted += (s, e) => acceptCount++;
 
         Assert.Equal (Orientation.Vertical, radioGroup.Orientation);
 
@@ -674,12 +674,12 @@ public class RadioGroupTests (ITestOutputHelper output)
         radioGroup.SelectedItemChanged += (s, e) => selectedItemChanged++;
 
         var selectCount = 0;
-        radioGroup.Select += (s, e) => selectCount++;
+        radioGroup.Selected += (s, e) => selectCount++;
 
         var acceptCount = 0;
         var handleAccept = false;
 
-        radioGroup.Accept += (s, e) =>
+        radioGroup.Accepted += (s, e) =>
                              {
                                  acceptCount++;
                                  e.Handled = handleAccept;
@@ -724,7 +724,7 @@ public class RadioGroupTests (ITestOutputHelper output)
 
         var superViewAcceptCount = 0;
 
-        superView.Accept += (s, a) =>
+        superView.Accepted += (s, a) =>
                             {
                                 superViewAcceptCount++;
                                 a.Handled = true;

+ 1 - 1
UnitTests/Views/ScrollBarViewTests.cs

@@ -1154,7 +1154,7 @@ This is a test
         var text = "This is a test\nThis is a test\nThis is a test\nThis is a test\nThis is a test";
         var label = new Label { Width = 14, Height = 5, Text = text };
         var btn = new Button { X = 14, Text = "Click Me!" };
-        btn.Accept += (s, e) => clicked = true;
+        btn.Accepted += (s, e) => clicked = true;
         var top = new Toplevel ();
         top.Add (label, btn);
 

+ 23 - 22
UnitTests/Views/ShortcutTests.cs

@@ -425,7 +425,7 @@ public class ShortcutTests
         Application.Begin (current);
 
         var accepted = 0;
-        shortcut.Accept += (s, e) => accepted++;
+        shortcut.Accepted += (s, e) => accepted++;
 
         Application.OnMouseEvent (
                                   new ()
@@ -445,15 +445,15 @@ public class ShortcutTests
     //  0123456789
     // " C  0  A "
     [InlineData (-1, 0, 0, 0, 0)]
-    [InlineData (0, 1, 0, 0, 1)] // mouseX = 0 is on the CommandView.Margin, so Shortcut will get MouseClick
-    [InlineData (1, 0, 0, 0, 1)] // mouseX = 1 is on the CommandView, so CommandView will get MouseClick
-    [InlineData (2, 1, 0, 0, 1)] // mouseX = 2 is on the CommandView.Margin, so Shortcut will get MouseClick
-    [InlineData (3, 0, 0, 0, 1)]
-    [InlineData (4, 0, 0, 0, 1)]
-    [InlineData (5, 0, 0, 1, 1)]
-    [InlineData (6, 0, 0, 1, 1)]
-    [InlineData (7, 0, 0, 1, 1)]
-    [InlineData (8, 0, 0, 1, 1)]
+    [InlineData (0, 0, 1, 1, 1)] // mouseX = 0 is on the CommandView.Margin, so Shortcut will get MouseClick
+    [InlineData (1, 0, 1, 1, 1)] // mouseX = 1 is on the CommandView, so CommandView will get MouseClick
+    [InlineData (2, 1, 1, 1, 1)] // mouseX = 2 is on the CommandView.Margin, so Shortcut will get MouseClick
+    [InlineData (3, 0, 1, 1, 1)]
+    [InlineData (4, 0, 1, 1, 1)]
+    [InlineData (5, 0, 1, 1, 1)]
+    [InlineData (6, 0, 1, 1, 1)]
+    [InlineData (7, 0, 1, 1, 1)]
+    [InlineData (8, 0, 1, 1, 1)]
     [InlineData (9, 0, 0, 0, 0)]
 
     //[InlineData (1, 1, 1)]
@@ -465,7 +465,8 @@ public class ShortcutTests
     //[InlineData (7, 1, 0)]
     //[InlineData (8, 1, 0)]
     //[InlineData (9, 0, 0)]
-    public void MouseClick_Default_CommandView_Raises_Accept_Select_Correctly (int mouseX, int expectedCommandViewAccept, int expectedCommandViewSelect, int expectedShortcutAccept, int expectedShortcutSelect)
+    public void MouseClick_Default_CommandView_Raises_Accept_Select_Correctly (int mouseX, int expectedCommandViewAccept, int expectedCommandViewSelect, 
+                                                                               int expectedShortcutAccept, int expectedShortcutSelect)
     {
         Application.Top = new Toplevel ();
 
@@ -477,23 +478,23 @@ public class ShortcutTests
         };
 
         var commandViewAcceptCount = 0;
-        shortcut.CommandView.Accept += (s, e) =>
+        shortcut.CommandView.Accepted += (s, e) =>
         {
             commandViewAcceptCount++;
         };
         var commandViewSelectCount = 0;
-        shortcut.CommandView.Select += (s, e) =>
+        shortcut.CommandView.Selected += (s, e) =>
         {
             commandViewSelectCount++;
         };
 
         var shortcutAcceptCount = 0;
-        shortcut.Accept += (s, e) =>
+        shortcut.Accepted += (s, e) =>
         {
             shortcutAcceptCount++;
         };
         var shortcutSelectCount = 0;
-        shortcut.Select += (s, e) =>
+        shortcut.Selected += (s, e) =>
         {
             shortcutSelectCount++;
         };
@@ -511,8 +512,8 @@ public class ShortcutTests
                                   });
 
         Assert.Equal (expectedShortcutAccept, shortcutAcceptCount);
-        Assert.Equal (expectedCommandViewAccept, commandViewAcceptCount);
         Assert.Equal (expectedShortcutSelect, shortcutSelectCount);
+        Assert.Equal (expectedCommandViewAccept, commandViewAcceptCount);
         Assert.Equal (expectedCommandViewSelect, commandViewSelectCount);
 
         Application.Top.Dispose ();
@@ -534,7 +535,8 @@ public class ShortcutTests
     [InlineData (7, 1, 0)]
     [InlineData (8, 1, 0)]
     [InlineData (9, 0, 0)]
-    public void MouseClick_Button_CommandView_Fires_Shortcut_Accept (int mouseX, int expectedAccept, int expectedButtonAccept)
+    public void MouseClick_Button_CommandView_Raises_Shortcut_Accept
+        (int mouseX, int expectedAccept, int expectedButtonAccept)
     {
         Application.Top = new Toplevel ();
 
@@ -552,7 +554,7 @@ public class ShortcutTests
             CanFocus = false
         };
         var buttonAccepted = 0;
-        shortcut.CommandView.Accept += (s, e) =>
+        shortcut.CommandView.Accepted += (s, e) =>
         {
             buttonAccepted++;
             // Must indicate handled
@@ -561,7 +563,7 @@ public class ShortcutTests
         Application.Top.Add (shortcut);
 
         var accepted = 0;
-        shortcut.Accept += (s, e) => accepted++;
+        shortcut.Accepted += (s, e) => accepted++;
 
         //Assert.True (shortcut.HasFocus);
 
@@ -610,7 +612,7 @@ public class ShortcutTests
         Assert.Equal (canFocus, shortcut.HasFocus);
 
         var accepted = 0;
-        shortcut.Accept += (s, e) => accepted++;
+        shortcut.Accepted += (s, e) => accepted++;
 
         Application.OnKeyDown (key);
 
@@ -641,7 +643,7 @@ public class ShortcutTests
         Application.Top.SetFocus ();
 
         var accepted = 0;
-        shortcut.Accept += (s, e) => accepted++;
+        shortcut.Accepted += (s, e) => accepted++;
 
         Application.OnKeyDown (key);
 
@@ -704,7 +706,6 @@ public class ShortcutTests
     [InlineData (false, KeyCode.Enter, 0)]
     [InlineData (false, KeyCode.Space, 0)]
     [InlineData (false, KeyCode.F1, 0)]
-    [AutoInitShutdown]
     public void KeyDown_App_Scope_Invokes_Action (bool canFocus, KeyCode key, int expectedAction)
     {
         Application.Top = new Toplevel ();

+ 7 - 7
UnitTests/Views/TextFieldTests.cs

@@ -766,7 +766,7 @@ public class TextFieldTests (ITestOutputHelper output)
     {
         var view = new TextField ();
         var accepted = false;
-        view.Accept += OnAccept;
+        view.Accepted += OnAccept;
         view.InvokeCommand (Command.HotKey);
 
         Assert.False (accepted);
@@ -782,7 +782,7 @@ public class TextFieldTests (ITestOutputHelper output)
         var view = new TextField ();
 
         var accepted = false;
-        view.Accept += Accept;
+        view.Accepted += Accept;
         view.InvokeCommand (Command.Accept);
         Assert.True (accepted);
 
@@ -814,10 +814,10 @@ public class TextFieldTests (ITestOutputHelper output)
         superView.Add (tf, button);
 
         var buttonAccept = 0;
-        button.Accept += ButtonAccept;
+        button.Accepted += ButtonAccept;
 
         var textFieldAccept = 0;
-        tf.Accept += TextFieldAccept;
+        tf.Accepted += TextFieldAccept;
 
         tf.SetFocus ();
         Assert.True (tf.HasFocus);
@@ -866,7 +866,7 @@ public class TextFieldTests (ITestOutputHelper output)
         superView.Add (tf, button);
 
         var buttonAccept = 0;
-        button.Accept += ButtonAccept;
+        button.Accepted += ButtonAccept;
 
         tf.SetFocus ();
         Assert.True (tf.HasFocus);
@@ -898,13 +898,13 @@ public class TextFieldTests (ITestOutputHelper output)
 
         var tfAcceptedInvoked = false;
         var handle = false;
-        view.Accept += TextViewAccept;
+        view.Accepted += TextViewAccept;
         Assert.False (view.InvokeCommand (Command.Accept));
         Assert.True (tfAcceptedInvoked);
 
         tfAcceptedInvoked = false;
         handle = true;
-        view.Accept += TextViewAccept;
+        view.Accepted += TextViewAccept;
         Assert.True (view.InvokeCommand (Command.Accept));
         Assert.True (tfAcceptedInvoked);
 

Some files were not shown because too many files changed in this diff