|
@@ -1385,14 +1385,14 @@ namespace Terminal.Gui.TopLevelTests {
|
|
public void Draw_A_Top_Subview_On_A_Dialog ()
|
|
public void Draw_A_Top_Subview_On_A_Dialog ()
|
|
{
|
|
{
|
|
var top = Application.Top;
|
|
var top = Application.Top;
|
|
- var win = new Window ("Window");
|
|
|
|
|
|
+ var win = new Window ();
|
|
top.Add (win);
|
|
top.Add (win);
|
|
Application.Begin (top);
|
|
Application.Begin (top);
|
|
((FakeDriver)Application.Driver).SetBufferSize (20, 20);
|
|
((FakeDriver)Application.Driver).SetBufferSize (20, 20);
|
|
|
|
|
|
Assert.Equal (new Rect (0, 0, 20, 20), win.Frame);
|
|
Assert.Equal (new Rect (0, 0, 20, 20), win.Frame);
|
|
TestHelpers.AssertDriverContentsWithFrameAre (@"
|
|
TestHelpers.AssertDriverContentsWithFrameAre (@"
|
|
-┌ Window ──────────┐
|
|
|
|
|
|
+┌──────────────────┐
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
@@ -1416,7 +1416,13 @@ namespace Terminal.Gui.TopLevelTests {
|
|
var btnPopup = new Button ("Popup");
|
|
var btnPopup = new Button ("Popup");
|
|
btnPopup.Clicked += (s, e) => {
|
|
btnPopup.Clicked += (s, e) => {
|
|
var viewToScreen = btnPopup.ViewToScreen (top.Frame);
|
|
var viewToScreen = btnPopup.ViewToScreen (top.Frame);
|
|
- var view = new View () { X = 1, Y = viewToScreen.Y + 1, Width = 18, Height = 5 };
|
|
|
|
|
|
+ var view = new View () {
|
|
|
|
+ X = 1,
|
|
|
|
+ Y = viewToScreen.Y + 1,
|
|
|
|
+ Width = 18,
|
|
|
|
+ Height = 5,
|
|
|
|
+ Border = new Border () { BorderStyle = BorderStyle.Single }
|
|
|
|
+ };
|
|
Application.Current.DrawContentComplete += Current_DrawContentComplete;
|
|
Application.Current.DrawContentComplete += Current_DrawContentComplete;
|
|
top.Add (view);
|
|
top.Add (view);
|
|
|
|
|
|
@@ -1424,28 +1430,31 @@ namespace Terminal.Gui.TopLevelTests {
|
|
{
|
|
{
|
|
Assert.Equal (new Rect (1, 14, 18, 5), view.Frame);
|
|
Assert.Equal (new Rect (1, 14, 18, 5), view.Frame);
|
|
|
|
|
|
- top.DrawFrame (view.Frame);
|
|
|
|
|
|
+ var savedClip = Application.Driver.Clip;
|
|
|
|
+ Application.Driver.Clip = top.Frame;
|
|
|
|
+ view.Redraw (view.Bounds);
|
|
top.Move (2, 15);
|
|
top.Move (2, 15);
|
|
View.Driver.AddStr ("One");
|
|
View.Driver.AddStr ("One");
|
|
top.Move (2, 16);
|
|
top.Move (2, 16);
|
|
View.Driver.AddStr ("Two");
|
|
View.Driver.AddStr ("Two");
|
|
top.Move (2, 17);
|
|
top.Move (2, 17);
|
|
View.Driver.AddStr ("Three");
|
|
View.Driver.AddStr ("Three");
|
|
|
|
+ Application.Driver.Clip = savedClip;
|
|
|
|
|
|
Application.Current.DrawContentComplete -= Current_DrawContentComplete;
|
|
Application.Current.DrawContentComplete -= Current_DrawContentComplete;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- var dialog = new Dialog ("Dialog", 15, 10, btnPopup);
|
|
|
|
|
|
+ var dialog = new Dialog ("", 15, 10, btnPopup);
|
|
var rs = Application.Begin (dialog);
|
|
var rs = Application.Begin (dialog);
|
|
|
|
|
|
Assert.Equal (new Rect (2, 5, 15, 10), dialog.Frame);
|
|
Assert.Equal (new Rect (2, 5, 15, 10), dialog.Frame);
|
|
TestHelpers.AssertDriverContentsWithFrameAre (@"
|
|
TestHelpers.AssertDriverContentsWithFrameAre (@"
|
|
-┌ Window ──────────┐
|
|
|
|
|
|
+┌──────────────────┐
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
-│ ┌ Dialog ─────┐ │
|
|
|
|
|
|
+│ ┌─────────────┐ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
@@ -1473,12 +1482,12 @@ namespace Terminal.Gui.TopLevelTests {
|
|
var firstIteration = false;
|
|
var firstIteration = false;
|
|
Application.RunMainLoopIteration (ref rs, true, ref firstIteration);
|
|
Application.RunMainLoopIteration (ref rs, true, ref firstIteration);
|
|
TestHelpers.AssertDriverContentsWithFrameAre (@"
|
|
TestHelpers.AssertDriverContentsWithFrameAre (@"
|
|
-┌ Window ──────────┐
|
|
|
|
|
|
+┌──────────────────┐
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
│ │
|
|
-│ ┌ Dialog ─────┐ │
|
|
|
|
|
|
+│ ┌─────────────┐ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|
|
│ │ │ │
|