浏览代码

Moved CanFocus out of Responder and made non-virtual

Tig Kindel 1 年之前
父节点
当前提交
6b833ba08e

+ 0 - 3
Terminal.Gui/Input/Responder.cs

@@ -22,9 +22,6 @@ public class Responder : IDisposable
 {
 {
     private bool disposedValue;
     private bool disposedValue;
 
 
-    /// <summary>Gets or sets a value indicating whether this <see cref="Responder"/> can focus.</summary>
-    /// <value><c>true</c> if can focus; otherwise, <c>false</c>.</value>
-    public virtual bool CanFocus { get; set; }
 
 
     /// <summary>Gets or sets a value indicating whether this <see cref="Responder"/> can respond to user interaction.</summary>
     /// <summary>Gets or sets a value indicating whether this <see cref="Responder"/> can respond to user interaction.</summary>
     public virtual bool Enabled { get; set; } = true;
     public virtual bool Enabled { get; set; } = true;

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

@@ -35,7 +35,7 @@ public class Adornment : View
     {
     {
         Application.GrabbingMouse += Application_GrabbingMouse;
         Application.GrabbingMouse += Application_GrabbingMouse;
         Application.UnGrabbingMouse += Application_UnGrabbingMouse;
         Application.UnGrabbingMouse += Application_UnGrabbingMouse;
-
+        CanFocus = true;
         Parent = parent;
         Parent = parent;
     }
     }
 
 

+ 5 - 4
Terminal.Gui/View/ViewSubViews.cs

@@ -357,6 +357,7 @@ public partial class View
     public override void OnCanFocusChanged () { CanFocusChanged?.Invoke (this, EventArgs.Empty); }
     public override void OnCanFocusChanged () { CanFocusChanged?.Invoke (this, EventArgs.Empty); }
 
 
     private bool _oldCanFocus;
     private bool _oldCanFocus;
+    private bool _canFocus;
 
 
     /// <summary>Gets or sets a value indicating whether this <see cref="View"/> can focus.</summary>
     /// <summary>Gets or sets a value indicating whether this <see cref="View"/> can focus.</summary>
     /// <remarks>
     /// <remarks>
@@ -367,9 +368,9 @@ public partial class View
     ///     Set accessor validates <see langword="value"/> before setting <see cref="Responder"/>.
     ///     Set accessor validates <see langword="value"/> before setting <see cref="Responder"/>.
     ///     <see cref="Responder.CanFocus"/>.
     ///     <see cref="Responder.CanFocus"/>.
     /// </remarks>
     /// </remarks>
-    public override bool CanFocus
+    public bool CanFocus
     {
     {
-        get => base.CanFocus;
+        get => _canFocus;
         set
         set
         {
         {
             if (!_addingView && IsInitialized && SuperView?.CanFocus == false && value)
             if (!_addingView && IsInitialized && SuperView?.CanFocus == false && value)
@@ -377,9 +378,9 @@ public partial class View
                 throw new InvalidOperationException ("Cannot set CanFocus to true if the SuperView CanFocus is false!");
                 throw new InvalidOperationException ("Cannot set CanFocus to true if the SuperView CanFocus is false!");
             }
             }
 
 
-            if (base.CanFocus != value)
+            if (_canFocus != value)
             {
             {
-                base.CanFocus = value;
+                _canFocus = value;
 
 
                 switch (value)
                 switch (value)
                 {
                 {

+ 0 - 7
Terminal.Gui/Views/TextField.cs

@@ -434,13 +434,6 @@ public class TextField : View
     /// </summary>
     /// </summary>
     public IAutocomplete Autocomplete { get; set; }
     public IAutocomplete Autocomplete { get; set; }
 
 
-    /// <inheritdoc/>
-    public sealed override bool CanFocus
-    {
-        get => base.CanFocus;
-        set => base.CanFocus = value;
-    }
-
     /// <summary>
     /// <summary>
     ///     Gets or sets the text to render in control when no value has been entered yet and the <see cref="View"/> does
     ///     Gets or sets the text to render in control when no value has been entered yet and the <see cref="View"/> does
     ///     not yet have input focus.
     ///     not yet have input focus.

+ 0 - 7
Terminal.Gui/Views/TextView.cs

@@ -2598,13 +2598,6 @@ public class TextView : View
         }
         }
     }
     }
 
 
-    /// <inheritdoc/>
-    public override bool CanFocus
-    {
-        get => base.CanFocus;
-        set => base.CanFocus = value;
-    }
-
     /// <summary>Get the <see cref="ContextMenu"/> for this view.</summary>
     /// <summary>Get the <see cref="ContextMenu"/> for this view.</summary>
     public ContextMenu? ContextMenu { get; }
     public ContextMenu? ContextMenu { get; }
 
 

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

@@ -139,7 +139,7 @@ public partial class Toplevel : View
 
 
     /// <summary>Gets or sets a value indicating whether this <see cref="Toplevel"/> can focus.</summary>
     /// <summary>Gets or sets a value indicating whether this <see cref="Toplevel"/> can focus.</summary>
     /// <value><c>true</c> if can focus; otherwise, <c>false</c>.</value>
     /// <value><c>true</c> if can focus; otherwise, <c>false</c>.</value>
-    public override bool CanFocus => SuperView is null ? true : base.CanFocus;
+    //public override bool CanFocus => SuperView is null ? true : base.CanFocus;
 
 
     /// <summary>
     /// <summary>
     ///     <see langword="true"/> if was already loaded by the <see cref="Application.Begin(Toplevel)"/>
     ///     <see langword="true"/> if was already loaded by the <see cref="Application.Begin(Toplevel)"/>

+ 63 - 55
UICatalog/Scenarios/Adornments.cs

@@ -17,7 +17,7 @@ public class Adornments : Scenario
         ConfigurationManager.Themes.Theme = Theme;
         ConfigurationManager.Themes.Theme = Theme;
         ConfigurationManager.Apply ();
         ConfigurationManager.Apply ();
         Application.Top.ColorScheme = Colors.ColorSchemes [TopLevelColorScheme];
         Application.Top.ColorScheme = Colors.ColorSchemes [TopLevelColorScheme];
-        
+
         var view = new Window { Title = "The _Window" };
         var view = new Window { Title = "The _Window" };
         var tf1 = new TextField { Width = 10, Text = "TextField" };
         var tf1 = new TextField { Width = 10, Text = "TextField" };
         var color = new ColorPicker { Title = "BG", BoxHeight = 1, BoxWidth = 1, X = Pos.AnchorEnd (11) };
         var color = new ColorPicker { Title = "BG", BoxHeight = 1, BoxWidth = 1, X = Pos.AnchorEnd (11) };
@@ -25,19 +25,19 @@ public class Adornments : Scenario
 
 
         color.ColorChanged += (s, e) =>
         color.ColorChanged += (s, e) =>
                               {
                               {
-                                  color.SuperView.ColorScheme = new ColorScheme (color.SuperView.ColorScheme)
+                                  color.SuperView.ColorScheme = new (color.SuperView.ColorScheme)
                                   {
                                   {
-                                      Normal = new Attribute (
-                                                              color.SuperView.ColorScheme.Normal.Foreground,
-                                                              e.Color
-                                                             )
+                                      Normal = new (
+                                                    color.SuperView.ColorScheme.Normal.Foreground,
+                                                    e.Color
+                                                   )
                                   };
                                   };
                               };
                               };
 
 
         var button = new Button { X = Pos.Center (), Y = Pos.Center (), Text = "Press me!" };
         var button = new Button { X = Pos.Center (), Y = Pos.Center (), Text = "Press me!" };
 
 
         button.Accept += (s, e) =>
         button.Accept += (s, e) =>
-                              MessageBox.Query (20, 7, "Hi", $"Am I a {view.GetType ().Name}?", "Yes", "No");
+                             MessageBox.Query (20, 7, "Hi", $"Am I a {view.GetType ().Name}?", "Yes", "No");
 
 
         var label = new TextView
         var label = new TextView
         {
         {
@@ -48,7 +48,7 @@ public class Adornments : Scenario
             Width = 40,
             Width = 40,
             Height = 6 // TODO: Use Dim.Auto
             Height = 6 // TODO: Use Dim.Auto
         };
         };
-        label.Border.Thickness = new Thickness (1, 3, 1, 1);
+        label.Border.Thickness = new (1, 3, 1, 1);
 
 
         var btnButtonInWindow = new Button { X = Pos.AnchorEnd (10), Y = Pos.AnchorEnd (1), Text = "Button" };
         var btnButtonInWindow = new Button { X = Pos.AnchorEnd (10), Y = Pos.AnchorEnd (1), Text = "Button" };
 
 
@@ -62,31 +62,39 @@ public class Adornments : Scenario
         };
         };
 
 
         view.Margin.Data = "Margin";
         view.Margin.Data = "Margin";
-        view.Margin.Thickness = new Thickness (3);
+        view.Margin.Thickness = new (3);
 
 
         view.Border.Data = "Border";
         view.Border.Data = "Border";
-        view.Border.Thickness = new Thickness (3);
+        view.Border.Thickness = new (3);
 
 
         view.Padding.Data = "Padding";
         view.Padding.Data = "Padding";
-        view.Padding.Thickness = new Thickness (3);
+        view.Padding.Thickness = new (3);
 
 
         view.Add (tf1, color, button, label, btnButtonInWindow, tv);
         view.Add (tf1, color, button, label, btnButtonInWindow, tv);
 
 
         var editor = new AdornmentsEditor
         var editor = new AdornmentsEditor
         {
         {
             Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}",
             Title = $"{Application.QuitKey} to Quit - Scenario: {GetName ()}",
-            ColorScheme = Colors.ColorSchemes [TopLevelColorScheme],
+            ColorScheme = Colors.ColorSchemes [TopLevelColorScheme]
+
             //BorderStyle = LineStyle.None,
             //BorderStyle = LineStyle.None,
         };
         };
         view.X = 36;
         view.X = 36;
         view.Y = 0;
         view.Y = 0;
-        view.Width = Dim.Percent(60);
-        view.Height = Dim.Percent(80);
+        view.Width = Dim.Percent (60);
+        view.Height = Dim.Percent (80);
 
 
         editor.Initialized += (s, e) => { editor.ViewToEdit = view; };
         editor.Initialized += (s, e) => { editor.ViewToEdit = view; };
 
 
-        var btnButtonInPadding = new Button { X = Pos.Center(), Y = 0, Text = "Button in Padding" };
-        btnButtonInPadding.Accept += (s, e) => MessageBox.Query (20, 7, "Hi", "I'm in the padding", "Ok");
+        var labelInPadding = new Label () { X = 1, Y = 0, Title = "_Text:" };
+        view.Padding.Add (labelInPadding);
+
+        var textFieldInPadding = new TextField () { X = Pos.Right (labelInPadding) + 1, Y = Pos.Top (labelInPadding), Width = 15, Text = "some text" };
+        textFieldInPadding.Accept += (s, e) => MessageBox.Query (20, 7, "TextField", textFieldInPadding.Text, "Ok");
+        view.Padding.Add (textFieldInPadding);
+
+        var btnButtonInPadding = new Button { X = Pos.Center (), Y = 1, Text = "_Button in Padding" };
+        btnButtonInPadding.Accept += (s, e) => MessageBox.Query (20, 7, "Hi", "Button in Padding Pressed!", "Ok");
         view.Padding.Add (btnButtonInPadding);
         view.Padding.Add (btnButtonInPadding);
 
 
         Application.Run (editor);
         Application.Run (editor);
@@ -124,7 +132,7 @@ public class Adornments : Scenario
 
 
         public AdornmentEditor ()
         public AdornmentEditor ()
         {
         {
-            Margin.Thickness = new Thickness (0);
+            Margin.Thickness = new (0);
             BorderStyle = LineStyle.Double;
             BorderStyle = LineStyle.Double;
             Initialized += AdornmentEditor_Initialized;
             Initialized += AdornmentEditor_Initialized;
         }
         }
@@ -150,7 +158,7 @@ public class Adornments : Scenario
                 }
                 }
 
 
                 _thickness = value;
                 _thickness = value;
