Remove constructors with frame parameters from TextField class.

This commit is contained in:
BDisp
2024-01-16 00:05:30 +00:00
parent 86c86069e6
commit 25b539cdf9
5 changed files with 6 additions and 13 deletions

View File

@@ -47,15 +47,6 @@ public class TextField : View {
/// <param name="text">Initial text contents.</param>
public TextField (string text) : base (text) => SetInitialProperties (text, text.GetRuneCount () + 1);
/// <summary>
/// Initializes a new instance of the <see cref="TextField"/> class using <see cref="LayoutStyle.Absolute"/> positioning.
/// </summary>
/// <param name="x">The x coordinate.</param>
/// <param name="y">The y coordinate.</param>
/// <param name="w">The width.</param>
/// <param name="text">Initial text contents.</param>
public TextField (int x, int y, int w, string text) : base (new Rect (x, y, w, 1)) => SetInitialProperties (text, w);
/// <summary>
/// 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

View File

@@ -16,7 +16,9 @@ public class Buttons : Scenario {
};
Win.Add (editLabel);
// Add a TextField using Absolute layout.
var edit = new TextField (31, 0, 15, "") {
var edit = new TextField ("") {
X = 31,
Width = 15,
HotKey = Key.Y.WithAlt,
};
Win.Add (edit);

View File

@@ -15,7 +15,7 @@ public class LabelsAsLabels : Scenario {
};
Win.Add (editLabel);
// Add a TextField using Absolute layout.
var edit = new TextField (31, 0, 15, "");
var edit = new TextField ("") { X = 31, Width = 15 };
Win.Add (edit);
// This is the default Label (IsDefault = true); if user presses ENTER in the TextField

View File

@@ -73,7 +73,7 @@ public class Threading : Scenario {
ColorScheme = Colors.TopLevel
};
var text = new TextField (1, 3, 100, "Type anything after press the button");
var text = new TextField ("Type anything after press the button") { X = 1, Y = 3, Width = 100 };
var _btnAction = new Button ("Load Data Action") { X = 80, Y = 10 };
_btnAction.Clicked += (s, e) => _action.Invoke ();

View File

@@ -163,7 +163,7 @@ public class WindowsAndFrameViews : Scenario {
ColorScheme = Colors.Base,
Text = "The Text in the FrameView",
};
subFrameViewofFV.Add (new TextField (0, 0, 15, "Edit Me"));
subFrameViewofFV.Add (new TextField ("Edit Me") { Width = 15 });
subFrameViewofFV.Add (new CheckBox ("Check me") { Y = 1 });
// BUGBUG: This checkbox is not shown even though frameViewFV has 3 rows in