|
@@ -6,7 +6,8 @@ namespace UICatalog {
|
|
|
[ScenarioMetadata (Name: "Windows & FrameViews", Description: "Shows Windows, sub-Windows, FrameViews, and how TAB doesn't work right (#434, #522)")]
|
|
|
[ScenarioCategory ("Views")]
|
|
|
[ScenarioCategory ("Layout")]
|
|
|
- class WindowExperiment : Scenario {
|
|
|
+ [ScenarioCategory ("Bug Repro")]
|
|
|
+ class WindowsAndFrameViews : Scenario {
|
|
|
public override void Init (Toplevel top)
|
|
|
{
|
|
|
Application.Init ();
|
|
@@ -37,28 +38,33 @@ namespace UICatalog {
|
|
|
X = Pos.Center (),
|
|
|
Y = 1,
|
|
|
Width = Dim.Fill (10),
|
|
|
- Height = Dim.Percent (20),
|
|
|
+ Height = Dim.Percent (15),
|
|
|
};
|
|
|
Win.ColorScheme = Colors.Dialog;
|
|
|
- Win.Add (new Button ("Press me!") {
|
|
|
+ Win.Add (new Button ("Press me! (Y = 0)") {
|
|
|
X = Pos.Center (),
|
|
|
Y = 0,
|
|
|
ColorScheme = Colors.Error,
|
|
|
Clicked = () => MessageBox.ErrorQuery (30, 10, Win.Title.ToString (), "Neat?", "Yes", "No")
|
|
|
});
|
|
|
+ Win.Add (new Button ("Press ME! (Y = Pos.AnchorEnd(1))") {
|
|
|
+ X = Pos.Center (),
|
|
|
+ Y = Pos.AnchorEnd(1),
|
|
|
+ ColorScheme = Colors.Error
|
|
|
+ });
|
|
|
Top.Add (Win);
|
|
|
listWin.Add (Win);
|
|
|
|
|
|
for (var i = 0; i < 2; i++) {
|
|
|
Window win = null;
|
|
|
- win = new Window ($"{listWin.Count} - Scenario: {GetName ()}", padding) {
|
|
|
+ win = new Window ($"{listWin.Count} - Loop {i}", padding) {
|
|
|
X = margin,
|
|
|
Y = Pos.Bottom (listWin.Last ()) + (margin),
|
|
|
Width = Dim.Fill (margin),
|
|
|
Height = height,
|
|
|
};
|
|
|
win.ColorScheme = Colors.Dialog;
|
|
|
- win.Add (new Button ("Press me!") {
|
|
|
+ win.Add (new Button ("Press me! (Y = 0)") {
|
|
|
X = Pos.Center (),
|
|
|
Y = 0,
|
|
|
ColorScheme = Colors.Error,
|
|
@@ -66,7 +72,7 @@ namespace UICatalog {
|
|
|
});
|
|
|
var subWin = new Window ("Sub Window") {
|
|
|
X = Pos.Percent (0),
|
|
|
- Y = Pos.AnchorEnd () - 5,
|
|
|
+ Y = 1,
|
|
|
Width = Dim.Percent (50),
|
|
|
Height = 5,
|
|
|
ColorScheme = Colors.Base,
|
|
@@ -77,7 +83,7 @@ namespace UICatalog {
|
|
|
win.Add (subWin);
|
|
|
var frameView = new FrameView ("This is a Sub-FrameView") {
|
|
|
X = Pos.Percent (50),
|
|
|
- Y = Pos.AnchorEnd () - 5,
|
|
|
+ Y = 1,
|
|
|
Width = Dim.Percent (100),
|
|
|
Height = 5,
|
|
|
ColorScheme = Colors.Base,
|
|
@@ -98,47 +104,52 @@ namespace UICatalog {
|
|
|
Height = height,
|
|
|
};
|
|
|
frame.ColorScheme = Colors.Dialog;
|
|
|
- frame.Add (new Button ("Press me!") {
|
|
|
+ frame.Add (new Button ("Press me! (Y = 0)") {
|
|
|
X = Pos.Center (),
|
|
|
Y = 0,
|
|
|
ColorScheme = Colors.Error,
|
|
|
Clicked = () => MessageBox.ErrorQuery (30, 10, frame.Title.ToString (), "Neat?", "Yes", "No")
|
|
|
});
|
|
|
- var subWinFV = new Window ("this is a Sub-Window") {
|
|
|
+ var subWinofFV = new Window ("this is a Sub-Window") {
|
|
|
X = Pos.Percent (0),
|
|
|
- Y = Pos.AnchorEnd () - (height - 4),
|
|
|
+ Y = 1,
|
|
|
Width = Dim.Percent (50),
|
|
|
Height = Dim.Fill () - 1,
|
|
|
ColorScheme = Colors.Base,
|
|
|
};
|
|
|
- subWinFV.Add (new TextField (frame.Title.ToString ()) {
|
|
|
+ subWinofFV.Add (new TextField ("Edit Me") {
|
|
|
ColorScheme = Colors.Error
|
|
|
});
|
|
|
- frame.Add (subWinFV);
|
|
|
- var frameViewFV = new FrameView ("this is a Sub-FrameView") {
|
|
|
+
|
|
|
+ subWinofFV.Add (new CheckBox (0, 1, "Check me"));
|
|
|
+ subWinofFV.Add (new CheckBox (0, 2, "Or, Check me"));
|
|
|
+
|
|
|
+ frame.Add (subWinofFV);
|
|
|
+ var subFrameViewofFV = new FrameView ("this is a Sub-FrameView") {
|
|
|
X = Pos.Percent (50),
|
|
|
- Y = Pos.AnchorEnd () - (height - 4),
|
|
|
+ Y = 1,
|
|
|
Width = Dim.Percent (100),
|
|
|
Height = Dim.Fill () - 1,
|
|
|
ColorScheme = Colors.Base,
|
|
|
};
|
|
|
- frameViewFV.Add (new TextField ("Edit Me"));
|
|
|
+ subFrameViewofFV.Add (new TextField ("Edit Me"));
|
|
|
|
|
|
- frameViewFV.Add (new CheckBox (0, 1, "Check me"));
|
|
|
+ subFrameViewofFV.Add (new CheckBox (0, 1, "Check me"));
|
|
|
// BUGBUG: This checkbox is not shown even though frameViewFV has 3 rows in
|
|
|
- // it's client area. #522
|
|
|
- frameViewFV.Add (new CheckBox (0, 2, "Or, Check me"));
|
|
|
+ // its client area. #522
|
|
|
+ subFrameViewofFV.Add (new CheckBox (0, 2, "Or, Check me"));
|
|
|
|
|
|
- frame.Add (new CheckBox ("No, Check me!") {
|
|
|
+ frame.Add (new CheckBox ("Btn1 (Y = Pos.AnchorEnd (1))") {
|
|
|
X = 0,
|
|
|
- Y = Pos.AnchorEnd () - 1, // BUGBUG: #522 If I don't do the -1 it doesn't draw, but it should!
|
|
|
- });
|
|
|
- frame.Add (new CheckBox ("Really, Check me!") {
|
|
|
- X = Pos.Percent (50),
|
|
|
- Y = Pos.AnchorEnd () - 1, // BUGBUG: #522 If I don't do the -1 it doesn't draw, but it should!
|
|
|
+ Y = Pos.AnchorEnd (1),
|
|
|
});
|
|
|
+ CheckBox c = new CheckBox ("Btn2 (Y = Pos.AnchorEnd (1))") {
|
|
|
+ Y = Pos.AnchorEnd (1),
|
|
|
+ };
|
|
|
+ c.X = Pos.AnchorEnd () - (Pos.Right (c) - Pos.Left (c));
|
|
|
+ frame.Add (c);
|
|
|
|
|
|
- frame.Add (frameViewFV);
|
|
|
+ frame.Add (subFrameViewofFV);
|
|
|
|
|
|
Top.Add (frame);
|
|
|
listWin.Add (frame);
|