-                ThicknessChanged?.Invoke (this, new ThicknessEventArgs { Thickness = Thickness });
+                ThicknessChanged?.Invoke (this, new() { Thickness = Thickness });
 
 
                 if (IsInitialized)
                 if (IsInitialized)
                 {
                 {
@@ -188,12 +196,12 @@ public class Adornments : Scenario
         {
         {
             var editWidth = 3;
             var editWidth = 3;
 
 
-            _topEdit = new TextField { X = Pos.Center (), Y = 0, Width = editWidth };
+            _topEdit = new() { X = Pos.Center (), Y = 0, Width = editWidth };
 
 
             _topEdit.Accept += Edit_Accept;
             _topEdit.Accept += Edit_Accept;
             Add (_topEdit);
             Add (_topEdit);
 
 
-            _leftEdit = new TextField
+            _leftEdit = new()
             {
             {
                 X = Pos.Left (_topEdit) - editWidth, Y = Pos.Bottom (_topEdit), Width = editWidth
                 X = Pos.Left (_topEdit) - editWidth, Y = Pos.Bottom (_topEdit), Width = editWidth
             };
             };
@@ -201,12 +209,12 @@ public class Adornments : Scenario
             _leftEdit.Accept += Edit_Accept;
             _leftEdit.Accept += Edit_Accept;
             Add (_leftEdit);
             Add (_leftEdit);
 
 
-            _rightEdit = new TextField { X = Pos.Right (_topEdit), Y = Pos.Bottom (_topEdit), Width = editWidth };
+            _rightEdit = new() { X = Pos.Right (_topEdit), Y = Pos.Bottom (_topEdit), Width = editWidth };
 
 
             _rightEdit.Accept += Edit_Accept;
             _rightEdit.Accept += Edit_Accept;
             Add (_rightEdit);
             Add (_rightEdit);
 
 
-            _bottomEdit = new TextField { X = Pos.Center (), Y = Pos.Bottom (_leftEdit), Width = editWidth };
+            _bottomEdit = new() { X = Pos.Center (), Y = Pos.Bottom (_leftEdit), Width = editWidth };
 
 
             _bottomEdit.Accept += Edit_Accept;
             _bottomEdit.Accept += Edit_Accept;
             Add (_bottomEdit);
             Add (_bottomEdit);
@@ -215,7 +223,7 @@ public class Adornments : Scenario
 
 
             copyTop.Accept += (s, e) =>
             copyTop.Accept += (s, e) =>
                               {
                               {
-                                  Thickness = new Thickness (Thickness.Top);
+                                  Thickness = new (Thickness.Top);
 
 
                                   if (string.IsNullOrEmpty (_topEdit.Text))
                                   if (string.IsNullOrEmpty (_topEdit.Text))
                                   {
                                   {
@@ -234,10 +242,10 @@ public class Adornments : Scenario
             _foregroundColorPicker.ColorChanged += (o, a) =>
             _foregroundColorPicker.ColorChanged += (o, a) =>
                                                        AttributeChanged?.Invoke (
                                                        AttributeChanged?.Invoke (
                                                                                  this,
                                                                                  this,
-                                                                                 new Attribute (
-                                                                                                _foregroundColorPicker.SelectedColor,
-                                                                                                _backgroundColorPicker.SelectedColor
-                                                                                               )
+                                                                                 new (
+                                                                                      _foregroundColorPicker.SelectedColor,
+                                                                                      _backgroundColorPicker.SelectedColor
+                                                                                     )
                                                                                 );
                                                                                 );
             Add (_foregroundColorPicker);
             Add (_foregroundColorPicker);
 
 
@@ -249,10 +257,10 @@ public class Adornments : Scenario
             _backgroundColorPicker.ColorChanged += (o, a) =>
             _backgroundColorPicker.ColorChanged += (o, a) =>
                                                        AttributeChanged?.Invoke (
                                                        AttributeChanged?.Invoke (
                                                                                  this,
                                                                                  this,
-                                                                                 new Attribute (
-                                                                                                _foregroundColorPicker.SelectedColor,
-                                                                                                _backgroundColorPicker.SelectedColor
-                                                                                               )
+                                                                                 new (
+                                                                                      _foregroundColorPicker.SelectedColor,
+                                                                                      _backgroundColorPicker.SelectedColor
+                                                                                     )
                                                                                 );
                                                                                 );
             Add (_backgroundColorPicker);
             Add (_backgroundColorPicker);
 
 
@@ -264,17 +272,17 @@ public class Adornments : Scenario
             LayoutSubviews ();
             LayoutSubviews ();
             Height = GetAdornmentsThickness ().Vertical + 4 + 4;
             Height = GetAdornmentsThickness ().Vertical + 4 + 4;
             Width = GetAdornmentsThickness ().Horizontal + _foregroundColorPicker.Frame.Width * 2 - 3;
             Width = GetAdornmentsThickness ().Horizontal + _foregroundColorPicker.Frame.Width * 2 - 3;
-
-
         }
         }
 
 
         private void Edit_Accept (object sender, CancelEventArgs e)
         private void Edit_Accept (object sender, CancelEventArgs e)
         {
         {
             e.Cancel = true;
             e.Cancel = true;
-            Thickness = new Thickness(int.Parse(_leftEdit.Text),
-                                      int.Parse(_topEdit.Text),
-                                      int.Parse (_rightEdit.Text),
-                                      int.Parse (_bottomEdit.Text));
+
+            Thickness = new (
+                             int.Parse (_leftEdit.Text),
+                             int.Parse (_topEdit.Text),
+                             int.Parse (_rightEdit.Text),
+                             int.Parse (_bottomEdit.Text));
         }
         }
     }
     }
 
 
@@ -295,26 +303,26 @@ public class Adornments : Scenario
                 _origTitle = value.Title;
                 _origTitle = value.Title;
                 _viewToEdit = value;
                 _viewToEdit = value;
 
 
-                _marginEditor = new AdornmentEditor
+                _marginEditor = new()
                 {
                 {
                     X = 0,
                     X = 0,
                     Y = 0,
                     Y = 0,
                     Title = "_Margin",
                     Title = "_Margin",
                     Thickness = _viewToEdit.Margin.Thickness,
                     Thickness = _viewToEdit.Margin.Thickness,
-                    Color = new Attribute (_viewToEdit.Margin.ColorScheme.Normal),
+                    Color = new (_viewToEdit.Margin.ColorScheme.Normal),
                     SuperViewRendersLineCanvas = true
                     SuperViewRendersLineCanvas = true
                 };
                 };
                 _marginEditor.ThicknessChanged += Editor_ThicknessChanged;
                 _marginEditor.ThicknessChanged += Editor_ThicknessChanged;
                 _marginEditor.AttributeChanged += Editor_AttributeChanged;
                 _marginEditor.AttributeChanged += Editor_AttributeChanged;
                 Add (_marginEditor);
                 Add (_marginEditor);
 
 
-                _borderEditor = new AdornmentEditor
+                _borderEditor = new()
                 {
                 {
                     X = Pos.Left (_marginEditor),
                     X = Pos.Left (_marginEditor),
                     Y = Pos.Bottom (_marginEditor),
                     Y = Pos.Bottom (_marginEditor),
                     Title = "B_order",
                     Title = "B_order",
                     Thickness = _viewToEdit.Border.Thickness,
                     Thickness = _viewToEdit.Border.Thickness,
-                    Color = new Attribute (_viewToEdit.Border.ColorScheme.Normal),
+                    Color = new (_viewToEdit.Border.ColorScheme.Normal),
                     SuperViewRendersLineCanvas = true
                     SuperViewRendersLineCanvas = true
                 };
                 };
                 _borderEditor.ThicknessChanged += Editor_ThicknessChanged;
                 _borderEditor.ThicknessChanged += Editor_ThicknessChanged;
@@ -345,19 +353,19 @@ public class Adornments : Scenario
 
 
                                                          if (_viewToEdit.Border.LineStyle == LineStyle.None)
                                                          if (_viewToEdit.Border.LineStyle == LineStyle.None)
                                                          {
                                                          {
-                                                             _viewToEdit.Border.Thickness = new Thickness (0);
+                                                             _viewToEdit.Border.Thickness = new (0);
                                                          }
                                                          }
                                                          else if (prevBorderStyle == LineStyle.None && _viewToEdit.Border.LineStyle != LineStyle.None)
                                                          else if (prevBorderStyle == LineStyle.None && _viewToEdit.Border.LineStyle != LineStyle.None)
                                                          {
                                                          {
-                                                             _viewToEdit.Border.Thickness = new Thickness (1);
+                                                             _viewToEdit.Border.Thickness = new (1);
                                                          }
                                                          }
 
 
-                                                         _borderEditor.Thickness = new Thickness (
-                                                                                                  _viewToEdit.Border.Thickness.Left,
-                                                                                                  _viewToEdit.Border.Thickness.Top,
-                                                                                                  _viewToEdit.Border.Thickness.Right,
-                                                                                                  _viewToEdit.Border.Thickness.Bottom
-                                                                                                 );
+                                                         _borderEditor.Thickness = new (
+                                                                                        _viewToEdit.Border.Thickness.Left,
+                                                                                        _viewToEdit.Border.Thickness.Top,
+                                                                                        _viewToEdit.Border.Thickness.Right,
+                                                                                        _viewToEdit.Border.Thickness.Bottom
+                                                                                       );
                                                          _viewToEdit.SetNeedsDisplay ();
                                                          _viewToEdit.SetNeedsDisplay ();
                                                          LayoutSubviews ();
                                                          LayoutSubviews ();
                                                      };
                                                      };
@@ -387,20 +395,20 @@ public class Adornments : Scenario
                                     };
                                     };
                 Add (ckbTitle);
                 Add (ckbTitle);
 
 
