mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Implement new Dim/Pos capabilities, referencing the elements of another view
This commit is contained in:
@@ -92,12 +92,33 @@ static class Demo {
|
||||
|
||||
Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (300), timer);
|
||||
|
||||
|
||||
// A little convoluted, this is because I am using this to test the
|
||||
// layout based on referencing elements of another view:
|
||||
|
||||
var login = new Label ("Login: ") { X = 3, Y = 6 };
|
||||
var password = new Label ("Password: ") {
|
||||
X = Pos.Left (login),
|
||||
Y = Pos.Bottom (login) + 1
|
||||
};
|
||||
var loginText = new TextField ("") {
|
||||
X = Pos.Right (password),
|
||||
Y = Pos.Top (login),
|
||||
Width = 40
|
||||
};
|
||||
var passText = new TextField ("") {
|
||||
Secret = true,
|
||||
X = Pos.Left (loginText),
|
||||
Y = Pos.Top (password),
|
||||
Width = Dim.Width (loginText)
|
||||
};
|
||||
|
||||
// Add some content
|
||||
container.Add (
|
||||
new Label (3, 6, "Login: "),
|
||||
new TextField (14, 6, 40, ""),
|
||||
new Label (3, 8, "Password: "),
|
||||
new TextField (14, 8, 40, "") { Secret = true },
|
||||
login,
|
||||
loginText,
|
||||
password,
|
||||
passText,
|
||||
new FrameView (new Rect (3, 10, 25, 6), "Options"){
|
||||
new CheckBox (1, 0, "Remember me"),
|
||||
new RadioGroup (1, 2, new [] { "_Personal", "_Company" }),
|
||||
|
||||
Reference in New Issue
Block a user