Removed OverlappedTop.

Updated unit tess.
Fixed bad code paths.
This commit is contained in:
Tig
2024-09-17 17:20:19 -06:00
parent 86d21ef3b7
commit b717892235
43 changed files with 400 additions and 4123 deletions

View File

@@ -1103,7 +1103,7 @@ public class DialogTests
_output
);
Assert.True (Current.NewKeyDownEvent (Key.Enter));
Assert.True (Top!.NewKeyDownEvent (Key.Enter));
}
else if (iterations == 3)
{
@@ -1199,104 +1199,85 @@ public class DialogTests
d.Dispose ();
}
[Fact]
[AutoInitShutdown]
public void Location_When_Not_Application_Top_Not_Default ()
{
var top = new Toplevel ();
top.BorderStyle = LineStyle.Double;
// [Fact]
// [AutoInitShutdown]
// public void Location_When_Not_Application_Top_Not_Default ()
// {
// var top = new Toplevel ();
// top.BorderStyle = LineStyle.Double;
int iterations = -1;
// int iterations = -1;
// Override CM
Window.DefaultBorderStyle = LineStyle.Single;
Dialog.DefaultButtonAlignment = Alignment.Center;
Dialog.DefaultBorderStyle = LineStyle.Single;
// // Override CM
// Window.DefaultBorderStyle = LineStyle.Single;
// Dialog.DefaultButtonAlignment = Alignment.Center;
// Dialog.DefaultBorderStyle = LineStyle.Single;
// Dialog.DefaultShadow = ShadowStyle.None;
Iteration += (s, a) =>
{
iterations++;
// Iteration += (s, a) =>
// {
// iterations++;
if (iterations == 0)
{
var d = new Dialog { X = 5, Y = 5, Height = 3, Width = 5 };
RunState rs = Begin (d);
// if (iterations == 0)
// {
// var d = new Dialog { X = 5, Y = 5, Height = 3, Width = 5 };
// RunState rs = Begin (d);
Assert.Equal (new (5, 5), d.Frame.Location);
// Assert.Equal (new (5, 5), d.Frame.Location);
TestHelpers.AssertDriverContentsWithFrameAre (
@"
╔══════════════════╗
║ ║
║ ║
║ ║
║ ║
║ ┌───┐ ║
║ │ │ ║
║ └───┘ ║
║ ║
╚══════════════════╝",
_output
);
End (rs);
d.Dispose ();
// TestHelpers.AssertDriverContentsWithFrameAre (
// @"
//╔══════════════════╗
//║ ║
//║ ║
//║ ║
//║ ║
//║ ┌───┐ ║
//║ │ │ ║
//║ └───┘ ║
//║ ║
//╚══════════════════╝",
// _output
// );
// End (rs);
// d.Dispose ();
d = new ()
{
X = 5, Y = 5,
Width = Dim.Percent (85),
Height = Dim.Percent (85)
// d = new ()
// {
// X = 5, Y = 5,
// Width = Dim.Percent (85),
// Height = Dim.Percent (85)
};
rs = Begin (d);
// };
// rs = Begin (d);
// This is because of PostionTopLevels and EnsureVisibleBounds
Assert.Equal (new (3, 2), d.Frame.Location);
// TestHelpers.AssertDriverContentsWithFrameAre (
// @"
//╔══════════════════╗
//║ ║
//║ ║
//║ ║
//║ ║
//║ ┌──────────────
//║ │
//║ │
//║ │
//╚════│ ",
// _output
// );
// End (rs);
// d.Dispose ();
// }
// else if (iterations > 0)
// {
// RequestStop ();
// }
// };
// #3127: Before
// Assert.Equal (new (17, 8), d.Frame.Size);
// TestHelpers.AssertDriverContentsWithFrameAre (@"
//╔══════════════════╗
//║ ║
//║ ┌───────────────┐
//║ │ │
//║ │ │
//║ │ │
//║ │ │
//║ │ │
//║ │ │
//╚══└───────────────┘", _output);
// #3127: After: Because Toplevel is now Width/Height = Dim.Filll
Assert.Equal (new (15, 6), d.Frame.Size);
TestHelpers.AssertDriverContentsWithFrameAre (
@"
╔══════════════════╗
║ ║
║ ┌─────────────┐ ║
║ │ │ ║
║ │ │ ║
║ │ │ ║
║ │ │ ║
║ └─────────────┘ ║
║ ║
╚══════════════════╝",
_output
);
End (rs);
d.Dispose ();
}
else if (iterations > 0)
{
RequestStop ();
}
};
((FakeDriver)Driver).SetBufferSize (20, 10);
Run (top);
top.Dispose ();
}
// ((FakeDriver)Driver).SetBufferSize (20, 10);
// Run (top);
// top.Dispose ();
// }
[Fact]
[AutoInitShutdown]