diff --git a/Terminal.Gui/Views/CheckBox.cs b/Terminal.Gui/Views/CheckBox.cs index 3a0da8438..4c35b76b8 100644 --- a/Terminal.Gui/Views/CheckBox.cs +++ b/Terminal.Gui/Views/CheckBox.cs @@ -46,29 +46,6 @@ public class CheckBox : View { SetInitialProperties (s, is_checked); } - /// - /// Initializes a new instance of using layout. - /// - /// - /// The size of is computed based on the - /// text length. This is not toggled. - /// - public CheckBox (int x, int y, string s) : this (x, y, s, false) - { - } - - /// - /// Initializes a new instance of using layout. - /// - /// - /// The size of is computed based on the - /// text length. - /// - public CheckBox (int x, int y, string s, bool is_checked) : base (new Rect (x, y, s.Length, 1)) - { - SetInitialProperties (s, is_checked); - } - // TODO: v2 - Remove constructors with parameters /// /// Private helper to set the initial properties of the View that were provided via constructors. diff --git a/UICatalog/Scenarios/WindowsAndFrameViews.cs b/UICatalog/Scenarios/WindowsAndFrameViews.cs index 99c0cf678..398c8b401 100644 --- a/UICatalog/Scenarios/WindowsAndFrameViews.cs +++ b/UICatalog/Scenarios/WindowsAndFrameViews.cs @@ -151,8 +151,8 @@ namespace UICatalog.Scenarios { ColorScheme = Colors.Error }); - subWinofFV.Add (new CheckBox (0, 1, "Check me")); - subWinofFV.Add (new CheckBox (0, 2, "Or, Check me")); + subWinofFV.Add (new CheckBox ("Check me") { Y = 1 }); + subWinofFV.Add (new CheckBox ("Or, Check me") { Y = 2 }); frame.Add (subWinofFV); var subFrameViewofFV = new FrameView ("this is a Sub-FrameView") { @@ -165,10 +165,10 @@ namespace UICatalog.Scenarios { }; subFrameViewofFV.Add (new TextField (0, 0, 15, "Edit Me")); - subFrameViewofFV.Add (new CheckBox (0, 1, "Check me")); + subFrameViewofFV.Add (new CheckBox ("Check me") { Y = 1 }); // BUGBUG: This checkbox is not shown even though frameViewFV has 3 rows in // its client area. #522 - subFrameViewofFV.Add (new CheckBox (0, 2, "Or, Check me")); + subFrameViewofFV.Add (new CheckBox ("Or, Check me") { Y = 2 }); frame.Add (new CheckBox ("Btn1 (Y = Pos.AnchorEnd (1))") { X = 0, diff --git a/UnitTests/Views/CheckBoxTests.cs b/UnitTests/Views/CheckBoxTests.cs index 9659dffcb..306087e39 100644 --- a/UnitTests/Views/CheckBoxTests.cs +++ b/UnitTests/Views/CheckBoxTests.cs @@ -36,7 +36,7 @@ namespace Terminal.Gui.ViewsTests { Assert.True (ckb.CanFocus); Assert.Equal (new Rect (0, 0, 6, 1), ckb.Frame); - ckb = new CheckBox (1, 2, "Test"); + ckb = new CheckBox ("Test") { X = 1, Y = 2 }; Assert.True (ckb.AutoSize); Assert.False (ckb.Checked); Assert.False (ckb.AllowNullChecked); @@ -45,7 +45,7 @@ namespace Terminal.Gui.ViewsTests { Assert.True (ckb.CanFocus); Assert.Equal (new Rect (1, 2, 6, 1), ckb.Frame); - ckb = new CheckBox (3, 4, "Test", true); + ckb = new CheckBox ("Test", true) { X = 3, Y = 4 }; Assert.True (ckb.AutoSize); Assert.True (ckb.Checked); Assert.False (ckb.AllowNullChecked);