mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 01:07:58 +01:00
Remove constructors with frame parameters from CheckBox class.
This commit is contained in:
@@ -46,29 +46,6 @@ public class CheckBox : View {
|
||||
SetInitialProperties (s, is_checked);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of <see cref="CheckBox"/> using <see cref="LayoutStyle.Absolute"/> layout.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The size of <see cref="CheckBox"/> is computed based on the
|
||||
/// text length. This <see cref="CheckBox"/> is not toggled.
|
||||
/// </remarks>
|
||||
public CheckBox (int x, int y, string s) : this (x, y, s, false)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of <see cref="CheckBox"/> using <see cref="LayoutStyle.Absolute"/> layout.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The size of <see cref="CheckBox"/> is computed based on the
|
||||
/// text length.
|
||||
/// </remarks>
|
||||
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
|
||||
/// <summary>
|
||||
/// Private helper to set the initial properties of the View that were provided via constructors.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user