-                _paddingEditor = new AdornmentEditor
+                _paddingEditor = new()
                 {
                 {
                     X = Pos.Left (_borderEditor),
                     X = Pos.Left (_borderEditor),
                     Y = Pos.Bottom (rbBorderStyle),
                     Y = Pos.Bottom (rbBorderStyle),
                     Title = "_Padding",
                     Title = "_Padding",
                     Thickness = _viewToEdit.Padding.Thickness,
                     Thickness = _viewToEdit.Padding.Thickness,
-                    Color = new Attribute (_viewToEdit.Padding.ColorScheme.Normal),
+                    Color = new (_viewToEdit.Padding.ColorScheme.Normal),
                     SuperViewRendersLineCanvas = true
                     SuperViewRendersLineCanvas = true
                 };
                 };
                 _paddingEditor.ThicknessChanged += Editor_ThicknessChanged;
                 _paddingEditor.ThicknessChanged += Editor_ThicknessChanged;
                 _paddingEditor.AttributeChanged += Editor_AttributeChanged;
                 _paddingEditor.AttributeChanged += Editor_AttributeChanged;
                 Add (_paddingEditor);
                 Add (_paddingEditor);
 
 
-                _diagCheckBox = new CheckBox { Text = "_Diagnostics", Y = Pos.Bottom (_paddingEditor) };
+                _diagCheckBox = new() { Text = "_Diagnostics", Y = Pos.Bottom (_paddingEditor) };
 
 
                 _diagCheckBox.Toggled += (s, e) =>
                 _diagCheckBox.Toggled += (s, e) =>
                                          {
                                          {
@@ -437,16 +445,16 @@ public class Adornments : Scenario
             switch (sender.ToString ())
             switch (sender.ToString ())
             {
             {
                 case var s when s == _marginEditor.ToString ():
                 case var s when s == _marginEditor.ToString ():
-                    _viewToEdit.Margin.ColorScheme = new ColorScheme (_viewToEdit.Margin.ColorScheme) { Normal = attr };
+                    _viewToEdit.Margin.ColorScheme = new (_viewToEdit.Margin.ColorScheme) { Normal = attr };
 
 
                     break;
                     break;
                 case var s when s == _borderEditor.ToString ():
                 case var s when s == _borderEditor.ToString ():
-                    _viewToEdit.Border.ColorScheme = new ColorScheme (_viewToEdit.Border.ColorScheme) { Normal = attr };
+                    _viewToEdit.Border.ColorScheme = new (_viewToEdit.Border.ColorScheme) { Normal = attr };
 
 
                     break;
                     break;
                 case var s when s == _paddingEditor.ToString ():
                 case var s when s == _paddingEditor.ToString ():
                     _viewToEdit.Padding.ColorScheme =
                     _viewToEdit.Padding.ColorScheme =
-                        new ColorScheme (_viewToEdit.Padding.ColorScheme) { Normal = attr };
+                        new (_viewToEdit.Padding.ColorScheme) { Normal = attr };
 
 
                     break;
                     break;
             }
             }

+ 0 - 1
UnitTests/Input/ResponderTests.cs

@@ -222,7 +222,6 @@ public class ResponderTests
         var r = new Responder ();
         var r = new Responder ();
         Assert.NotNull (r);
         Assert.NotNull (r);
         Assert.Equal ("Terminal.Gui.Responder", r.ToString ());
         Assert.Equal ("Terminal.Gui.Responder", r.ToString ());
-        Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
         Assert.False (r.HasFocus);
         Assert.True (r.Enabled);
         Assert.True (r.Enabled);
         Assert.True (r.Visible);
         Assert.True (r.Visible);