diff --git a/CommunityToolkitExample/LoginView.cs b/CommunityToolkitExample/LoginView.cs index d3d4b6496..8d66f29bb 100644 --- a/CommunityToolkitExample/LoginView.cs +++ b/CommunityToolkitExample/LoginView.cs @@ -19,13 +19,13 @@ internal partial class LoginView : IRecipient> { ViewModel.Password = passwordInput.Text; }; - loginButton.Accepted += (_, _) => + loginButton.Accepting += (_, _) => { if (!ViewModel.CanLogin) { return; } ViewModel.LoginCommand.Execute (null); }; - clearButton.Accepted += (_, _) => + clearButton.Accepting += (_, _) => { ViewModel.ClearCommand.Execute (null); }; diff --git a/Example/Example.cs b/Example/Example.cs index f34f0d095..39126f4d9 100644 --- a/Example/Example.cs +++ b/Example/Example.cs @@ -63,7 +63,7 @@ public class ExampleWindow : Window }; // When login button is clicked display a message popup - btnLogin.Accepted += (s, e) => + btnLogin.Accepting += (s, e) => { if (userNameText.Text == "admin" && passwordText.Text == "password") { diff --git a/NativeAot/Program.cs b/NativeAot/Program.cs index be71b81e8..bb0f38bc0 100644 --- a/NativeAot/Program.cs +++ b/NativeAot/Program.cs @@ -93,7 +93,7 @@ public class ExampleWindow : Window }; // When login button is clicked display a message popup - btnLogin.Accepted += (s, e) => + btnLogin.Accepting += (s, e) => { if (userNameText.Text == "admin" && passwordText.Text == "password") { diff --git a/ReactiveExample/LoginView.cs b/ReactiveExample/LoginView.cs index 4037e69f3..130aebb43 100644 --- a/ReactiveExample/LoginView.cs +++ b/ReactiveExample/LoginView.cs @@ -108,7 +108,7 @@ public class LoginView : Window, IViewFor login .Events () - .Accepted + .Accepting .InvokeCommand (ViewModel, x => x.Login) .DisposeWith (_disposable); }) @@ -120,7 +120,7 @@ public class LoginView : Window, IViewFor clear .Events () - .Accepted + .Accepting .InvokeCommand (ViewModel, x => x.ClearCommand) .DisposeWith (_disposable); }) diff --git a/SelfContained/Program.cs b/SelfContained/Program.cs index 5c52e215d..29b7f5cd9 100644 --- a/SelfContained/Program.cs +++ b/SelfContained/Program.cs @@ -92,7 +92,7 @@ public class ExampleWindow : Window }; // When login button is clicked display a message popup - btnLogin.Accepted += (s, e) => + btnLogin.Accepting += (s, e) => { if (userNameText.Text == "admin" && passwordText.Text == "password") { diff --git a/Terminal.Gui/FileServices/DefaultFileOperations.cs b/Terminal.Gui/FileServices/DefaultFileOperations.cs index eae31479b..9ba859284 100644 --- a/Terminal.Gui/FileServices/DefaultFileOperations.cs +++ b/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.Accepted += (s, e) => + btnOk.Accepting += (s, e) => { confirm = true; Application.RequestStop (); }; var btnCancel = new Button { Text = Strings.btnCancel }; - btnCancel.Accepted += (s, e) => + btnCancel.Accepting += (s, e) => { confirm = false; Application.RequestStop (); diff --git a/Terminal.Gui/Input/Command.cs b/Terminal.Gui/Input/Command.cs index 270d7a3f4..43af4e906 100644 --- a/Terminal.Gui/Input/Command.cs +++ b/Terminal.Gui/Input/Command.cs @@ -14,7 +14,7 @@ public enum Command /// /// Accepts the current state of the View (e.g. list selection, button press, checkbox state, etc.). /// - /// The default implementation in calls . If the event is not handled, + /// The default implementation in calls . If the event is not handled, /// the command is invoked on: /// - Any peer-view that is a with set to . /// - The . This enables default Accept behavior. diff --git a/Terminal.Gui/View/View.Command.cs b/Terminal.Gui/View/View.Command.cs index 1f0fcab3b..3facab4d0 100644 --- a/Terminal.Gui/View/View.Command.cs +++ b/Terminal.Gui/View/View.Command.cs @@ -13,7 +13,7 @@ public partial class View // Command APIs private void SetupCommands () { // Enter - Raise Accepted - AddCommand (Command.Accept, RaiseAccepted); + AddCommand (Command.Accept, RaiseAccepting); // HotKey - SetFocus and raise HandlingHotKey AddCommand (Command.HotKey, @@ -49,28 +49,28 @@ public partial class View // Command APIs } /// - /// Called when the user is accepting the state of the View and the has been invoked. Calls which can be cancelled; if not cancelled raises . + /// Called when the user is accepting the state of the View and the has been invoked. Calls which can be cancelled; if not cancelled raises . /// event. The default handler calls this method. /// /// - /// The event should raised after the state of the View has changed (after is raised). + /// The event should raised after the state of the View has changed (after is raised). /// /// /// If the event was canceled. If the event was raised but not canceled. /// If no event was raised. /// - protected bool? RaiseAccepted () + protected bool? RaiseAccepting () { CommandEventArgs args = new (); // Best practice is to invoke the virtual method first. // This allows derived classes to handle the event and potentially cancel it. - args.Cancel = OnAccepted (args) || args.Cancel; + args.Cancel = OnAccepting (args) || args.Cancel; if (!args.Cancel) { // If the event is not canceled by the virtual method, raise the event to notify any external subscribers. - Accepted?.Invoke (this, args); + Accepting?.Invoke (this, args); } // Accept is a special case where if the event is not canceled, the event is @@ -93,7 +93,7 @@ public partial class View // Command APIs return SuperView?.InvokeCommand (Command.Accept, ctx: new (Command.Accept, null, null, this)) == true; } - return Accepted is null ? null : args.Cancel; + return Accepting is null ? null : args.Cancel; } /// @@ -102,20 +102,20 @@ public partial class View // Command APIs /// /// /// to stop processing. - protected virtual bool OnAccepted (CommandEventArgs args) { return false; } + protected virtual bool OnAccepting (CommandEventArgs args) { return false; } /// /// Cancelable event raised when the user is accepting the state of the View and the has been invoked. Set /// to cancel the event. /// - public event EventHandler? Accepted; + public event EventHandler? Accepting; /// - /// Called when the user has performed an action (e.g. ) causing the View to change state. Calls which can be cancelled; if not cancelled raises . + /// Called when the user has performed an action (e.g. ) causing the View to change state. Calls which can be cancelled; if not cancelled raises . /// event. The default handler calls this method. /// /// - /// The event should raised after the state of the View has been changed and before see . + /// The event should raised after the state of the View has been changed and before see . /// /// /// If the event was canceled. If the event was raised but not canceled. @@ -155,7 +155,7 @@ public partial class View // Command APIs public event EventHandler? Selecting; /// - /// Called when the View is handling the user pressing the View's s. Calls which can be cancelled; if not cancelled raises . + /// Called when the View is handling the user pressing the View's s. Calls which can be cancelled; if not cancelled raises . /// event. The default handler calls this method. /// /// diff --git a/Terminal.Gui/View/View.Keyboard.cs b/Terminal.Gui/View/View.Keyboard.cs index 2f32b4ef8..fad1cdbb0 100644 --- a/Terminal.Gui/View/View.Keyboard.cs +++ b/Terminal.Gui/View/View.Keyboard.cs @@ -39,7 +39,7 @@ public partial class View // Keyboard APIs /// /// 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" Alt+T will cause the button to gain focus and to raise its - /// event. + /// event. /// Or, in a /// with "_File _Edit", Alt+F will select (show) the "_File" menu. If the "_File" menu /// has a diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs index 59e75be1e..b0ab5408f 100644 --- a/Terminal.Gui/Views/Button.cs +++ b/Terminal.Gui/Views/Button.cs @@ -8,12 +8,12 @@ namespace Terminal.Gui; /// -/// A View that raises the event when clicked with the mouse or when the +/// A View that raises the event when clicked with the mouse or when the /// , Enter, or Space key is pressed. /// /// /// -/// Provides a button showing text that raises the event when clicked on with a mouse or +/// Provides a button showing text that raises the event when clicked on with a mouse or /// when the user presses Enter, Space or the . The hot key is the first /// letter or digit /// following the first underscore ('_') in the button text. @@ -21,13 +21,13 @@ namespace Terminal.Gui; /// Use to change the hot key specifier from the default of ('_'). /// /// When the button is configured as the default () and the user causes the button to be -/// accepted the 's event will be raised. If the Accept event is not +/// accepted the 's event will be raised. If the Accept event is not /// handled, the Accept event on the . will be raised. This enables default Accept /// behavior. /// /// /// Set to to have the -/// event +/// event /// invoked repeatedly while the button is pressed. /// /// @@ -90,7 +90,7 @@ public class Button : View, IDesignable return true; } - bool? handled = RaiseAccepted (); + bool? handled = RaiseAccepting (); if (handled == true) { @@ -170,7 +170,7 @@ public class Button : View, IDesignable /// /// will be invoked when the user presses Enter and no other peer- /// processes the key. - /// If is not handled, the Gets or sets whether the will show an + /// If is not handled, the Gets or sets whether the will show an /// indicator indicating it is the default Button. If /// command on the will be invoked. /// diff --git a/Terminal.Gui/Views/CheckBox.cs b/Terminal.Gui/Views/CheckBox.cs index 843b94d60..af58ecedd 100644 --- a/Terminal.Gui/Views/CheckBox.cs +++ b/Terminal.Gui/Views/CheckBox.cs @@ -27,7 +27,7 @@ public class CheckBox : View AddCommand (Command.HotKey, AdvanceAndSelect); // Accept (Enter key) - Raise Accept event - DO NOT advance state - AddCommand (Command.Accept, RaiseAccepted); + AddCommand (Command.Accept, RaiseAccepting); TitleChanged += Checkbox_TitleChanged; diff --git a/Terminal.Gui/Views/ColorPicker.cs b/Terminal.Gui/Views/ColorPicker.cs index 7ecb76bff..83a0365d7 100644 --- a/Terminal.Gui/Views/ColorPicker.cs +++ b/Terminal.Gui/Views/ColorPicker.cs @@ -64,7 +64,7 @@ public class ColorPicker : View Width = textFieldWidth }; tfValue.HasFocusChanged += UpdateSingleBarValueFromTextField; - tfValue.Accepted += (s, _)=>UpdateSingleBarValueFromTextField(s); + tfValue.Accepting += (s, _)=>UpdateSingleBarValueFromTextField(s); _textFields.Add (bar, tfValue); } @@ -154,7 +154,7 @@ public class ColorPicker : View _tfName.Autocomplete = auto; _tfName.HasFocusChanged += UpdateValueFromName; - _tfName.Accepted += (s, _) => UpdateValueFromName (); + _tfName.Accepting += (s, _) => UpdateValueFromName (); } private void CreateTextField () @@ -184,7 +184,7 @@ public class ColorPicker : View Add (_tfHex); _tfHex.HasFocusChanged += UpdateValueFromTextField; - _tfHex.Accepted += (_,_)=> UpdateValueFromTextField(); + _tfHex.Accepting += (_,_)=> UpdateValueFromTextField(); } private void DisposeOldViews () diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index 0f359164d..746dc7d98 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -36,7 +36,7 @@ public class ComboBox : View, IDesignable _listview.Y = Pos.Bottom (_search); _listview.OpenSelectedItem += (sender, a) => SelectText (); - _listview.Accepted += (sender, args) => + _listview.Accepting += (sender, args) => { // This prevents Accepted from bubbling up to the combobox args.Cancel = true; @@ -401,7 +401,7 @@ public class ComboBox : View, IDesignable return false; } - return RaiseAccepted () == true; + return RaiseAccepting () == true; } return false; diff --git a/Terminal.Gui/Views/DatePicker.cs b/Terminal.Gui/Views/DatePicker.cs index d9d47f868..aca0c086e 100644 --- a/Terminal.Gui/Views/DatePicker.cs +++ b/Terminal.Gui/Views/DatePicker.cs @@ -227,7 +227,7 @@ public class DatePicker : View ShadowStyle = ShadowStyle.None }; - _previousMonthButton.Accepted += (sender, e) => + _previousMonthButton.Accepting += (sender, e) => { Date = _date.AddMonths (-1); CreateCalendar (); @@ -247,7 +247,7 @@ public class DatePicker : View ShadowStyle = ShadowStyle.None }; - _nextMonthButton.Accepted += (sender, e) => + _nextMonthButton.Accepting += (sender, e) => { Date = _date.AddMonths (1); CreateCalendar (); diff --git a/Terminal.Gui/Views/FileDialog.cs b/Terminal.Gui/Views/FileDialog.cs index b9b1e5600..d0022fea0 100644 --- a/Terminal.Gui/Views/FileDialog.cs +++ b/Terminal.Gui/Views/FileDialog.cs @@ -78,7 +78,7 @@ public class FileDialog : Dialog Y = Pos.AnchorEnd (), IsDefault = true, Text = Style.OkButtonText }; - _btnOk.Accepted += (s, e) => Accept (true); + _btnOk.Accepting += (s, e) => Accept (true); _btnCancel = new Button @@ -88,7 +88,7 @@ public class FileDialog : Dialog Text = Strings.btnCancel }; - _btnCancel.Accepted += (s, e) => + _btnCancel.Accepting += (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.Accepted += (s, e) => _history.Up (); + _btnUp.Accepting += (s, e) => _history.Up (); _btnBack = new Button { X = Pos.Right (_btnUp) + 1, Y = 1, NoPadding = true }; _btnBack.Text = GetBackButtonText (); - _btnBack.Accepted += (s, e) => _history.Back (); + _btnBack.Accepting += (s, e) => _history.Back (); _btnForward = new Button { X = Pos.Right (_btnBack) + 1, Y = 1, NoPadding = true }; _btnForward.Text = GetForwardButtonText (); - _btnForward.Accepted += (s, e) => _history.Forward (); + _btnForward.Accepting += (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.Accepted += (s, e) => + _btnToggleSplitterCollapse.Accepting += (s, e) => { Tile tile = _splitContainer.Tiles.ElementAt (0); diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs index ad9d35b8f..382fdbf87 100644 --- a/Terminal.Gui/Views/ListView.cs +++ b/Terminal.Gui/Views/ListView.cs @@ -140,7 +140,7 @@ public class ListView : View, IDesignable // Accept (Enter key) - Raise Accept event - DO NOT advance state AddCommand (Command.Accept, () => { - if (RaiseAccepted () == true) + if (RaiseAccepting () == true) { return true; } diff --git a/Terminal.Gui/Views/Menu/MenuBar.cs b/Terminal.Gui/Views/Menu/MenuBar.cs index 3b3ddfef2..957e568cf 100644 --- a/Terminal.Gui/Views/Menu/MenuBar.cs +++ b/Terminal.Gui/Views/Menu/MenuBar.cs @@ -126,7 +126,7 @@ public class MenuBar : View, IDesignable ProcessMenu (_selected, Menus [_selected]); } - return RaiseAccepted (); + return RaiseAccepting (); } ); AddCommand (Command.Toggle, ctx => diff --git a/Terminal.Gui/Views/Menuv2.cs b/Terminal.Gui/Views/Menuv2.cs index ca86d8cfa..e8d371e22 100644 --- a/Terminal.Gui/Views/Menuv2.cs +++ b/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.Accepted += ShortcutOnAccept; + shortcut.Accepting += ShortcutOnAccept; void ShortcutOnAccept (object sender, CommandEventArgs e) { diff --git a/Terminal.Gui/Views/MessageBox.cs b/Terminal.Gui/Views/MessageBox.cs index 47e615123..af35b257e 100644 --- a/Terminal.Gui/Views/MessageBox.cs +++ b/Terminal.Gui/Views/MessageBox.cs @@ -408,7 +408,7 @@ public static class MessageBox int buttonId = n; Button b = buttonList [n]; - b.Accepted += (s, e) => + b.Accepting += (s, e) => { Clicked = buttonId; Application.RequestStop (); diff --git a/Terminal.Gui/Views/NumericUpDown.cs b/Terminal.Gui/Views/NumericUpDown.cs index b894a93b7..4e73d87c5 100644 --- a/Terminal.Gui/Views/NumericUpDown.cs +++ b/Terminal.Gui/Views/NumericUpDown.cs @@ -86,8 +86,8 @@ public class NumericUpDown : View where T : notnull CanFocus = true; - _down.Accepted += OnDownButtonOnAccept; - _up.Accepted += OnUpButtonOnAccept; + _down.Accepting += OnDownButtonOnAccept; + _up.Accepting += OnUpButtonOnAccept; Add (_down, _number, _up); diff --git a/Terminal.Gui/Views/RadioGroup.cs b/Terminal.Gui/Views/RadioGroup.cs index f01dd2ead..545fe2a6d 100644 --- a/Terminal.Gui/Views/RadioGroup.cs +++ b/Terminal.Gui/Views/RadioGroup.cs @@ -50,7 +50,7 @@ public class RadioGroup : View, IDesignable, IOrientation }); // Accept (Enter key) - Raise Accept event - DO NOT advance state - AddCommand (Command.Accept, () => RaiseAccepted ()); + AddCommand (Command.Accept, () => RaiseAccepting ()); // 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 @@ -209,7 +209,7 @@ public class RadioGroup : View, IDesignable, IOrientation } /// - /// Gets or sets whether double clicking on a Radio Item will cause the event to be raised. + /// Gets or sets whether double clicking on a Radio Item will cause the event to be raised. /// /// /// diff --git a/Terminal.Gui/Views/Shortcut.cs b/Terminal.Gui/Views/Shortcut.cs index 6f1b8257b..8b33b7fe3 100644 --- a/Terminal.Gui/Views/Shortcut.cs +++ b/Terminal.Gui/Views/Shortcut.cs @@ -12,7 +12,7 @@ namespace Terminal.Gui; /// /// /// The following user actions will invoke the , causing the -/// event to be fired: +/// event to be fired: /// - Clicking on the . /// - Pressing the key specified by . /// - Pressing the HotKey specified by . @@ -344,7 +344,7 @@ public class Shortcut : View, IOrientation, IDesignable var cancel = false; - cancel = RaiseAccepted () is true; + cancel = RaiseAccepting () is true; if (cancel) { @@ -372,7 +372,7 @@ public class Shortcut : View, IOrientation, IDesignable /// mouse. /// /// - /// Note, the event is fired first, and if cancelled, the event will not be invoked. + /// Note, the event is fired first, and if cancelled, the event will not be invoked. /// public Action? Action { get; set; } @@ -478,7 +478,7 @@ public class Shortcut : View, IOrientation, IDesignable // Clean up old _commandView.Selecting -= CommandViewOnSelecting; - _commandView.Accepted -= CommandViewOnAccepted; + _commandView.Accepting -= CommandViewOnAccepted; Remove (_commandView); _commandView?.Dispose (); @@ -505,7 +505,7 @@ public class Shortcut : View, IOrientation, IDesignable _commandView.Selecting += CommandViewOnSelecting; - _commandView.Accepted += CommandViewOnAccepted; + _commandView.Accepting += CommandViewOnAccepted; SetCommandViewDefaultLayout (); SetHelpViewDefaultLayout (); diff --git a/Terminal.Gui/Views/Slider.cs b/Terminal.Gui/Views/Slider.cs index b684456bc..80580f82e 100644 --- a/Terminal.Gui/Views/Slider.cs +++ b/Terminal.Gui/Views/Slider.cs @@ -1789,7 +1789,7 @@ public class Slider : View, IOrientation { SetFocusedOption (); - return RaiseAccepted () == true; + return RaiseAccepting () == true; } internal bool MovePlus () diff --git a/Terminal.Gui/Views/StatusBar.cs b/Terminal.Gui/Views/StatusBar.cs index 3614f097d..975d2c7ad 100644 --- a/Terminal.Gui/Views/StatusBar.cs +++ b/Terminal.Gui/Views/StatusBar.cs @@ -113,10 +113,10 @@ public class StatusBar : Bar, IDesignable Text = "I'll Hide", // Visible = false }; - button1.Accepted += Button_Clicked; + button1.Accepting += Button_Clicked; Add (button1); - shortcut.Accepted += (s, e) => + shortcut.Accepting += (s, e) => { button1.Visible = !button1.Visible; button1.Enabled = button1.Visible; @@ -134,7 +134,7 @@ public class StatusBar : Bar, IDesignable { Text = "Or me!", }; - button2.Accepted += (s, e) => Application.RequestStop (); + button2.Accepting += (s, e) => Application.RequestStop (); Add (button2); diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index 346f5585c..beee16d46 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -2517,7 +2517,7 @@ public class TextView : View // BUGBUG: AllowsReturn is mis-named. It should be EnterKeyAccepts. /// /// Gets or sets whether pressing ENTER in a creates a new line of text - /// in the view or invokes the event. + /// in the view or invokes the event. /// /// /// @@ -6054,7 +6054,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 RaiseAccepted () is null or false; + return RaiseAccepting () is null or false; } SetWrapModel (); diff --git a/Terminal.Gui/Views/TreeView/TreeView.cs b/Terminal.Gui/Views/TreeView/TreeView.cs index 31afcd62a..0b24d8670 100644 --- a/Terminal.Gui/Views/TreeView/TreeView.cs +++ b/Terminal.Gui/Views/TreeView/TreeView.cs @@ -446,7 +446,7 @@ public class TreeView : 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 (RaiseAccepted () == true) + if (RaiseAccepting () == true) { return true; } diff --git a/Terminal.Gui/Views/Wizard/Wizard.cs b/Terminal.Gui/Views/Wizard/Wizard.cs index 3d78b27bf..6c9fe55c1 100644 --- a/Terminal.Gui/Views/Wizard/Wizard.cs +++ b/Terminal.Gui/Views/Wizard/Wizard.cs @@ -85,8 +85,8 @@ public class Wizard : Dialog AddButton (BackButton); AddButton (NextFinishButton); - BackButton.Accepted += BackBtn_Clicked; - NextFinishButton.Accepted += NextfinishBtn_Clicked; + BackButton.Accepting += BackBtn_Clicked; + NextFinishButton.Accepting += NextfinishBtn_Clicked; Loaded += Wizard_Loaded; Closing += Wizard_Closing; diff --git a/UICatalog/KeyBindingsDialog.cs b/UICatalog/KeyBindingsDialog.cs index fa2a2dc74..1667d0729 100644 --- a/UICatalog/KeyBindingsDialog.cs +++ b/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.Accepted += RemapKey; + btnChange.Accepting += RemapKey; var close = new Button { Text = "Ok" }; - close.Accepted += (s, e) => + close.Accepting += (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.Accepted += (s, e) => Application.RequestStop (); + cancel.Accepting += (s, e) => Application.RequestStop (); AddButton (cancel); // Register event handler as the last thing in constructor to prevent early calls diff --git a/UICatalog/Scenarios/ASCIICustomButton.cs b/UICatalog/Scenarios/ASCIICustomButton.cs index cae55f17a..3ed5f7776 100644 --- a/UICatalog/Scenarios/ASCIICustomButton.cs +++ b/UICatalog/Scenarios/ASCIICustomButton.cs @@ -198,7 +198,7 @@ public class ASCIICustomButtonTest : Scenario Height = BUTTON_HEIGHT }; button.Initialized += Button_Initialized; - button.Accepted += Button_Clicked; + button.Accepting += 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.Accepted += Button_Clicked; + closeButton.Accepting += Button_Clicked; closeButton.PointerEnter += Button_PointerEnter; closeButton.MouseClick += Button_MouseClick; closeButton.KeyDown += Button_KeyPress; diff --git a/UICatalog/Scenarios/AdornmentEditor.cs b/UICatalog/Scenarios/AdornmentEditor.cs index 5c438cf17..dfa6f2407 100644 --- a/UICatalog/Scenarios/AdornmentEditor.cs +++ b/UICatalog/Scenarios/AdornmentEditor.cs @@ -146,7 +146,7 @@ public class AdornmentEditor : View Enabled = false }; - copyTop.Accepted += (s, e) => + copyTop.Accepting += (s, e) => { AdornmentToEdit.Thickness = new (_topEdit.Value); _leftEdit.Value = _rightEdit.Value = _bottomEdit.Value = _topEdit.Value; diff --git a/UICatalog/Scenarios/Adornments.cs b/UICatalog/Scenarios/Adornments.cs index 5cba724b4..48e5211ef 100644 --- a/UICatalog/Scenarios/Adornments.cs +++ b/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.Accepted += (s, e) => + button.Accepting += (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.Accepted += (s, e) => MessageBox.Query (20, 7, "TextField", textFieldInPadding.Text, "Ok"); + textFieldInPadding.Accepting += (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.Accepted += (s, e) => MessageBox.Query (20, 7, "Hi", "Button in Padding Pressed!", "Ok"); + btnButtonInPadding.Accepting += (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); diff --git a/UICatalog/Scenarios/AllViewsTester.cs b/UICatalog/Scenarios/AllViewsTester.cs index 1d6016d5c..d9635dd5c 100644 --- a/UICatalog/Scenarios/AllViewsTester.cs +++ b/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.Accepted += (s, args) => + _xText.Accepting += (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.Accepted += (s, args) => + _yText.Accepting += (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.Accepted += (s, args) => + _wText.Accepting += (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.Accepted += (s, args) => + _hText.Accepting += (s, args) => { try { diff --git a/UICatalog/Scenarios/Bars.cs b/UICatalog/Scenarios/Bars.cs index 1bbac3890..63fdbd85f 100644 --- a/UICatalog/Scenarios/Bars.cs +++ b/UICatalog/Scenarios/Bars.cs @@ -168,7 +168,7 @@ public class Bars : Scenario }; popOverMenu.Add (toggleShortcut); - popOverMenu.Accepted += PopOverMenuOnAccept; + popOverMenu.Accepting += PopOverMenuOnAccept; void PopOverMenuOnAccept (object o, CommandEventArgs args) { @@ -255,7 +255,7 @@ public class Bars : Scenario { foreach (Shortcut sh in barView.Subviews.Where (s => s is Shortcut)!) { - sh.Accepted += (o, args) => + sh.Accepting += (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.Accepted += Button_Clicked; + button1.Accepting += Button_Clicked; bar.Add (button1); - shortcut.Accepted += (s, e) => + shortcut.Accepting += (s, e) => { button1.Visible = !button1.Visible; button1.Enabled = button1.Visible; @@ -543,7 +543,7 @@ public class Bars : Scenario { Text = "Or me!", }; - button2.Accepted += (s, e) => Application.RequestStop (); + button2.Accepting += (s, e) => Application.RequestStop (); bar.Add (button2); diff --git a/UICatalog/Scenarios/Buttons.cs b/UICatalog/Scenarios/Buttons.cs index dc93271e9..4cafab5be 100644 --- a/UICatalog/Scenarios/Buttons.cs +++ b/UICatalog/Scenarios/Buttons.cs @@ -36,7 +36,7 @@ public class Buttons : Scenario main.Add (defaultButton); // Note we handle Accept on main, not defaultButton - main.Accepted += (s, e) => Application.RequestStop (); + main.Accepting += (s, e) => Application.RequestStop (); var swapButton = new Button { @@ -47,14 +47,14 @@ public class Buttons : Scenario ColorScheme = Colors.ColorSchemes ["Error"] }; - swapButton.Accepted += (s, e) => + swapButton.Accepting += (s, e) => { e.Cancel = !swapButton.IsDefault; defaultButton.IsDefault = !defaultButton.IsDefault; swapButton.IsDefault = !swapButton.IsDefault; }; - defaultButton.Accepted += (s, e) => + defaultButton.Accepting += (s, e) => { e.Cancel = !defaultButton.IsDefault; @@ -67,7 +67,7 @@ public class Buttons : Scenario static void DoMessage (Button button, string txt) { - button.Accepted += (s, e) => + button.Accepting += (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.Accepted += (s, e) => + button.Accepting += (s, e) => { MessageBox.Query ("Message", "Question?", "Yes", "No"); e.Cancel = 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.Accepted += (s, e) => + textChanger.Accepting += (s, e) => { textChanger.Text += "!"; e.Cancel = true; @@ -133,7 +133,7 @@ public class Buttons : Scenario Text = "Lets see if this will move as \"Text Changer\" grows" } ); - button.Accepted += (sender, args) => { args.Cancel = true; }; + button.Accepting += (sender, args) => { args.Cancel = 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.Accepted += (s, e) => + removeButton.Accepting += (s, e) => { removeButton.Visible = false; e.Cancel = true; @@ -169,7 +169,7 @@ public class Buttons : Scenario Text = "Move This \u263b Button v_ia Pos" }; - moveBtn.Accepted += (s, e) => + moveBtn.Accepting += (s, e) => { moveBtn.X = moveBtn.Frame.X + 5; e.Cancel = true; @@ -186,7 +186,7 @@ public class Buttons : Scenario ColorScheme = Colors.ColorSchemes ["Error"], }; - sizeBtn.Accepted += (s, e) => + sizeBtn.Accepting += (s, e) => { sizeBtn.Width = sizeBtn.Frame.Width + 5; e.Cancel = 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.Accepted += (s, e) => + moveBtnA.Accepting += (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.Accepted += (s, e) => + sizeBtnA.Accepting += (s, e) => { sizeBtnA.Frame = new ( sizeBtnA.Frame.X, @@ -297,7 +297,7 @@ public class Buttons : Scenario ColorScheme = Colors.ColorSchemes ["TopLevel"], Text = mhkb }; - moveHotKeyBtn.Accepted += (s, e) => + moveHotKeyBtn.Accepting += (s, e) => { moveHotKeyBtn.Text = MoveHotkey (moveHotKeyBtn.Text); e.Cancel = true; @@ -314,7 +314,7 @@ public class Buttons : Scenario ColorScheme = Colors.ColorSchemes ["TopLevel"], Text = muhkb }; - moveUnicodeHotKeyBtn.Accepted += (s, e) => + moveUnicodeHotKeyBtn.Accepting += (s, e) => { moveUnicodeHotKeyBtn.Text = MoveHotkey (moveUnicodeHotKeyBtn.Text); e.Cancel = true; @@ -398,7 +398,7 @@ public class Buttons : Scenario Title = $"Accept Cou_nt: {noRepeatAcceptCount}", WantContinuousButtonPressed = false }; - noRepeatButton.Accepted += (s, e) => + noRepeatButton.Accepting += (s, e) => { noRepeatButton.Title = $"Accept Cou_nt: {++noRepeatAcceptCount}"; e.Cancel = true; @@ -420,7 +420,7 @@ public class Buttons : Scenario Title = $"Accept Co_unt: {acceptCount}", WantContinuousButtonPressed = true }; - repeatButton.Accepted += (s, e) => + repeatButton.Accepting += (s, e) => { repeatButton.Title = $"Accept Co_unt: {++acceptCount}"; e.Cancel = true; diff --git a/UICatalog/Scenarios/CharacterMap.cs b/UICatalog/Scenarios/CharacterMap.cs index b06377cb9..5e246f9df 100644 --- a/UICatalog/Scenarios/CharacterMap.cs +++ b/UICatalog/Scenarios/CharacterMap.cs @@ -77,7 +77,7 @@ public class CharacterMap : Scenario }; top.Add (_errorLabel); - jumpEdit.Accepted += JumpEditOnAccept; + jumpEdit.Accepting += 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.Accepted += (sender, args) => { args.Cancel = ScrollVertical (-1) == true; }; + up.Accepting += (sender, args) => { args.Cancel = ScrollVertical (-1) == true; }; var down = new Button { @@ -492,7 +492,7 @@ internal class CharMap : View ShadowStyle = ShadowStyle.None, CanFocus = false }; - down.Accepted += (sender, args) => { ScrollVertical (1); }; + down.Accepting += (sender, args) => { ScrollVertical (1); }; var left = new Button { @@ -507,7 +507,7 @@ internal class CharMap : View ShadowStyle = ShadowStyle.None, CanFocus = false }; - left.Accepted += (sender, args) => { ScrollHorizontal (-1); }; + left.Accepting += (sender, args) => { ScrollHorizontal (-1); }; var right = new Button { @@ -522,7 +522,7 @@ internal class CharMap : View ShadowStyle = ShadowStyle.None, CanFocus = false }; - right.Accepted += (sender, args) => { ScrollHorizontal (1); }; + right.Accepting += (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.Accepted += (s, a) => + copyGlyph.Accepting += (s, a) => { CopyGlyph (); dlg.RequestStop (); }; - copyCP.Accepted += (s, a) => + copyCP.Accepting += (s, a) => { CopyCodePoint (); dlg.RequestStop (); }; - cancel.Accepted += (s, a) => dlg.RequestStop (); + cancel.Accepting += (s, a) => dlg.RequestStop (); var rune = (Rune)SelectedCodePoint; var label = new Label { Text = "IsAscii: ", X = 0, Y = 0 }; diff --git a/UICatalog/Scenarios/ChineseUI.cs b/UICatalog/Scenarios/ChineseUI.cs index a58cde062..0cc91ca4f 100644 --- a/UICatalog/Scenarios/ChineseUI.cs +++ b/UICatalog/Scenarios/ChineseUI.cs @@ -31,7 +31,7 @@ public class ChineseUI : Scenario var btn = new Button { X = 1, Y = 1, Text = "你" }; // v1: A - btn.Accepted += (s, e) => + btn.Accepting += (s, e) => { int result = MessageBox.Query ( "Confirm", diff --git a/UICatalog/Scenarios/Clipping.cs b/UICatalog/Scenarios/Clipping.cs index 218be567d..fe0692fc9 100644 --- a/UICatalog/Scenarios/Clipping.cs +++ b/UICatalog/Scenarios/Clipping.cs @@ -70,7 +70,7 @@ public class Clipping : Scenario }; var testButton = new Button { X = 2, Y = 2, Text = "click me" }; - testButton.Accepted += (s, e) => { MessageBox.Query (10, 5, "Test", "test message", "Ok"); }; + testButton.Accepting += (s, e) => { MessageBox.Query (10, 5, "Test", "test message", "Ok"); }; embedded3.Add (testButton); embedded2.Add (embedded3); diff --git a/UICatalog/Scenarios/ComboBoxIteration.cs b/UICatalog/Scenarios/ComboBoxIteration.cs index c579a1260..a0201daf6 100644 --- a/UICatalog/Scenarios/ComboBoxIteration.cs +++ b/UICatalog/Scenarios/ComboBoxIteration.cs @@ -60,7 +60,7 @@ public class ComboBoxIteration : Scenario var btnTwo = new Button { X = Pos.Right (comboBox) + 1, Text = "Two" }; - btnTwo.Accepted += (s, e) => + btnTwo.Accepting += (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.Accepted += (s, e) => + btnThree.Accepting += (s, e) => { items =["one", "two", "three"]; comboBox.SetSource (items); diff --git a/UICatalog/Scenarios/ComputedLayout.cs b/UICatalog/Scenarios/ComputedLayout.cs index 9a0392d63..bdf10337c 100644 --- a/UICatalog/Scenarios/ComputedLayout.cs +++ b/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.Accepted += (s, e) => + anchorButton.Accepting += (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.Accepted += (s, e) => + leftButton.Accepting += (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.Accepted += (s, e) => + centerButton.Accepting += (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.Accepted += (s, e) => + rightButton.Accepting += (s, e) => { // This demonstrates how to have a dynamically sized button // Each time the button is clicked the button's text gets longer diff --git a/UICatalog/Scenarios/ConfigurationEditor.cs b/UICatalog/Scenarios/ConfigurationEditor.cs index 5bace1fad..2c898ac8b 100644 --- a/UICatalog/Scenarios/ConfigurationEditor.cs +++ b/UICatalog/Scenarios/ConfigurationEditor.cs @@ -70,7 +70,7 @@ public class ConfigurationEditor : Scenario Key = Key.F5.WithShift, Title = "Reload", }; - reloadShortcut.Accepted += (s, e) => { Reload (); }; + reloadShortcut.Accepting += (s, e) => { Reload (); }; var saveShortcut = new Shortcut () { diff --git a/UICatalog/Scenarios/ContentScrolling.cs b/UICatalog/Scenarios/ContentScrolling.cs index 38ed73227..028717fcd 100644 --- a/UICatalog/Scenarios/ContentScrolling.cs +++ b/UICatalog/Scenarios/ContentScrolling.cs @@ -362,7 +362,7 @@ public class ContentScrolling : Scenario Height = Dim.Auto (DimAutoStyle.Content, maximumContentDim: Dim.Percent (20)), }; - charMap.Accepted += (s, e) => + charMap.Accepting += (s, e) => MessageBox.Query (20, 7, "Hi", $"Am I a {view.GetType ().Name}?", "Yes", "No"); var buttonAnchored = new Button diff --git a/UICatalog/Scenarios/CsvEditor.cs b/UICatalog/Scenarios/CsvEditor.cs index 42c48688c..a931f3e76 100644 --- a/UICatalog/Scenarios/CsvEditor.cs +++ b/UICatalog/Scenarios/CsvEditor.cs @@ -304,13 +304,13 @@ public class CsvEditor : Scenario var ok = new Button { Text = "Ok", IsDefault = true }; - ok.Accepted += (s, e) => + ok.Accepting += (s, e) => { okPressed = true; Application.RequestStop (); }; var cancel = new Button { Text = "Cancel" }; - cancel.Accepted += (s, e) => { Application.RequestStop (); }; + cancel.Accepting += (s, e) => { Application.RequestStop (); }; var d = new Dialog { Title = title, Buttons = [ok, cancel] }; var lbl = new Label { X = 0, Y = 1, Text = label }; diff --git a/UICatalog/Scenarios/Dialogs.cs b/UICatalog/Scenarios/Dialogs.cs index df1991aed..5ad240efb 100644 --- a/UICatalog/Scenarios/Dialogs.cs +++ b/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.Accepted += (s, e) => + app.Accepting += (s, e) => { Dialog dlg = CreateDemoDialog ( widthEdit, @@ -255,7 +255,7 @@ public class Dialogs : Scenario button = new () { Text = NumberToWords.Convert (buttonId), IsDefault = buttonId == 0 }; } - button.Accepted += (s, e) => + button.Accepting += (s, e) => { clicked = buttonId; Application.RequestStop (); @@ -290,7 +290,7 @@ public class Dialogs : Scenario Text = "_Add a button" }; - add.Accepted += (s, e) => + add.Accepting += (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.Accepted += (s, e) => + button.Accepting += (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.Accepted += (s, e) => + addChar.Accepting += (s, e) => { foreach (Button button in buttons) { diff --git a/UICatalog/Scenarios/DimAutoDemo.cs b/UICatalog/Scenarios/DimAutoDemo.cs index e57a859b4..9f5cf3fa9 100644 --- a/UICatalog/Scenarios/DimAutoDemo.cs +++ b/UICatalog/Scenarios/DimAutoDemo.cs @@ -156,7 +156,7 @@ public class DimAutoDemo : Scenario Y = Pos.AnchorEnd () }; - resetButton.Accepted += (s, e) => + resetButton.Accepting += (s, e) => { //movingButton.Y = Pos.Bottom (hlabel); //movingButton.X = 0; diff --git a/UICatalog/Scenarios/DynamicMenuBar.cs b/UICatalog/Scenarios/DynamicMenuBar.cs index fc591ce1a..dc7d91b9f 100644 --- a/UICatalog/Scenarios/DynamicMenuBar.cs +++ b/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.Accepted += (s, e) => { TextShortcutKey.Text = ""; }; + btnShortcut.Accepting += (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.Accepted += (s, e) => + btnOk.Accepting += (s, e) => { if (string.IsNullOrEmpty (TextTitle.Text)) { @@ -407,7 +407,7 @@ public class DynamicMenuBar : Scenario }; var btnCancel = new Button { Text = "Cancel" }; - btnCancel.Accepted += (s, e) => + btnCancel.Accepting += (s, e) => { TextTitle.Text = string.Empty; Application.RequestStop (); @@ -666,7 +666,7 @@ public class DynamicMenuBar : Scenario }; Add (frmMenuDetails); - btnMenuBarUp.Accepted += (s, e) => + btnMenuBarUp.Accepting += (s, e) => { int i = _currentSelectedMenuBar; @@ -688,7 +688,7 @@ public class DynamicMenuBar : Scenario } }; - btnMenuBarDown.Accepted += (s, e) => + btnMenuBarDown.Accepting += (s, e) => { int i = _currentSelectedMenuBar; @@ -710,7 +710,7 @@ public class DynamicMenuBar : Scenario } }; - btnUp.Accepted += (s, e) => + btnUp.Accepting += (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.Accepted += (s, e) => + btnDown.Accepting += (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.Accepted += (s, e) => + btnPreviowsParent.Accepting += (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.Accepted += (s, e) => { SetFrameDetails (_currentEditMenuBarItem); }; + btnCancel.Accepting += (s, e) => { SetFrameDetails (_currentEditMenuBarItem); }; Add (btnCancel); txtDelimiter.TextChanging += (s, e) => @@ -813,7 +813,7 @@ public class DynamicMenuBar : Scenario _lstMenus.SelectedItemChanged += (s, e) => { SetFrameDetails (); }; - btnOk.Accepted += (s, e) => + btnOk.Accepting += (s, e) => { if (string.IsNullOrEmpty (frmMenuDetails.TextTitle.Text) && _currentEditMenuBarItem != null) { @@ -840,7 +840,7 @@ public class DynamicMenuBar : Scenario } }; - btnAdd.Accepted += (s, e) => + btnAdd.Accepting += (s, e) => { if (MenuBar == null) { @@ -883,7 +883,7 @@ public class DynamicMenuBar : Scenario } }; - btnRemove.Accepted += (s, e) => + btnRemove.Accepting += (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.Accepted += (s, e) => + btnNext.Accepting += (s, e) => { if (_menuBar != null && _currentSelectedMenuBar + 1 < _menuBar.Menus.Length) { @@ -961,7 +961,7 @@ public class DynamicMenuBar : Scenario SelectCurrentMenuBarItem (); }; - btnPrevious.Accepted += (s, e) => + btnPrevious.Accepting += (s, e) => { if (_currentSelectedMenuBar - 1 > -1) { @@ -980,7 +980,7 @@ public class DynamicMenuBar : Scenario } }; - btnAddMenuBar.Accepted += (s, e) => + btnAddMenuBar.Accepting += (s, e) => { var frameDetails = new DynamicMenuBarDetails (null); DynamicMenuItem item = frameDetails.EnterMenuItem (); @@ -1015,7 +1015,7 @@ public class DynamicMenuBar : Scenario _menuBar.SetNeedsDisplay (); }; - btnRemoveMenuBar.Accepted += (s, e) => + btnRemoveMenuBar.Accepting += (s, e) => { if (_menuBar == null) { diff --git a/UICatalog/Scenarios/DynamicStatusBar.cs b/UICatalog/Scenarios/DynamicStatusBar.cs index b0a8417cd..a7d619e40 100644 --- a/UICatalog/Scenarios/DynamicStatusBar.cs +++ b/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.Accepted += (s, e) => { TextShortcut.Text = ""; }; + _btnShortcut.Accepting += (s, e) => { TextShortcut.Text = ""; }; Add (_btnShortcut); } @@ -181,7 +181,7 @@ public class DynamicStatusBar : Scenario var btnOk = new Button { IsDefault = true, Text = "OK" }; - btnOk.Accepted += (s, e) => + btnOk.Accepting += (s, e) => { if (string.IsNullOrEmpty (TextTitle.Text)) { @@ -196,7 +196,7 @@ public class DynamicStatusBar : Scenario }; var btnCancel = new Button { Text = "Cancel" }; - btnCancel.Accepted += (s, e) => + btnCancel.Accepting += (s, e) => { TextTitle.Text = string.Empty; Application.RequestStop (); @@ -311,7 +311,7 @@ public class DynamicStatusBar : Scenario }; Add (_frmStatusBarDetails); - _btnUp.Accepted += (s, e) => + _btnUp.Accepting += (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.Accepted += (s, e) => + _btnDown.Accepting += (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.Accepted += (s, e) => { SetFrameDetails (_currentEditStatusItem); }; + _btnCancel.Accepting += (s, e) => { SetFrameDetails (_currentEditStatusItem); }; Add (_btnCancel); _lstItems.SelectedItemChanged += (s, e) => { SetFrameDetails (); }; - _btnOk.Accepted += (s, e) => + _btnOk.Accepting += (s, e) => { if (string.IsNullOrEmpty (_frmStatusBarDetails.TextTitle.Text) && _currentEditStatusItem != null) { @@ -388,7 +388,7 @@ public class DynamicStatusBar : Scenario } }; - _btnAdd.Accepted += (s, e) => + _btnAdd.Accepting += (s, e) => { if (StatusBar == null) { @@ -418,7 +418,7 @@ public class DynamicStatusBar : Scenario SetFrameDetails (); }; - _btnRemove.Accepted += (s, e) => + _btnRemove.Accepting += (s, e) => { Shortcut statusItem = DataContext.Items.Count > 0 ? DataContext.Items [_lstItems.SelectedItem].Shortcut @@ -448,7 +448,7 @@ public class DynamicStatusBar : Scenario SetFrameDetails (statusItem); }; - _btnAddStatusBar.Accepted += (s, e) => + _btnAddStatusBar.Accepting += (s, e) => { if (_statusBar != null) { @@ -459,7 +459,7 @@ public class DynamicStatusBar : Scenario Add (_statusBar); }; - _btnRemoveStatusBar.Accepted += (s, e) => + _btnRemoveStatusBar.Accepting += (s, e) => { if (_statusBar == null) { diff --git a/UICatalog/Scenarios/Editor.cs b/UICatalog/Scenarios/Editor.cs index f5581b275..69ab13276 100644 --- a/UICatalog/Scenarios/Editor.cs +++ b/UICatalog/Scenarios/Editor.cs @@ -872,7 +872,7 @@ public class Editor : Scenario Text = "Find _Next" }; - btnFindNext.Accepted += (s, e) => FindNext (); + btnFindNext.Accepting += (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.Accepted += (s, e) => FindPrevious (); + btnFindPrevious.Accepting += (s, e) => FindPrevious (); d.Add (btnFindPrevious); txtToFind.TextChanged += (s, e) => @@ -1099,7 +1099,7 @@ public class Editor : Scenario IsDefault = true, Text = "Replace _Next" }; - btnFindNext.Accepted += (s, e) => ReplaceNext (); + btnFindNext.Accepting += (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.Accepted += (s, e) => ReplacePrevious (); + btnFindPrevious.Accepting += (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.Accepted += (s, e) => ReplaceAll (); + btnReplaceAll.Accepting += (s, e) => ReplaceAll (); d.Add (btnReplaceAll); txtToFind.TextChanged += (s, e) => diff --git a/UICatalog/Scenarios/FileDialogExamples.cs b/UICatalog/Scenarios/FileDialogExamples.cs index da6ac9b11..4fcbbcd2f 100644 --- a/UICatalog/Scenarios/FileDialogExamples.cs +++ b/UICatalog/Scenarios/FileDialogExamples.cs @@ -125,7 +125,7 @@ public class FileDialogExamples : Scenario var btn = new Button { X = 1, Y = 9, IsDefault = true, Text = "Run Dialog" }; - win.Accepted += (s, e) => + win.Accepting += (s, e) => { try { diff --git a/UICatalog/Scenarios/GraphViewExample.cs b/UICatalog/Scenarios/GraphViewExample.cs index f112c41c0..cafd6d0d7 100644 --- a/UICatalog/Scenarios/GraphViewExample.cs +++ b/UICatalog/Scenarios/GraphViewExample.cs @@ -185,7 +185,7 @@ public class GraphViewExample : Scenario CanFocus = false } }; - statusBar.Add (diagShortcut).Accepted += DiagShortcut_Accept; + statusBar.Add (diagShortcut).Accepting += DiagShortcut_Accept; _graphs [_currentGraph++ % _graphs.Length] (); diff --git a/UICatalog/Scenarios/Images.cs b/UICatalog/Scenarios/Images.cs index c48604c02..87ec38984 100644 --- a/UICatalog/Scenarios/Images.cs +++ b/UICatalog/Scenarios/Images.cs @@ -55,7 +55,7 @@ public class Images : Scenario }; win.Add (imageView); - btnOpenImage.Accepted += (_, _) => + btnOpenImage.Accepting += (_, _) => { var ofd = new OpenDialog { Title = "Open Image", AllowsMultipleSelection = false }; Application.Run (ofd); diff --git a/UICatalog/Scenarios/InteractiveTree.cs b/UICatalog/Scenarios/InteractiveTree.cs index 595b3b994..6cbcd7e76 100644 --- a/UICatalog/Scenarios/InteractiveTree.cs +++ b/UICatalog/Scenarios/InteractiveTree.cs @@ -82,13 +82,13 @@ public class InteractiveTree : Scenario var ok = new Button { Text = "Ok", IsDefault = true }; - ok.Accepted += (s, e) => + ok.Accepting += (s, e) => { okPressed = true; Application.RequestStop (); }; var cancel = new Button { Text = "Cancel" }; - cancel.Accepted += (s, e) => Application.RequestStop (); + cancel.Accepting += (s, e) => Application.RequestStop (); var d = new Dialog { Title = title, Buttons = [ok, cancel] }; var lbl = new Label { X = 0, Y = 1, Text = label }; diff --git a/UICatalog/Scenarios/InvertColors.cs b/UICatalog/Scenarios/InvertColors.cs index f059aa434..de093909d 100644 --- a/UICatalog/Scenarios/InvertColors.cs +++ b/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.Accepted += (s, e) => + button.Accepting += (s, e) => { foreach (Label label in labels) { diff --git a/UICatalog/Scenarios/LineDrawing.cs b/UICatalog/Scenarios/LineDrawing.cs index 63cb9521b..71f99f64b 100644 --- a/UICatalog/Scenarios/LineDrawing.cs +++ b/UICatalog/Scenarios/LineDrawing.cs @@ -147,7 +147,7 @@ public class LineDrawing : Scenario IsDefault = true }; - btnOk.Accepted += (s, e) => + btnOk.Accepting += (s, e) => { accept = true; e.Cancel = true; @@ -162,7 +162,7 @@ public class LineDrawing : Scenario Width = Dim.Auto () }; - btnCancel.Accepted += (s, e) => + btnCancel.Accepting += (s, e) => { e.Cancel = true; Application.RequestStop (); @@ -228,7 +228,7 @@ public class ToolsView : Window _addLayerBtn = new() { Text = "New Layer", X = Pos.Center (), Y = Pos.Bottom (_stylePicker) }; - _addLayerBtn.Accepted += (s, a) => AddLayer?.Invoke (); + _addLayerBtn.Accepting += (s, a) => AddLayer?.Invoke (); Add (_colors, _stylePicker, _addLayerBtn); } diff --git a/UICatalog/Scenarios/ListColumns.cs b/UICatalog/Scenarios/ListColumns.cs index 6f1d49eae..7648b1eb3 100644 --- a/UICatalog/Scenarios/ListColumns.cs +++ b/UICatalog/Scenarios/ListColumns.cs @@ -275,13 +275,13 @@ public class ListColumns : Scenario var accepted = false; var ok = new Button { Text = "Ok", IsDefault = true }; - ok.Accepted += (s, e) => + ok.Accepting += (s, e) => { accepted = true; Application.RequestStop (); }; var cancel = new Button { Text = "Cancel" }; - cancel.Accepted += (s, e) => { Application.RequestStop (); }; + cancel.Accepting += (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 () }; diff --git a/UICatalog/Scenarios/ListViewWithSelection.cs b/UICatalog/Scenarios/ListViewWithSelection.cs index cb20a2a98..4025fc623 100644 --- a/UICatalog/Scenarios/ListViewWithSelection.cs +++ b/UICatalog/Scenarios/ListViewWithSelection.cs @@ -139,7 +139,7 @@ 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.Accepted += (s, a) => LogEvent (s as View, a, "Accept"); + _listView.Accepting += (s, a) => LogEvent (s as View, a, "Accept"); _listView.Selecting += (s, a) => LogEvent (s as View, a, "Select"); bool? LogEvent (View sender, EventArgs args, string message) diff --git a/UICatalog/Scenarios/ListsAndCombos.cs b/UICatalog/Scenarios/ListsAndCombos.cs index 8baac6c71..8c76a887a 100644 --- a/UICatalog/Scenarios/ListsAndCombos.cs +++ b/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.Accepted += (s, e) => { listview.MoveUp (); }; + btnMoveUp.Accepting += (s, e) => { listview.MoveUp (); }; var btnMoveDown = new Button { X = Pos.Right (btnMoveUp) + 1, Y = Pos.Bottom (lbListView), Text = "Move _Down" }; - btnMoveDown.Accepted += (s, e) => { listview.MoveDown (); }; + btnMoveDown.Accepting += (s, e) => { listview.MoveDown (); }; win.Add (btnMoveUp, btnMoveDown); diff --git a/UICatalog/Scenarios/Localization.cs b/UICatalog/Scenarios/Localization.cs index a95a920d0..3386dc3bd 100644 --- a/UICatalog/Scenarios/Localization.cs +++ b/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.Accepted += (sender, e) => ShowFileDialog (false); + openDialogButton.Accepting += (sender, e) => ShowFileDialog (false); win.Add (openDialogButton); var saveDialogButton = new Button { X = Pos.Right (openDialogButton) + 1, Y = Pos.Bottom (textAndFileDialogLabel) + 1, Text = "Save" }; - saveDialogButton.Accepted += (sender, e) => ShowFileDialog (true); + saveDialogButton.Accepting += (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.Accepted += (sender, e) => ShowWizard (); + wizardButton.Accepting += (sender, e) => ShowWizard (); win.Add (wizardButton); win.Unloaded += (sender, e) => Quit (); diff --git a/UICatalog/Scenarios/MenuBarScenario.cs b/UICatalog/Scenarios/MenuBarScenario.cs index 1a6065307..6e9dc1097 100644 --- a/UICatalog/Scenarios/MenuBarScenario.cs +++ b/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.Accepted += (s, e) => { menuBar.OpenMenu (); }; + openBtn.Accepting += (s, e) => { menuBar.OpenMenu (); }; appWindow.Add (openBtn); var hideBtn = new Button { X = Pos.Center (), Y = Pos.Bottom (openBtn), Text = "Toggle Menu._Visible" }; - hideBtn.Accepted += (s, e) => { menuBar.Visible = !menuBar.Visible; }; + hideBtn.Accepting += (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.Accepted += (s, e) => { menuBar.Enabled = !menuBar.Enabled; }; + enableBtn.Accepting += (s, e) => { menuBar.Enabled = !menuBar.Enabled; }; appWindow.Add (enableBtn); appWindow.Add (menuBar); diff --git a/UICatalog/Scenarios/MessageBoxes.cs b/UICatalog/Scenarios/MessageBoxes.cs index 993e5b270..833e98640 100644 --- a/UICatalog/Scenarios/MessageBoxes.cs +++ b/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.Accepted += (s, e) => + app.Accepting += (s, e) => { try { diff --git a/UICatalog/Scenarios/Mouse.cs b/UICatalog/Scenarios/Mouse.cs index 988115e88..0b07c48e3 100644 --- a/UICatalog/Scenarios/Mouse.cs +++ b/UICatalog/Scenarios/Mouse.cs @@ -241,7 +241,7 @@ public class Mouse : Scenario }; win.Add (label, winLog); - clearButton.Accepted += (s, e) => + clearButton.Accepting += (s, e) => { appLogList.Clear (); appLog.SetSource (appLogList); diff --git a/UICatalog/Scenarios/MultiColouredTable.cs b/UICatalog/Scenarios/MultiColouredTable.cs index ecacb1899..6f10e65cd 100644 --- a/UICatalog/Scenarios/MultiColouredTable.cs +++ b/UICatalog/Scenarios/MultiColouredTable.cs @@ -104,13 +104,13 @@ public class MultiColouredTable : Scenario var ok = new Button { Text = "Ok", IsDefault = true }; - ok.Accepted += (s, e) => + ok.Accepting += (s, e) => { okPressed = true; Application.RequestStop (); }; var cancel = new Button { Text = "Cancel" }; - cancel.Accepted += (s, e) => { Application.RequestStop (); }; + cancel.Accepting += (s, e) => { Application.RequestStop (); }; var d = new Dialog { Title = title, Buttons = [ok, cancel] }; var lbl = new Label { X = 0, Y = 1, Text = label }; diff --git a/UICatalog/Scenarios/NumericUpDownDemo.cs b/UICatalog/Scenarios/NumericUpDownDemo.cs index 6d23714c7..8363ad4b4 100644 --- a/UICatalog/Scenarios/NumericUpDownDemo.cs +++ b/UICatalog/Scenarios/NumericUpDownDemo.cs @@ -114,7 +114,7 @@ internal class NumericUpDownEditor : View where T : notnull Width = 8, Title = "Value", }; - _value.Accepted += ValuedOnAccept; + _value.Accepting += ValuedOnAccept; void ValuedOnAccept (object? sender, EventArgs e) { @@ -169,7 +169,7 @@ internal class NumericUpDownEditor : View where T : notnull Title = "Format", Width = Dim.Width (_value), }; - _format.Accepted += FormatOnAccept; + _format.Accepting += FormatOnAccept; void FormatOnAccept (object? o, EventArgs eventArgs) { @@ -217,7 +217,7 @@ internal class NumericUpDownEditor : View where T : notnull Width = Dim.Width (_value), }; - _increment.Accepted += IncrementOnAccept; + _increment.Accepting += IncrementOnAccept; void IncrementOnAccept (object? o, EventArgs eventArgs) { diff --git a/UICatalog/Scenarios/Progress.cs b/UICatalog/Scenarios/Progress.cs index 4a107172f..174ca266c 100644 --- a/UICatalog/Scenarios/Progress.cs +++ b/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.Accepted += (s, e) => + startBoth.Accepting += (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.Accepted += (s, e) => Start (); + startButton.Accepting += (s, e) => Start (); var pulseButton = new Button { X = Pos.Right (startButton) + 2, Y = Pos.Y (startButton), Text = "Pulse" }; - pulseButton.Accepted += (s, e) => Pulse (); + pulseButton.Accepting += (s, e) => Pulse (); var stopbutton = new Button { X = Pos.Right (pulseButton) + 2, Y = Pos.Top (pulseButton), Text = "Stop Timer" }; - stopbutton.Accepted += (s, e) => Stop (); + stopbutton.Accepting += (s, e) => Stop (); Add (startButton); Add (pulseButton); diff --git a/UICatalog/Scenarios/ProgressBarStyles.cs b/UICatalog/Scenarios/ProgressBarStyles.cs index a6f07a737..8a44c7d38 100644 --- a/UICatalog/Scenarios/ProgressBarStyles.cs +++ b/UICatalog/Scenarios/ProgressBarStyles.cs @@ -72,7 +72,7 @@ public class ProgressBarStyles : Scenario }; container.Add (fgColorPickerBtn); - fgColorPickerBtn.Accepted += (s, e) => + fgColorPickerBtn.Accepting += (s, e) => { if (!LineDrawing.PromptForColor ( fgColorPickerBtn.Text, @@ -102,7 +102,7 @@ public class ProgressBarStyles : Scenario }; container.Add (bgColorPickerBtn); - bgColorPickerBtn.Accepted += (s, e) => + bgColorPickerBtn.Accepting += (s, e) => { if (!LineDrawing.PromptForColor ( fgColorPickerBtn.Text, @@ -172,7 +172,7 @@ public class ProgressBarStyles : Scenario }; container.Add (continuousPB); - button.Accepted += (s, e) => + button.Accepting += (s, e) => { if (_fractionTimer == null) { diff --git a/UICatalog/Scenarios/RunTExample.cs b/UICatalog/Scenarios/RunTExample.cs index 6e6883d76..0b2020662 100644 --- a/UICatalog/Scenarios/RunTExample.cs +++ b/UICatalog/Scenarios/RunTExample.cs @@ -61,7 +61,7 @@ public class RunTExample : Scenario }; // When login button is clicked display a message popup - btnLogin.Accepted += (s, e) => + btnLogin.Accepting += (s, e) => { if (_usernameText.Text == "admin" && passwordText.Text == "password") { diff --git a/UICatalog/Scenarios/RuneWidthGreaterThanOne.cs b/UICatalog/Scenarios/RuneWidthGreaterThanOne.cs index 906f906fa..ed2e34a11 100644 --- a/UICatalog/Scenarios/RuneWidthGreaterThanOne.cs +++ b/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.Accepted += MixedMessage; + _button.Accepting += 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.Accepted += NarrowMessage; + _button.Accepting += 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.Accepted -= NarrowMessage; + _button.Accepting -= NarrowMessage; break; case "Mixed": - _button.Accepted -= MixedMessage; + _button.Accepting -= MixedMessage; break; case "Wide": - _button.Accepted -= WideMessage; + _button.Accepting -= WideMessage; break; } @@ -165,7 +165,7 @@ public class RuneWidthGreaterThanOne : Scenario _label.Text = "あなたの名前を入力してください:"; _text.Text = "ティラミス"; _button.Text = "こんにちはと言う"; - _button.Accepted += WideMessage; + _button.Accepting += WideMessage; _labelR.X = Pos.AnchorEnd (29); _labelR.Y = 18; _labelR.Text = "あなたの名前を入力してください"; diff --git a/UICatalog/Scenarios/Scrolling.cs b/UICatalog/Scenarios/Scrolling.cs index 042551f4c..fcd4cddae 100644 --- a/UICatalog/Scenarios/Scrolling.cs +++ b/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.Accepted += (s, e) => MessageBox.Query (20, 7, "MessageBox", "Neat?", "Yes", "No"); + pressMeButton.Accepting += (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.Accepted += (s, e) => MessageBox.Query (20, 7, "MessageBox", "Neat?", "Yes", "No"); + aLongButton.Accepting += (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.Accepted += (s, e) => + anchorButton.Accepting += (s, e) => { // This demonstrates how to have a dynamically sized button // Each time the button is clicked the button's text gets longer diff --git a/UICatalog/Scenarios/SendKeys.cs b/UICatalog/Scenarios/SendKeys.cs index 9ba9cf0e9..e2989b94e 100644 --- a/UICatalog/Scenarios/SendKeys.cs +++ b/UICatalog/Scenarios/SendKeys.cs @@ -100,7 +100,7 @@ public class SendKeys : Scenario txtInput.SetFocus (); } - button.Accepted += (s, e) => ProcessInput (); + button.Accepting += (s, e) => ProcessInput (); win.KeyDown += (s, e) => { diff --git a/UICatalog/Scenarios/Shortcuts.cs b/UICatalog/Scenarios/Shortcuts.cs index 105ff46ed..b0a3803e9 100644 --- a/UICatalog/Scenarios/Shortcuts.cs +++ b/UICatalog/Scenarios/Shortcuts.cs @@ -151,7 +151,7 @@ public class Shortcuts : Scenario KeyBindingScope = KeyBindingScope.HotKey, }; var button = (Button)vShortcut4.CommandView; - vShortcut4.Accepted += Button_Clicked; + vShortcut4.Accepting += Button_Clicked; Application.Top.Add (vShortcut4); @@ -348,7 +348,7 @@ public class Shortcuts : Scenario HelpText = "App Scope", CanFocus = false }; - hShortcut3.Accepted += (o, args) => + hShortcut3.Accepting += (o, args) => { Application.RequestStop (); }; @@ -380,7 +380,7 @@ public class Shortcuts : Scenario args.Cancel = true; }; - shortcut.Accepted += (o, args) => + shortcut.Accepting += (o, args) => { eventSource.Add ($"{shortcut!.Id}.Accepting: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}"); eventLog.MoveDown (); @@ -388,7 +388,7 @@ public class Shortcuts : Scenario args.Cancel = true; }; - shortcut.CommandView.Accepted += (o, args) => + shortcut.CommandView.Accepting += (o, args) => { eventSource.Add ($"{shortcut!.Id}.CommandView.Accepting: {shortcut!.CommandView.Text} {shortcut!.CommandView.GetType ().Name}"); eventLog.MoveDown (); diff --git a/UICatalog/Scenarios/SingleBackgroundWorker.cs b/UICatalog/Scenarios/SingleBackgroundWorker.cs index 9e3bdea9d..122b30f04 100644 --- a/UICatalog/Scenarios/SingleBackgroundWorker.cs +++ b/UICatalog/Scenarios/SingleBackgroundWorker.cs @@ -91,7 +91,7 @@ public class SingleBackgroundWorker : Scenario var cancel = new Button { Text = "Cancel Worker" }; - cancel.Accepted += (s, e) => + cancel.Accepting += (s, e) => { if (_worker == null) { diff --git a/UICatalog/Scenarios/Sliders.cs b/UICatalog/Scenarios/Sliders.cs index cac735624..393b9768f 100644 --- a/UICatalog/Scenarios/Sliders.cs +++ b/UICatalog/Scenarios/Sliders.cs @@ -595,7 +595,7 @@ public class Sliders : Scenario foreach (Slider slider in app.Subviews.Where (v => v is Slider)!) { - slider.Accepted += (o, args) => + slider.Accepting += (o, args) => { eventSource.Add ($"Accept: {string.Join(",", slider.GetSetOptions ())}"); eventLog.MoveDown (); diff --git a/UICatalog/Scenarios/TableEditor.cs b/UICatalog/Scenarios/TableEditor.cs index a9cd4ad0a..d127f8610 100644 --- a/UICatalog/Scenarios/TableEditor.cs +++ b/UICatalog/Scenarios/TableEditor.cs @@ -878,13 +878,13 @@ public class TableEditor : Scenario var ok = new Button { Text = "Ok", IsDefault = true }; - ok.Accepted += (s, e) => + ok.Accepting += (s, e) => { okPressed = true; Application.RequestStop (); }; var cancel = new Button { Text = "Cancel" }; - cancel.Accepted += (s, e) => { Application.RequestStop (); }; + cancel.Accepting += (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.Accepted += (s, e) => + ok.Accepting += (s, e) => { accepted = true; Application.RequestStop (); }; var cancel = new Button { Text = "Cancel" }; - cancel.Accepted += (s, e) => { Application.RequestStop (); }; + cancel.Accepting += (s, e) => { Application.RequestStop (); }; var d = new Dialog { Title = prompt, diff --git a/UICatalog/Scenarios/Text.cs b/UICatalog/Scenarios/Text.cs index 38e033a62..9c5ef0979 100644 --- a/UICatalog/Scenarios/Text.cs +++ b/UICatalog/Scenarios/Text.cs @@ -442,7 +442,7 @@ public class Text : Scenario win.Add (acceptView); - win.Accepted += WinOnAccept; + win.Accepting += WinOnAccept; Application.Run (win); win.Dispose (); diff --git a/UICatalog/Scenarios/Threading.cs b/UICatalog/Scenarios/Threading.cs index a50aa2618..e1b0653f9 100644 --- a/UICatalog/Scenarios/Threading.cs +++ b/UICatalog/Scenarios/Threading.cs @@ -56,7 +56,7 @@ public class Threading : Scenario }; _btnActionCancel = new Button { X = 1, Y = 1, Text = "Cancelable Load Items" }; - _btnActionCancel.Accepted += (s, e) => Application.Invoke (CallLoadItemsAsync); + _btnActionCancel.Accepting += (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.Accepted += (s, e) => _action.Invoke (); + btnAction.Accepting += (s, e) => _action.Invoke (); var btnLambda = new Button { X = 80, Y = 12, Text = "Load Data Lambda" }; - btnLambda.Accepted += (s, e) => _lambda.Invoke (); + btnLambda.Accepting += (s, e) => _lambda.Invoke (); var btnHandler = new Button { X = 80, Y = 14, Text = "Load Data Handler" }; - btnHandler.Accepted += (s, e) => _handler.Invoke (null, EventArgs.Empty); + btnHandler.Accepting += (s, e) => _handler.Invoke (null, EventArgs.Empty); var btnSync = new Button { X = 80, Y = 16, Text = "Load Data Synchronous" }; - btnSync.Accepted += (s, e) => _sync.Invoke (); + btnSync.Accepting += (s, e) => _sync.Invoke (); var btnMethod = new Button { X = 80, Y = 18, Text = "Load Data Method" }; - btnMethod.Accepted += async (s, e) => await MethodAsync (); + btnMethod.Accepting += async (s, e) => await MethodAsync (); var btnClearData = new Button { X = 80, Y = 20, Text = "Clear Data" }; - btnClearData.Accepted += (s, e) => + btnClearData.Accepting += (s, e) => { _itemsList.Source = null; LogJob ("Cleaning Data"); }; var btnQuit = new Button { X = 80, Y = 22, Text = "Quit" }; - btnQuit.Accepted += (s, e) => Application.RequestStop (); + btnQuit.Accepting += (s, e) => Application.RequestStop (); win.Add ( _itemsList, diff --git a/UICatalog/Scenarios/TimeAndDate.cs b/UICatalog/Scenarios/TimeAndDate.cs index 27f70e58b..a96d27651 100644 --- a/UICatalog/Scenarios/TimeAndDate.cs +++ b/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.Accepted += (s, e) => + swapButton.Accepting += (s, e) => { longTime.ReadOnly = !longTime.ReadOnly; shortTime.ReadOnly = !shortTime.ReadOnly; diff --git a/UICatalog/Scenarios/VkeyPacketSimulator.cs b/UICatalog/Scenarios/VkeyPacketSimulator.cs index d8562a697..94a8618fe 100644 --- a/UICatalog/Scenarios/VkeyPacketSimulator.cs +++ b/UICatalog/Scenarios/VkeyPacketSimulator.cs @@ -244,7 +244,7 @@ public class VkeyPacketSimulator : Scenario } }; - btnInput.Accepted += (s, e) => + btnInput.Accepting += (s, e) => { if (!tvInput.HasFocus && _keyboardStrokes.Count == 0) { @@ -252,7 +252,7 @@ public class VkeyPacketSimulator : Scenario } }; - btnOutput.Accepted += (s, e) => + btnOutput.Accepting += (s, e) => { if (!tvOutput.HasFocus && _keyboardStrokes.Count == 0) { diff --git a/UICatalog/Scenarios/WindowsAndFrameViews.cs b/UICatalog/Scenarios/WindowsAndFrameViews.cs index af351c4e5..1ec370718 100644 --- a/UICatalog/Scenarios/WindowsAndFrameViews.cs +++ b/UICatalog/Scenarios/WindowsAndFrameViews.cs @@ -52,7 +52,7 @@ public class WindowsAndFrameViews : Scenario ColorScheme = Colors.ColorSchemes ["Error"], Text = $"Padding of container is {padding}" }; - paddingButton.Accepted += (s, e) => About (); + paddingButton.Accepting += (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.Accepted += (s, e) => + pressMeButton.Accepting += (s, e) => MessageBox.ErrorQuery (loopWin.Title, "Neat?", "Yes", "No"); loopWin.Add (pressMeButton); diff --git a/UICatalog/Scenarios/WizardAsView.cs b/UICatalog/Scenarios/WizardAsView.cs index f19730ab6..f68dc4b71 100644 --- a/UICatalog/Scenarios/WizardAsView.cs +++ b/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.Accepted += (s, e) => + button.Accepting += (s, e) => { secondStep.Title = "2nd Step"; diff --git a/UICatalog/Scenarios/Wizards.cs b/UICatalog/Scenarios/Wizards.cs index c3b49f047..e26c717e8 100644 --- a/UICatalog/Scenarios/Wizards.cs +++ b/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.Accepted += (s, e) => + showWizardButton.Accepting += (s, e) => { try { @@ -193,7 +193,7 @@ public class Wizards : Scenario }; secondStep.Add (radioGroup2); - button.Accepted += (s, e) => + button.Accepting += (s, e) => { secondStep.Title = "2nd Step"; @@ -299,7 +299,7 @@ public class Wizards : Scenario Y = Pos.AnchorEnd () }; - hideHelpBtn.Accepted += (s, e) => + hideHelpBtn.Accepting += (s, e) => { if (fourthStep.HelpText.Length > 0) { diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs index b1ab2da26..310dd62ea 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -515,7 +515,7 @@ public class UICatalogApp Title = "Show/Hide Status Bar", CanFocus = false, }; - statusBarShortcut.Accepted += (sender, args) => + statusBarShortcut.Accepting += (sender, args) => { StatusBar.Visible = !StatusBar.Visible; args.Cancel = true; diff --git a/UnitTests/Application/MainLoopTests.cs b/UnitTests/Application/MainLoopTests.cs index 8b5b45fc6..d569b0d80 100644 --- a/UnitTests/Application/MainLoopTests.cs +++ b/UnitTests/Application/MainLoopTests.cs @@ -682,7 +682,7 @@ public class MainLoopTests var btnLaunch = new Button { Text = "Open Window" }; - btnLaunch.Accepted += (s, e) => action (); + btnLaunch.Accepting += (s, e) => action (); var top = new Toplevel (); top.Add (btnLaunch); @@ -918,11 +918,11 @@ public class MainLoopTests btn = new Button { Text = "Click Me" }; - btn.Accepted += RunAsyncTest; + btn.Accepting += RunAsyncTest; var totalbtn = new Button { X = Pos.Right (btn), Text = "total" }; - totalbtn.Accepted += (s, e) => { MessageBox.Query ("Count", $"Count is {total}", "Ok"); }; + totalbtn.Accepting += (s, e) => { MessageBox.Query ("Count", $"Count is {total}", "Ok"); }; startWindow.Add (btn); startWindow.Add (totalbtn); diff --git a/UnitTests/Dialogs/DialogTests.cs b/UnitTests/Dialogs/DialogTests.cs index 53b06b060..b5efdb5be 100644 --- a/UnitTests/Dialogs/DialogTests.cs +++ b/UnitTests/Dialogs/DialogTests.cs @@ -1058,18 +1058,18 @@ public class DialogTests Button btn3 = null; string expected = null; - btn1.Accepted += (s, e) => + btn1.Accepting += (s, e) => { btn2 = new () { Text = "Show Sub" }; btn3 = new () { Text = "Close" }; - btn3.Accepted += (s, e) => RequestStop (); + btn3.Accepting += (s, e) => RequestStop (); - btn2.Accepted += (s, e) => + btn2.Accepting += (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.Accepted += (s, e) => RequestStop (subDlg); + subBtn.Accepting += (s, e) => RequestStop (subDlg); Run (subDlg); }; diff --git a/UnitTests/Dialogs/MessageBoxTests.cs b/UnitTests/Dialogs/MessageBoxTests.cs index 105d3cb78..65a97951c 100644 --- a/UnitTests/Dialogs/MessageBoxTests.cs +++ b/UnitTests/Dialogs/MessageBoxTests.cs @@ -37,7 +37,7 @@ public class MessageBoxTests Button btn = Application.Navigation!.GetFocused () as Button; - btn.Accepted += (sender, e) => { btnAcceptCount++; }; + btn.Accepting += (sender, e) => { btnAcceptCount++; }; // Click Application.OnKeyDown (Key.Enter); @@ -120,7 +120,7 @@ public class MessageBoxTests Button btn = Application.Navigation!.GetFocused () as Button; - btn.Accepted += (sender, e) => { btnAcceptCount++; }; + btn.Accepting += (sender, e) => { btnAcceptCount++; }; Application.OnKeyDown (Key.Space); diff --git a/UnitTests/View/HotKeyTests.cs b/UnitTests/View/HotKeyTests.cs index 778078399..c7032347c 100644 --- a/UnitTests/View/HotKeyTests.cs +++ b/UnitTests/View/HotKeyTests.cs @@ -358,7 +358,7 @@ public class HotKeyTests }; Application.Top.Add (view); view.HandlingHotKey += (s, e) => hotKeyRaised = true; - view.Accepted += (s, e) => acceptRaised = true; + view.Accepting += (s, e) => acceptRaised = true; view.Selecting += (s, e) => selectRaised = true; Assert.Equal (KeyCode.T, view.HotKey); diff --git a/UnitTests/View/Navigation/EnabledTests.cs b/UnitTests/View/Navigation/EnabledTests.cs index f44b847ec..708977904 100644 --- a/UnitTests/View/Navigation/EnabledTests.cs +++ b/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.Accepted += (s, e) => wasClicked = !wasClicked; + button.Accepting += (s, e) => wasClicked = !wasClicked; var win = new Window { Width = Dim.Fill (), Height = Dim.Fill () }; win.Add (button); var top = new Toplevel (); diff --git a/UnitTests/View/Navigation/HasFocusTests.cs b/UnitTests/View/Navigation/HasFocusTests.cs index d54296617..072d23c71 100644 --- a/UnitTests/View/Navigation/HasFocusTests.cs +++ b/UnitTests/View/Navigation/HasFocusTests.cs @@ -80,7 +80,7 @@ public class HasFocusTests () : TestsAllViews { var wasClicked = false; var view = new Button { Text = "Click Me" }; - view.Accepted += (s, e) => wasClicked = !wasClicked; + view.Accepting += (s, e) => wasClicked = !wasClicked; view.NewKeyDownEvent (Key.Space); Assert.True (wasClicked); diff --git a/UnitTests/View/ViewCommandTests.cs b/UnitTests/View/ViewCommandTests.cs index 31b7bfe0c..3f4e89e2e 100644 --- a/UnitTests/View/ViewCommandTests.cs +++ b/UnitTests/View/ViewCommandTests.cs @@ -42,7 +42,7 @@ public class ViewCommandTests (ITestOutputHelper output) var view = new View (); var acceptInvoked = false; - view.Accepted += ViewOnAccept; + view.Accepting += 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.Accepted += ViewOnAccept; + view.Accepting += ViewOnAccept; view.InvokeCommand (Command.Accept); Assert.True (accepted); @@ -235,7 +235,7 @@ public class ViewCommandTests (ITestOutputHelper output) { CanFocus = true; - Accepted += (s, a) => + Accepting += (s, a) => { a.Cancel = HandleAccepted; AcceptedCount++; @@ -260,7 +260,7 @@ public class ViewCommandTests (ITestOutputHelper output) public bool HandleOnAccepted { get; set; } /// - protected override bool OnAccepted (CommandEventArgs args) + protected override bool OnAccepting (CommandEventArgs args) { OnAcceptedCount++; diff --git a/UnitTests/Views/AllViewsTests.cs b/UnitTests/Views/AllViewsTests.cs index 639c74f28..ccad6302f 100644 --- a/UnitTests/Views/AllViewsTests.cs +++ b/UnitTests/Views/AllViewsTests.cs @@ -117,7 +117,7 @@ public class AllViewsTests (ITestOutputHelper output) : TestsAllViews view.Selecting += (s, e) => selectingCount++; var acceptedCount = 0; - view.Accepted += (s, e) => + view.Accepting += (s, e) => { acceptedCount++; }; @@ -152,7 +152,7 @@ public class AllViewsTests (ITestOutputHelper output) : TestsAllViews view.Selecting += (s, e) => selectingCount++; var acceptedCount = 0; - view.Accepted += (s, e) => + view.Accepting += (s, e) => { acceptedCount++; }; @@ -192,7 +192,7 @@ public class AllViewsTests (ITestOutputHelper output) : TestsAllViews view.Selecting += (s, e) => selectingCount++; var acceptedCount = 0; - view.Accepted += (s, e) => + view.Accepting += (s, e) => { acceptedCount++; }; diff --git a/UnitTests/Views/ButtonTests.cs b/UnitTests/Views/ButtonTests.cs index edfd917b1..d7f092e80 100644 --- a/UnitTests/Views/ButtonTests.cs +++ b/UnitTests/Views/ButtonTests.cs @@ -249,7 +249,7 @@ public class ButtonTests (ITestOutputHelper output) { var clicked = false; var btn = new Button { Text = "_Test" }; - btn.Accepted += (s, e) => clicked = true; + btn.Accepting += (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.Accepted += (s, e) => acceptInvoked++; + button.Accepting += (s, e) => acceptInvoked++; superView.Add (button); button.SetFocus (); @@ -308,7 +308,7 @@ public class ButtonTests (ITestOutputHelper output) button.CanFocus = focused; int acceptInvoked = 0; - button.Accepted += (s, e) => acceptInvoked++; + button.Accepting += (s, e) => acceptInvoked++; superView.Add (button); button.SetFocus (); @@ -339,7 +339,7 @@ public class ButtonTests (ITestOutputHelper output) button.CanFocus = focused; int acceptInvoked = 0; - button.Accepted += (s, e) => acceptInvoked++; + button.Accepting += (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.Accepted += (s, e) => pressed++; + btn.Accepting += (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.Accepted += (s, e) => clicked = true; + btn.Accepting += (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.Accepted += ButtonOnAccept; + button.Accepting += 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.Accepted += ButtonAccept; + button.Accepting += ButtonAccept; bool? ret = button.InvokeCommand (Command.Accept); Assert.True (ret); @@ -612,7 +612,7 @@ public class ButtonTests (ITestOutputHelper output) button.Selecting += (s, e) => selectingCount++; var acceptedCount = 0; - button.Accepted += (s, e) => + button.Accepting += (s, e) => { acceptedCount++; e.Cancel = true; @@ -657,7 +657,7 @@ public class ButtonTests (ITestOutputHelper output) var acceptedCount = 0; - button.Accepted += (s, e) => + button.Accepting += (s, e) => { acceptedCount++; e.Cancel = true; diff --git a/UnitTests/Views/CheckBoxTests.cs b/UnitTests/Views/CheckBoxTests.cs index 81504e2ce..68b544f04 100644 --- a/UnitTests/Views/CheckBoxTests.cs +++ b/UnitTests/Views/CheckBoxTests.cs @@ -184,7 +184,7 @@ public class CheckBoxTests (ITestOutputHelper output) ckb.Selecting += (s, e) => selectCount++; int acceptCount = 0; - ckb.Accepted += (s, e) => acceptCount++; + ckb.Accepting += (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.Accepted += ViewOnAccept; + ckb.Accepting += ViewOnAccept; bool? ret = ckb.InvokeCommand (Command.Accept); Assert.True (ret); @@ -259,7 +259,7 @@ public class CheckBoxTests (ITestOutputHelper output) checkBox.Selecting += (s, e) => selectCount++; int acceptCount = 0; - checkBox.Accepted += (s, e) => acceptCount++; + checkBox.Accepting += (s, e) => acceptCount++; checkBox.HasFocus = true; Assert.True (checkBox.HasFocus); @@ -303,7 +303,7 @@ public class CheckBoxTests (ITestOutputHelper output) checkBox.Selecting += (s, e) => selectCount++; int acceptCount = 0; - checkBox.Accepted += (s, e) => acceptCount++; + checkBox.Accepting += (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.Accepted += CheckBoxOnAccept; + cb.Accepting += CheckBoxOnAccept; cb.InvokeCommand (Command.HotKey); Assert.False (accepted); diff --git a/UnitTests/Views/LabelTests.cs b/UnitTests/Views/LabelTests.cs index 21c09c2cb..2e3982fe7 100644 --- a/UnitTests/Views/LabelTests.cs +++ b/UnitTests/Views/LabelTests.cs @@ -74,7 +74,7 @@ public class LabelTests (ITestOutputHelper output) var label = new Label (); var accepted = false; - label.Accepted += LabelOnAccept; + label.Accepting += LabelOnAccept; label.InvokeCommand (Command.HotKey); Assert.False (accepted); diff --git a/UnitTests/Views/ListViewTests.cs b/UnitTests/Views/ListViewTests.cs index 4b9764532..ff84f1b2f 100644 --- a/UnitTests/Views/ListViewTests.cs +++ b/UnitTests/Views/ListViewTests.cs @@ -414,7 +414,7 @@ Item 6", var listView = new ListView (); var accepted = false; - listView.Accepted += OnAccepted; + listView.Accepting += OnAccepted; listView.InvokeCommand (Command.HotKey); Assert.False (accepted); @@ -435,7 +435,7 @@ Item 6", var opened = false; var selectedValue = string.Empty; - listView.Accepted += Accepted; + listView.Accepting += Accepted; listView.OpenSelectedItem += OpenSelectedItem; listView.InvokeCommand (Command.Accept); @@ -466,7 +466,7 @@ Item 6", var opened = false; var selectedValue = string.Empty; - listView.Accepted += Accepted; + listView.Accepting += Accepted; listView.OpenSelectedItem += OpenSelectedItem; listView.InvokeCommand (Command.Accept); diff --git a/UnitTests/Views/MenuBarTests.cs b/UnitTests/Views/MenuBarTests.cs index 99c801936..736e79890 100644 --- a/UnitTests/Views/MenuBarTests.cs +++ b/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.Accepted += (s, e) => btnClicked = true; + btn.Accepting += (s, e) => btnClicked = true; var top = new Toplevel (); top.Add (menu, btn); Application.Begin (top); diff --git a/UnitTests/Views/RadioGroupTests.cs b/UnitTests/Views/RadioGroupTests.cs index e5a9f177f..48fc88119 100644 --- a/UnitTests/Views/RadioGroupTests.cs +++ b/UnitTests/Views/RadioGroupTests.cs @@ -94,7 +94,7 @@ public class RadioGroupTests (ITestOutputHelper output) rg.Selecting += (s, e) => selectingCount++; var acceptedCount = 0; - rg.Accepted += (s, e) => acceptedCount++; + rg.Accepting += (s, e) => acceptedCount++; // By default the first item is selected Assert.Equal (0, rg.SelectedItem); @@ -223,7 +223,7 @@ public class RadioGroupTests (ITestOutputHelper output) rg.Selecting += (s, e) => selectCount++; var acceptCount = 0; - rg.Accepted += (s, e) => acceptCount++; + rg.Accepting += (s, e) => acceptCount++; // By default the first item is selected Assert.Equal (0, rg.SelectedItem); @@ -300,7 +300,7 @@ public class RadioGroupTests (ITestOutputHelper output) rg.Selecting += (s, e) => selectCount++; var acceptCount = 0; - rg.Accepted += (s, e) => acceptCount++; + rg.Accepting += (s, e) => acceptCount++; // By default the first item is selected Assert.Equal (0, rg.SelectedItem); @@ -491,7 +491,7 @@ public class RadioGroupTests (ITestOutputHelper output) var group = new RadioGroup { RadioLabels = new [] { "_Left", "_Right", "Cen_tered", "_Justified" } }; var accepted = false; - group.Accepted += OnAccept; + group.Accepting += OnAccept; group.InvokeCommand (Command.HotKey); Assert.False (accepted); @@ -507,7 +507,7 @@ public class RadioGroupTests (ITestOutputHelper output) var group = new RadioGroup { RadioLabels = new [] { "_Left", "_Right", "Cen_tered", "_Justified" } }; var accepted = false; - group.Accepted += OnAccept; + group.Accepting += OnAccept; group.InvokeCommand (Command.Accept); Assert.True (accepted); @@ -629,7 +629,7 @@ public class RadioGroupTests (ITestOutputHelper output) radioGroup.Selecting += (s, e) => selectingCount++; var acceptedCount = 0; - radioGroup.Accepted += (s, e) => acceptedCount++; + radioGroup.Accepting += (s, e) => acceptedCount++; Assert.Equal (Orientation.Vertical, radioGroup.Orientation); @@ -681,7 +681,7 @@ public class RadioGroupTests (ITestOutputHelper output) var acceptedCount = 0; var handleAccepted = false; - radioGroup.Accepted += (s, e) => + radioGroup.Accepting += (s, e) => { acceptedCount++; e.Cancel = handleAccepted; @@ -733,7 +733,7 @@ public class RadioGroupTests (ITestOutputHelper output) var superViewAcceptCount = 0; - superView.Accepted += (s, a) => + superView.Accepting += (s, a) => { superViewAcceptCount++; a.Cancel = true; diff --git a/UnitTests/Views/ScrollBarViewTests.cs b/UnitTests/Views/ScrollBarViewTests.cs index e2a15ebba..989962d00 100644 --- a/UnitTests/Views/ScrollBarViewTests.cs +++ b/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.Accepted += (s, e) => clicked = true; + btn.Accepting += (s, e) => clicked = true; var top = new Toplevel (); top.Add (label, btn); diff --git a/UnitTests/Views/ShortcutTests.cs b/UnitTests/Views/ShortcutTests.cs index e1cd8cfdc..dc3ab6e1c 100644 --- a/UnitTests/Views/ShortcutTests.cs +++ b/UnitTests/Views/ShortcutTests.cs @@ -422,7 +422,7 @@ public class ShortcutTests Application.Top.LayoutSubviews (); var accepted = 0; - shortcut.Accepted += (s, e) => accepted++; + shortcut.Accepting += (s, e) => accepted++; Application.OnMouseEvent ( new () @@ -471,12 +471,12 @@ public class ShortcutTests }; var commandViewAcceptCount = 0; - shortcut.CommandView.Accepted += (s, e) => { commandViewAcceptCount++; }; + shortcut.CommandView.Accepting += (s, e) => { commandViewAcceptCount++; }; var commandViewSelectCount = 0; shortcut.CommandView.Selecting += (s, e) => { commandViewSelectCount++; }; var shortcutAcceptCount = 0; - shortcut.Accepted += (s, e) => { shortcutAcceptCount++; }; + shortcut.Accepting += (s, e) => { shortcutAcceptCount++; }; var shortcutSelectCount = 0; shortcut.Selecting += (s, e) => { shortcutSelectCount++; }; @@ -533,13 +533,13 @@ public class ShortcutTests CanFocus = false }; var buttonAccepted = 0; - shortcut.CommandView.Accepted += (s, e) => { buttonAccepted++; }; + shortcut.CommandView.Accepting += (s, e) => { buttonAccepted++; }; Application.Top.Add (shortcut); Application.Top.SetRelativeLayout (new (100, 100)); Application.Top.LayoutSubviews (); var accepted = 0; - shortcut.Accepted += (s, e) => { accepted++; }; + shortcut.Accepting += (s, e) => { accepted++; }; Application.OnMouseEvent ( new () @@ -587,7 +587,7 @@ public class ShortcutTests CanFocus = false }; var checkboxAccepted = 0; - shortcut.CommandView.Accepted += (s, e) => { checkboxAccepted++; }; + shortcut.CommandView.Accepting += (s, e) => { checkboxAccepted++; }; var checkboxSelected = 0; shortcut.CommandView.Selecting += (s, e) => @@ -610,7 +610,7 @@ public class ShortcutTests }; var accepted = 0; - shortcut.Accepted += (s, e) => + shortcut.Accepting += (s, e) => { accepted++; e.Cancel = true; @@ -662,7 +662,7 @@ public class ShortcutTests Assert.Equal (canFocus, shortcut.HasFocus); var accepted = 0; - shortcut.Accepted += (s, e) => accepted++; + shortcut.Accepting += (s, e) => accepted++; var selected = 0; shortcut.Selecting += (s, e) => selected++; @@ -710,7 +710,7 @@ public class ShortcutTests Assert.Equal (canFocus, shortcut.HasFocus); var accepted = 0; - shortcut.Accepted += (s, e) => + shortcut.Accepting += (s, e) => { accepted++; e.Cancel = true; @@ -749,7 +749,7 @@ public class ShortcutTests Application.Top.SetFocus (); var accepted = 0; - shortcut.Accepted += (s, e) => accepted++; + shortcut.Accepting += (s, e) => accepted++; Application.OnKeyDown (key); diff --git a/UnitTests/Views/TextFieldTests.cs b/UnitTests/Views/TextFieldTests.cs index 0f0709a3a..5c81dffca 100644 --- a/UnitTests/Views/TextFieldTests.cs +++ b/UnitTests/Views/TextFieldTests.cs @@ -555,7 +555,7 @@ public class TextFieldTests (ITestOutputHelper output) TextField tf = new (); var acceptedCount = 0; - tf.Accepted += (sender, args) => acceptedCount++; + tf.Accepting += (sender, args) => acceptedCount++; Application.Top = new (); Application.Top.Add (tf); @@ -818,7 +818,7 @@ public class TextFieldTests (ITestOutputHelper output) { var view = new TextField (); var accepted = false; - view.Accepted += OnAccept; + view.Accepting += OnAccept; view.InvokeCommand (Command.HotKey); Assert.False (accepted); @@ -834,7 +834,7 @@ public class TextFieldTests (ITestOutputHelper output) var view = new TextField (); var accepted = false; - view.Accepted += Accept; + view.Accepting += Accept; view.InvokeCommand (Command.Accept); Assert.True (accepted); @@ -867,10 +867,10 @@ public class TextFieldTests (ITestOutputHelper output) superView.Add (tf, button); var buttonAccept = 0; - button.Accepted += ButtonAccept; + button.Accepting += ButtonAccept; var textFieldAccept = 0; - tf.Accepted += TextFieldAccept; + tf.Accepting += TextFieldAccept; tf.SetFocus (); Assert.True (tf.HasFocus); @@ -917,7 +917,7 @@ public class TextFieldTests (ITestOutputHelper output) superView.Add (tf, button); var buttonAccept = 0; - button.Accepted += ButtonAccept; + button.Accepting += ButtonAccept; tf.SetFocus (); Assert.True (tf.HasFocus); @@ -946,13 +946,13 @@ public class TextFieldTests (ITestOutputHelper output) var tfAcceptedInvoked = false; var handle = false; - view.Accepted += TextViewAccept; + view.Accepting += TextViewAccept; Assert.False (view.InvokeCommand (Command.Accept)); Assert.True (tfAcceptedInvoked); tfAcceptedInvoked = false; handle = true; - view.Accepted += TextViewAccept; + view.Accepting += TextViewAccept; Assert.True (view.InvokeCommand (Command.Accept)); Assert.True (tfAcceptedInvoked); diff --git a/UnitTests/Views/TextViewTests.cs b/UnitTests/Views/TextViewTests.cs index b8673dab8..2221961a0 100644 --- a/UnitTests/Views/TextViewTests.cs +++ b/UnitTests/Views/TextViewTests.cs @@ -8464,7 +8464,7 @@ line. { var view = new TextView (); var accepted = false; - view.Accepted += OnAccept; + view.Accepting += OnAccept; view.InvokeCommand (Command.HotKey); Assert.False (accepted); @@ -8485,7 +8485,7 @@ line. }; int acceptedEvents = 0; - view.Accepted += Accept; + view.Accepting += Accept; view.InvokeCommand (Command.Accept); Assert.Equal (expectedAcceptEvents, acceptedEvents); @@ -8505,7 +8505,7 @@ line. }; int accepted = 0; - view.Accepted += Accept; + view.Accepting += Accept; view.NewKeyDownEvent (Key.Enter); Assert.Equal (expectedAccepts, accepted); @@ -8525,7 +8525,7 @@ line. }; int accepted = 0; - view.Accepted += Accept; + view.Accepting += Accept; view.NewKeyDownEvent (Key.Enter); Assert.Equal (expectedAccepts, accepted); @@ -8554,10 +8554,10 @@ line. superView.Add (tv, button); var buttonAccept = 0; - button.Accepted += ButtonAccept; + button.Accepting += ButtonAccept; var textViewAccept = 0; - tv.Accepted += TextViewAccept; + tv.Accepting += TextViewAccept; tv.SetFocus (); Assert.True (tv.HasFocus); @@ -8603,7 +8603,7 @@ line. superView.Add (tv, button); var buttonAccept = 0; - button.Accepted += ButtonAccept; + button.Accepting += ButtonAccept; tv.SetFocus (); Assert.True (tv.HasFocus); diff --git a/UnitTests/Views/ToplevelTests.cs b/UnitTests/Views/ToplevelTests.cs index 3590cd3d7..d491aeb9b 100644 --- a/UnitTests/Views/ToplevelTests.cs +++ b/UnitTests/Views/ToplevelTests.cs @@ -947,7 +947,7 @@ public partial class ToplevelTests (ITestOutputHelper output) var testWindow = new Window { X = 2, Y = 1, Width = 15, Height = 10 }; testWindow.Add (btnPopup); - btnPopup.Accepted += (s, e) => + btnPopup.Accepting += (s, e) => { Rectangle viewToScreen = btnPopup.ViewportToScreen (top.Frame); diff --git a/UnitTests/Views/TreeViewTests.cs b/UnitTests/Views/TreeViewTests.cs index 6fd248484..56f3805a0 100644 --- a/UnitTests/Views/TreeViewTests.cs +++ b/UnitTests/Views/TreeViewTests.cs @@ -1344,7 +1344,7 @@ oot two var treeView = new TreeView (); var accepted = false; - treeView.Accepted += OnAccept; + treeView.Accepting += OnAccept; treeView.InvokeCommand (Command.HotKey); Assert.False (accepted); @@ -1365,7 +1365,7 @@ oot two var activated = false; object selectedObject = null; - treeView.Accepted += Accept; + treeView.Accepting += Accept; treeView.ObjectActivated += ObjectActivated; treeView.InvokeCommand (Command.Accept); @@ -1393,7 +1393,7 @@ oot two var activated = false; object selectedObject = null; - treeView.Accepted += Accept; + treeView.Accepting += Accept; treeView.ObjectActivated += ObjectActivated; treeView.InvokeCommand (Command.Accept);