diff --git a/Examples/Example/Example.cs b/Examples/Example/Example.cs index 4d8552e3a4..e67370f1ca 100644 --- a/Examples/Example/Example.cs +++ b/Examples/Example/Example.cs @@ -67,7 +67,7 @@ public ExampleWindow () // center the login button horizontally X = Pos.Center (), - IsDefault = true + IsDefaultAcceptView = true }; // When login button is clicked display a message popup diff --git a/Examples/FluentExample/Program.cs b/Examples/FluentExample/Program.cs index 026a981345..05d1003770 100644 --- a/Examples/FluentExample/Program.cs +++ b/Examples/FluentExample/Program.cs @@ -64,7 +64,7 @@ public ColorPickerView () Title = "_OK", X = Pos.Align (Alignment.Center), Y = Pos.AnchorEnd (), - IsDefault = true + IsDefaultAcceptView = true }; okButton.Accepting += (s, e) => diff --git a/Examples/NativeAot/Program.cs b/Examples/NativeAot/Program.cs index 501adb2ed8..6fea1ec3d6 100644 --- a/Examples/NativeAot/Program.cs +++ b/Examples/NativeAot/Program.cs @@ -93,7 +93,7 @@ public ExampleWindow () // center the login button horizontally X = Pos.Center (), - IsDefault = true + IsDefaultAcceptView = true }; // When login button is clicked display a message popup diff --git a/Examples/RunnableWrapperExample/Program.cs b/Examples/RunnableWrapperExample/Program.cs index 1eb5e9e119..2bc1e64ff2 100644 --- a/Examples/RunnableWrapperExample/Program.cs +++ b/Examples/RunnableWrapperExample/Program.cs @@ -125,7 +125,7 @@ View CreateCustomForm () Title = "OK", X = Pos.Center (), Y = 7, - IsDefault = true + IsDefaultAcceptView = true }; okButton.Accepting += (s, e) => diff --git a/Examples/SelfContained/Program.cs b/Examples/SelfContained/Program.cs index 319ae859fb..17b0011674 100644 --- a/Examples/SelfContained/Program.cs +++ b/Examples/SelfContained/Program.cs @@ -92,7 +92,7 @@ public ExampleWindow () // center the login button horizontally X = Pos.Center (), - IsDefault = true + IsDefaultAcceptView = true }; // When login button is clicked display a message popup diff --git a/Examples/UICatalog/Scenarios/AnsiRequestsScenario.cs b/Examples/UICatalog/Scenarios/AnsiRequestsScenario.cs index a8d7c72ade..cd7db2999f 100644 --- a/Examples/UICatalog/Scenarios/AnsiRequestsScenario.cs +++ b/Examples/UICatalog/Scenarios/AnsiRequestsScenario.cs @@ -152,7 +152,7 @@ private View BuildSingleTab () var tvTerminator = new TextView { X = Pos.Left (label), Y = Pos.Bottom (label), Width = 4, Height = 4, ReadOnly = true }; w.Add (label, tvTerminator); - var btnResponse = new Button { X = Pos.Center (), Y = Pos.Bottom (tvResponse) + 2, Text = "Send Request", IsDefault = true }; + var btnResponse = new Button { X = Pos.Center (), Y = Pos.Bottom (tvResponse) + 2, Text = "Send Request", IsDefaultAcceptView = true }; var lblSuccess = new Label { X = Pos.Center (), Y = Pos.Bottom (btnResponse) + 1 }; w.Add (lblSuccess); diff --git a/Examples/UICatalog/Scenarios/Buttons.cs b/Examples/UICatalog/Scenarios/Buttons.cs index f0078564ad..2b1535dab3 100644 --- a/Examples/UICatalog/Scenarios/Buttons.cs +++ b/Examples/UICatalog/Scenarios/Buttons.cs @@ -20,17 +20,17 @@ public override void Main () Title = GetQuitKeyAndName () }; - // Add a label & text field so we can demo IsDefault - var editLabel = new Label { X = 0, Y = 0, Text = "TextField (to demo IsDefault):" }; + // Add a label & text field so we can demo IsDefaultAcceptView + var editLabel = new Label { X = 0, Y = 0, Text = "TextField (to demo IsDefaultAcceptView):" }; main.Add (editLabel); // Add a TextField using Absolute layout. var edit = new TextField { X = 31, Width = 15, HotKey = Key.Y.WithAlt }; main.Add (edit); - // This is the default button (IsDefault = true); if user presses ENTER in the TextField + // This is the default button (IsDefaultAcceptView = true); if user presses ENTER in the TextField // the scenario will quit - var defaultButton = new Button { X = Pos.Center (), Y = Pos.AnchorEnd (), IsDefault = true, Text = "_Quit" }; + var defaultButton = new Button { X = Pos.Center (), Y = Pos.AnchorEnd (), IsDefaultAcceptView = true, Text = "_Quit" }; main.Add (defaultButton); @@ -48,14 +48,14 @@ public override void Main () swapButton.Accepting += (s, e) => { - e.Handled = !swapButton.IsDefault; - defaultButton.IsDefault = !defaultButton.IsDefault; - swapButton.IsDefault = !swapButton.IsDefault; + e.Handled = !swapButton.IsDefaultAcceptView; + defaultButton.IsDefaultAcceptView = !defaultButton.IsDefaultAcceptView; + swapButton.IsDefaultAcceptView = !swapButton.IsDefaultAcceptView; }; defaultButton.Accepting += (s, e) => { - e.Handled = !defaultButton.IsDefault; + e.Handled = !defaultButton.IsDefaultAcceptView; if (e.Handled) { diff --git a/Examples/UICatalog/Scenarios/CharacterMap/CharacterMap.cs b/Examples/UICatalog/Scenarios/CharacterMap/CharacterMap.cs index fba9130e37..819a33a2a0 100644 --- a/Examples/UICatalog/Scenarios/CharacterMap/CharacterMap.cs +++ b/Examples/UICatalog/Scenarios/CharacterMap/CharacterMap.cs @@ -133,9 +133,15 @@ public override void Main () _categoryList.Table = CreateCategoryTable (0, isDescending); - // if user clicks the mouse in TableView - _categoryList.MouseClick += (s, e) => + // if user clicks the mouse in TableView, change sorting by that column + _categoryList.Activating += (s, commandEventArgs) => { + if (commandEventArgs.Context is not CommandContext mouseContext) + { + return; + } + + MouseEventArgs e = mouseContext.Binding.MouseEventArgs!; _categoryList.ScreenToCell (e.Position, out int? clickedCol); if (clickedCol != null && e.Flags.HasFlag (MouseFlags.Button1Clicked)) diff --git a/Examples/UICatalog/Scenarios/ContextMenus.cs b/Examples/UICatalog/Scenarios/ContextMenus.cs index 029798b0a1..1fbeba959b 100644 --- a/Examples/UICatalog/Scenarios/ContextMenus.cs +++ b/Examples/UICatalog/Scenarios/ContextMenus.cs @@ -5,7 +5,7 @@ namespace UICatalog.Scenarios; -[ScenarioMetadata ("ContextMenus", "Context Menu Sample.")] +[ScenarioMetadata ("ContextMenus", "Demonstrates using PopoverMenu as a Context Menu.")] [ScenarioCategory ("Menus")] public class ContextMenus : Scenario { @@ -35,7 +35,7 @@ public override void Main () Application.Run (_appWindow); _appWindow.Dispose (); _appWindow.KeyDown -= OnAppWindowOnKeyDown; - _appWindow.MouseClick -= OnAppWindowOnMouseClick; + _appWindow.MouseEvent -= OnAppWindowOnMouseEvent; _winContextMenu?.Dispose (); // Shutdown - Calling Application.Shutdown is required. @@ -81,7 +81,7 @@ void AppWindowOnInitialized (object? sender, EventArgs e) _appWindow.Add (_tfBottomRight); _appWindow.KeyDown += OnAppWindowOnKeyDown; - _appWindow.MouseClick += OnAppWindowOnMouseClick; + _appWindow.MouseEvent += OnAppWindowOnMouseEvent; CultureInfo originalCulture = Thread.CurrentThread.CurrentUICulture; _appWindow.IsRunningChanged += (s, e) => { @@ -91,7 +91,7 @@ void AppWindowOnInitialized (object? sender, EventArgs e) } }; } - void OnAppWindowOnMouseClick (object? s, MouseEventArgs e) + void OnAppWindowOnMouseEvent (object? s, MouseEventArgs e) { if (e.Flags == MouseFlags.Button3Clicked) { @@ -190,7 +190,12 @@ private Menu GetSupportedCultureMenu () { MenuItem culture = new (); - culture.CommandView = new CheckBox { CanFocus = false }; + culture.CommandView = new CheckBox + { + // Best practice for CheckBoxes in menus is to disable focus and highlight states + CanFocus = false, + HighlightStates = MouseState.None + }; if (index == -1) { @@ -206,7 +211,12 @@ private Menu GetSupportedCultureMenu () index++; culture = new (); - culture.CommandView = new CheckBox { CanFocus = false }; + culture.CommandView = new CheckBox + { + // Best practice for CheckBoxes in menus is to disable focus and highlight states + CanFocus = false, + HighlightStates = MouseState.None + }; } culture.Id = $"_{c.Parent.EnglishName}"; diff --git a/Examples/UICatalog/Scenarios/CsvEditor.cs b/Examples/UICatalog/Scenarios/CsvEditor.cs index 0c676f8051..493adb77c8 100644 --- a/Examples/UICatalog/Scenarios/CsvEditor.cs +++ b/Examples/UICatalog/Scenarios/CsvEditor.cs @@ -353,7 +353,7 @@ private bool GetText (string title, string label, string initialText, out string { var okPressed = false; - Button ok = new () { Text = "Ok", IsDefault = true }; + Button ok = new () { Text = "Ok", IsDefaultAcceptView = true }; ok.Accepting += (s, e) => { diff --git a/Examples/UICatalog/Scenarios/Dialogs.cs b/Examples/UICatalog/Scenarios/Dialogs.cs index fb4a4fbd65..958b62ff40 100644 --- a/Examples/UICatalog/Scenarios/Dialogs.cs +++ b/Examples/UICatalog/Scenarios/Dialogs.cs @@ -178,7 +178,7 @@ public override void Main () var showDialogButton = new Button { - X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefault = true, Text = "_Show Dialog" + X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefaultAcceptView = true, Text = "_Show Dialog" }; app.Accepting += (s, e) => @@ -243,12 +243,12 @@ Label buttonPressedLabel button = new () { Text = "_" + NumberToWords.Convert (buttonId) + " " + char.ConvertFromUtf32 (buttonId + CODE_POINT), - IsDefault = buttonId == 0 + IsDefaultAcceptView = buttonId == 0 }; } else { - button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefault = buttonId == 0 }; + button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefaultAcceptView = buttonId == 0 }; } button.Accepting += (s, e) => @@ -297,12 +297,12 @@ Label buttonPressedLabel button = new () { Text = "_" + NumberToWords.Convert (buttonId) + " " + char.ConvertFromUtf32 (buttonId + CODE_POINT), - IsDefault = buttonId == 0 + IsDefaultAcceptView = buttonId == 0 }; } else { - button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefault = buttonId == 0 }; + button = new () { Text = "_" + NumberToWords.Convert (buttonId), IsDefaultAcceptView = buttonId == 0 }; } button.Accepting += (s, e) => diff --git a/Examples/UICatalog/Scenarios/DynamicStatusBar.cs b/Examples/UICatalog/Scenarios/DynamicStatusBar.cs index 43b01829f6..b04599c045 100644 --- a/Examples/UICatalog/Scenarios/DynamicStatusBar.cs +++ b/Examples/UICatalog/Scenarios/DynamicStatusBar.cs @@ -178,7 +178,7 @@ public DynamicStatusItem EnterStatusItem () EditStatusItem (_statusItem); } - var btnOk = new Button { IsDefault = true, Text = "OK" }; + var btnOk = new Button { IsDefaultAcceptView = true, Text = "OK" }; btnOk.Accepting += (s, e) => { diff --git a/Examples/UICatalog/Scenarios/Editor.cs b/Examples/UICatalog/Scenarios/Editor.cs index ddf16c92e5..b31a27cb76 100644 --- a/Examples/UICatalog/Scenarios/Editor.cs +++ b/Examples/UICatalog/Scenarios/Editor.cs @@ -954,7 +954,7 @@ private View CreateFindTab () X = Pos.Align (Alignment.Center), Y = Pos.AnchorEnd (), Enabled = !string.IsNullOrEmpty (txtToFind.Text), - IsDefault = true, + IsDefaultAcceptView = true, Text = "Find _Next" }; btnFindNext.Accepting += (s, e) => { FindNext (); }; @@ -1041,7 +1041,7 @@ private View CreateReplaceTab () X = Pos.Align (Alignment.Center), Y = Pos.AnchorEnd (), Enabled = !string.IsNullOrEmpty (txtToFind.Text), - IsDefault = true, + IsDefaultAcceptView = true, Text = "Replace _Next" }; btnFindNext.Accepting += (s, e) => { ReplaceNext (); }; diff --git a/Examples/UICatalog/Scenarios/EditorsAndHelpers/AllViewsView.cs b/Examples/UICatalog/Scenarios/EditorsAndHelpers/AllViewsView.cs index f8f78ac6fe..fdd870c3ec 100644 --- a/Examples/UICatalog/Scenarios/EditorsAndHelpers/AllViewsView.cs +++ b/Examples/UICatalog/Scenarios/EditorsAndHelpers/AllViewsView.cs @@ -59,7 +59,6 @@ public AllViewsView () KeyBindings.Add (Key.End, Command.End); KeyBindings.Add (PopoverMenu.DefaultKey, Command.Context); - MouseBindings.Add (MouseFlags.Button1DoubleClicked, Command.Accept); MouseBindings.ReplaceCommands (MouseFlags.Button3Clicked, Command.Context); MouseBindings.ReplaceCommands (MouseFlags.Button1Clicked | MouseFlags.ButtonCtrl, Command.Context); MouseBindings.Add (MouseFlags.WheeledDown, Command.ScrollDown); diff --git a/Examples/UICatalog/Scenarios/EditorsAndHelpers/EventLog.cs b/Examples/UICatalog/Scenarios/EditorsAndHelpers/EventLog.cs index 9b59d88126..fadeae0243 100644 --- a/Examples/UICatalog/Scenarios/EditorsAndHelpers/EventLog.cs +++ b/Examples/UICatalog/Scenarios/EditorsAndHelpers/EventLog.cs @@ -79,10 +79,9 @@ public View? ViewToLog Log ($"Initialized: {GetIdentifyingString (sender)}"); }; - _viewToLog.MouseClick += (s, args) => { Log ($"MouseClick: {args}"); }; _viewToLog.MouseWheel += (s, args) => { Log ($"MouseWheel: {args}"); }; _viewToLog.HandlingHotKey += (s, args) => { Log ($"HandlingHotKey: {args.Context}"); }; - _viewToLog.Selecting += (s, args) => { Log ($"Selecting: {args.Context}"); }; + _viewToLog.Activating += (s, args) => { Log ($"Activating: {args.Context}"); }; _viewToLog.Accepting += (s, args) => { Log ($"Accepting: {args.Context}"); }; } } diff --git a/Examples/UICatalog/Scenarios/EditorsAndHelpers/ThemeViewer.cs b/Examples/UICatalog/Scenarios/EditorsAndHelpers/ThemeViewer.cs index 0141cbfc9d..637c78aebb 100644 --- a/Examples/UICatalog/Scenarios/EditorsAndHelpers/ThemeViewer.cs +++ b/Examples/UICatalog/Scenarios/EditorsAndHelpers/ThemeViewer.cs @@ -65,7 +65,6 @@ public ThemeViewer () KeyBindings.Add (Key.End, Command.End); KeyBindings.Add (PopoverMenu.DefaultKey, Command.Context); - MouseBindings.Add (MouseFlags.Button1DoubleClicked, Command.Accept); MouseBindings.ReplaceCommands (MouseFlags.Button3Clicked, Command.Context); MouseBindings.ReplaceCommands (MouseFlags.Button1Clicked | MouseFlags.ButtonCtrl, Command.Context); MouseBindings.Add (MouseFlags.WheeledDown, Command.ScrollDown); diff --git a/Examples/UICatalog/Scenarios/FileDialogExamples.cs b/Examples/UICatalog/Scenarios/FileDialogExamples.cs index 2d9ccbaf70..5082650d4a 100644 --- a/Examples/UICatalog/Scenarios/FileDialogExamples.cs +++ b/Examples/UICatalog/Scenarios/FileDialogExamples.cs @@ -123,7 +123,7 @@ public override void Main () _cbFlipButtonOrder = new () { X = x, Y = y++, Text = "Flip Ord_er" }; win.Add (_cbFlipButtonOrder); - var btn = new Button { X = 1, Y = 9, IsDefault = true, Text = "Run Dialog" }; + var btn = new Button { X = 1, Y = 9, IsDefaultAcceptView = true, Text = "Run Dialog" }; win.Accepting += (s, e) => { diff --git a/Examples/UICatalog/Scenarios/Generic.cs b/Examples/UICatalog/Scenarios/Generic.cs index a5a3b81ccf..0b21ec77a7 100644 --- a/Examples/UICatalog/Scenarios/Generic.cs +++ b/Examples/UICatalog/Scenarios/Generic.cs @@ -15,14 +15,21 @@ public override void Main () Window appWindow = new () { Title = GetQuitKeyAndName (), - BorderStyle = LineStyle.None + BorderStyle = LineStyle.None, + //InvertFocusAttribute = true }; - var button = new Button () + + + var button = new CheckBox () { X = Pos.Center (), Y = 1, Title = "_Button", + + // Comment this out to see how Issue #4170 is about IsDefaultAcceptView not working with Accepting event. + // IsDefaultAcceptView = true, + //SchemeName = "Error" }; button.Accepting += (s, e) => diff --git a/Examples/UICatalog/Scenarios/InteractiveTree.cs b/Examples/UICatalog/Scenarios/InteractiveTree.cs index e65aec2843..1555725123 100644 --- a/Examples/UICatalog/Scenarios/InteractiveTree.cs +++ b/Examples/UICatalog/Scenarios/InteractiveTree.cs @@ -97,7 +97,7 @@ private bool GetText (string title, string label, string initialText, out string { var okPressed = false; - Button ok = new () { Text = "Ok", IsDefault = true }; + var ok = new Button { Text = "Ok", IsDefaultAcceptView = true }; ok.Accepting += (s, e) => { diff --git a/Examples/UICatalog/Scenarios/LineDrawing.cs b/Examples/UICatalog/Scenarios/LineDrawing.cs index 3badc02dc6..4a9d645c83 100644 --- a/Examples/UICatalog/Scenarios/LineDrawing.cs +++ b/Examples/UICatalog/Scenarios/LineDrawing.cs @@ -143,7 +143,7 @@ public static bool PromptForColor (string title, Color current, out Color newCol Y = Driver.Force16Colors ? 6 : 4, Text = "Ok", Width = Dim.Auto (), - IsDefault = true + IsDefaultAcceptView = true }; btnOk.Accepting += (s, e) => diff --git a/Examples/UICatalog/Scenarios/ListColumns.cs b/Examples/UICatalog/Scenarios/ListColumns.cs index c19e9c3b95..7bd7f13b9b 100644 --- a/Examples/UICatalog/Scenarios/ListColumns.cs +++ b/Examples/UICatalog/Scenarios/ListColumns.cs @@ -113,7 +113,7 @@ public override void Main () }; // if user clicks the mouse in TableView - _listColView.MouseClick += (s, e) => { _listColView.ScreenToCell (e.Position, out int? clickedCol); }; + _listColView.MouseEvent += (s, e) => { _listColView.ScreenToCell (e.Position, out int? clickedCol); }; _listColView.KeyBindings.ReplaceCommands (Key.Space, Command.Accept); @@ -309,7 +309,7 @@ private void RunListWidthDialog (string prompt, Action setter, F } var accepted = false; - Button ok = new () { Text = "Ok", IsDefault = true }; + var ok = new Button { Text = "Ok", IsDefaultAcceptView = true }; ok.Accepting += (s, e) => { diff --git a/Examples/UICatalog/Scenarios/ListViewWithSelection.cs b/Examples/UICatalog/Scenarios/ListViewWithSelection.cs index dd6ac2bf42..4176c6489b 100644 --- a/Examples/UICatalog/Scenarios/ListViewWithSelection.cs +++ b/Examples/UICatalog/Scenarios/ListViewWithSelection.cs @@ -105,7 +105,7 @@ public override void Main () _listView.OpenSelectedItem += (s, a) => LogEvent (s as View, a, "OpenSelectedItem"); _listView.CollectionChanged += (s, a) => LogEvent (s as View, a, "CollectionChanged"); _listView.Accepting += (s, a) => LogEvent (s as View, a, "Accept"); - _listView.Selecting += (s, a) => LogEvent (s as View, a, "Select"); + _listView.Activating += (s, a) => LogEvent (s as View, a, "Activating"); _listView.VerticalScrollBar.AutoShow = true; _listView.HorizontalScrollBar.AutoShow = true; diff --git a/Examples/UICatalog/Scenarios/Menus.cs b/Examples/UICatalog/Scenarios/Menus.cs index 4796473ac6..327edd2d60 100644 --- a/Examples/UICatalog/Scenarios/Menus.cs +++ b/Examples/UICatalog/Scenarios/Menus.cs @@ -370,7 +370,7 @@ public MenuHost () }; // Add a button to open the contextmenu - var openBtn = new Button { X = Pos.Center (), Y = 4, Text = "_Open Menu", IsDefault = true }; + var openBtn = new Button { X = Pos.Center (), Y = 4, Text = "_Open Menu", IsDefaultAcceptView = true }; openBtn.Accepting += (s, e) => { diff --git a/Examples/UICatalog/Scenarios/MessageBoxes.cs b/Examples/UICatalog/Scenarios/MessageBoxes.cs index 6c691516d3..8aa51bf64d 100644 --- a/Examples/UICatalog/Scenarios/MessageBoxes.cs +++ b/Examples/UICatalog/Scenarios/MessageBoxes.cs @@ -228,7 +228,7 @@ public override void Main () var showMessageBoxButton = new Button { - X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefault = true, Text = "_Show MessageBox" + X = Pos.Center (), Y = Pos.Bottom (frame) + 2, IsDefaultAcceptView = true, Text = "_Show MessageBox" }; app.Accepting += (s, e) => diff --git a/Examples/UICatalog/Scenarios/Mouse.cs b/Examples/UICatalog/Scenarios/Mouse.cs index d56b3e82a5..d1c2621425 100644 --- a/Examples/UICatalog/Scenarios/Mouse.cs +++ b/Examples/UICatalog/Scenarios/Mouse.cs @@ -302,10 +302,17 @@ void DemoPaddingOnInitialized (object o, EventArgs eventArgs) } }; - win.MouseClick += (sender, a) => + win.Activating += (sender, commandEventArgs) => { - winLogList.Add ($"MouseClick: ({a.Position}) - {a.Flags} {count++}"); + if (commandEventArgs.Context is not CommandContext mouseContext) + { + return; + } + + MouseEventArgs e = mouseContext.Binding.MouseEventArgs!; + winLogList.Add ($"Activating: ({e.Position}) - {e.Flags} {count++}"); winLog.MoveDown (); + commandEventArgs.Handled = true; }; Application.Run (win); diff --git a/Examples/UICatalog/Scenarios/MultiColouredTable.cs b/Examples/UICatalog/Scenarios/MultiColouredTable.cs index b5bf47d48b..2a60cd5673 100644 --- a/Examples/UICatalog/Scenarios/MultiColouredTable.cs +++ b/Examples/UICatalog/Scenarios/MultiColouredTable.cs @@ -110,7 +110,7 @@ private bool GetText (string title, string label, string initialText, out string { var okPressed = false; - Button ok = new () { Text = "Ok", IsDefault = true }; + var ok = new Button { Text = "Ok", IsDefaultAcceptView = true }; ok.Accepting += (s, e) => { diff --git a/Examples/UICatalog/Scenarios/Navigation.cs b/Examples/UICatalog/Scenarios/Navigation.cs index 899dc22ee6..2d0790690a 100644 --- a/Examples/UICatalog/Scenarios/Navigation.cs +++ b/Examples/UICatalog/Scenarios/Navigation.cs @@ -1,5 +1,6 @@ using System.Text; using System.Timers; +using Timer = System.Timers.Timer; namespace UICatalog.Scenarios; @@ -75,6 +76,8 @@ public override void Main () testFrame.Add (tiledView3); View overlappedView1 = CreateOverlappedView (2, 10, Pos.Center ()); + // Set the button to CanFocus = false to illustrate https://github.com/gui-cs/Terminal.Gui/issues/4179 + overlappedView1.SubViews.OfType