|
@@ -15,7 +15,7 @@ public partial class ToplevelTests (ITestOutputHelper output)
|
|
|
Assert.False (top.Running);
|
|
|
Assert.False (top.Modal);
|
|
|
Assert.Null (top.MenuBar);
|
|
|
- Assert.Null (top.StatusBar);
|
|
|
+ //Assert.Null (top.StatusBar);
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
@@ -45,55 +45,55 @@ public partial class ToplevelTests (ITestOutputHelper output)
|
|
|
|
|
|
top.Add (new MenuBar ());
|
|
|
Assert.NotNull (top.MenuBar);
|
|
|
- top.Add (new StatusBar ());
|
|
|
- Assert.NotNull (top.StatusBar);
|
|
|
+ //top.Add (new StatusBar ());
|
|
|
+ //Assert.NotNull (top.StatusBar);
|
|
|
var menuBar = top.MenuBar;
|
|
|
top.Remove (top.MenuBar);
|
|
|
Assert.Null (top.MenuBar);
|
|
|
Assert.NotNull (menuBar);
|
|
|
- var statusBar = top.StatusBar;
|
|
|
- top.Remove (top.StatusBar);
|
|
|
- Assert.Null (top.StatusBar);
|
|
|
- Assert.NotNull (statusBar);
|
|
|
+ //var statusBar = top.StatusBar;
|
|
|
+ //top.Remove (top.StatusBar);
|
|
|
+ //Assert.Null (top.StatusBar);
|
|
|
+ //Assert.NotNull (statusBar);
|
|
|
#if DEBUG_IDISPOSABLE
|
|
|
Assert.False (menuBar.WasDisposed);
|
|
|
- Assert.False (statusBar.WasDisposed);
|
|
|
+ //Assert.False (statusBar.WasDisposed);
|
|
|
menuBar.Dispose ();
|
|
|
- statusBar.Dispose ();
|
|
|
+ //statusBar.Dispose ();
|
|
|
Assert.True (menuBar.WasDisposed);
|
|
|
- Assert.True (statusBar.WasDisposed);
|
|
|
+ //Assert.True (statusBar.WasDisposed);
|
|
|
#endif
|
|
|
|
|
|
Application.Begin (top);
|
|
|
Assert.Equal (top, Application.Top);
|
|
|
|
|
|
// Application.Top without menu and status bar.
|
|
|
- View supView = View.GetLocationEnsuringFullVisibility (top, 2, 2, out int nx, out int ny, out StatusBar sb);
|
|
|
+ View supView = View.GetLocationEnsuringFullVisibility (top, 2, 2, out int nx, out int ny/*, out StatusBar sb*/);
|
|
|
Assert.Equal (Application.Top, supView);
|
|
|
Assert.Equal (0, nx);
|
|
|
Assert.Equal (0, ny);
|
|
|
- Assert.Null (sb);
|
|
|
+ //Assert.Null (sb);
|
|
|
|
|
|
top.Add (new MenuBar ());
|
|
|
Assert.NotNull (top.MenuBar);
|
|
|
|
|
|
// Application.Top with a menu and without status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (top, 2, 2, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (top, 2, 2, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (0, nx);
|
|
|
Assert.Equal (1, ny);
|
|
|
- Assert.Null (sb);
|
|
|
+ //Assert.Null (sb);
|
|
|
|
|
|
- top.Add (new StatusBar ());
|
|
|
- Assert.NotNull (top.StatusBar);
|
|
|
+ //top.Add (new StatusBar ());
|
|
|
+ //Assert.NotNull (top.StatusBar);
|
|
|
|
|
|
// Application.Top with a menu and status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (top, 2, 2, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (top, 2, 2, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (0, nx);
|
|
|
|
|
|
// The available height is lower than the Application.Top height minus
|
|
|
// the menu bar and status bar, then the top can go beyond the bottom
|
|
|
Assert.Equal (2, ny);
|
|
|
- Assert.NotNull (sb);
|
|
|
+ //Assert.NotNull (sb);
|
|
|
|
|
|
menuBar = top.MenuBar;
|
|
|
top.Remove (top.MenuBar);
|
|
@@ -101,18 +101,18 @@ public partial class ToplevelTests (ITestOutputHelper output)
|
|
|
Assert.NotNull (menuBar);
|
|
|
|
|
|
// Application.Top without a menu and with a status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (top, 2, 2, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (top, 2, 2, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (0, nx);
|
|
|
|
|
|
// The available height is lower than the Application.Top height minus
|
|
|
// the status bar, then the top can go beyond the bottom
|
|
|
Assert.Equal (2, ny);
|
|
|
- Assert.NotNull (sb);
|
|
|
+ //Assert.NotNull (sb);
|
|
|
|
|
|
- statusBar = top.StatusBar;
|
|
|
- top.Remove (top.StatusBar);
|
|
|
- Assert.Null (top.StatusBar);
|
|
|
- Assert.NotNull (statusBar);
|
|
|
+ //statusBar = top.StatusBar;
|
|
|
+ //top.Remove (top.StatusBar);
|
|
|
+ //Assert.Null (top.StatusBar);
|
|
|
+ //Assert.NotNull (statusBar);
|
|
|
Assert.Null (top.MenuBar);
|
|
|
|
|
|
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill () };
|
|
@@ -120,46 +120,46 @@ public partial class ToplevelTests (ITestOutputHelper output)
|
|
|
top.LayoutSubviews ();
|
|
|
|
|
|
// The SuperView is always the same regardless of the caller.
|
|
|
- supView = View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny, out sb);
|
|
|
+ supView = View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (Application.Top, supView);
|
|
|
- supView = View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny, out sb);
|
|
|
+ supView = View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (Application.Top, supView);
|
|
|
|
|
|
// Application.Top without menu and status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (0, nx);
|
|
|
Assert.Equal (0, ny);
|
|
|
- Assert.Null (sb);
|
|
|
+ //Assert.Null (sb);
|
|
|
|
|
|
top.Add (new MenuBar ());
|
|
|
Assert.NotNull (top.MenuBar);
|
|
|
|
|
|
// Application.Top with a menu and without status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (win, 2, 2, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (win, 2, 2, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (0, nx);
|
|
|
Assert.Equal (1, ny);
|
|
|
- Assert.Null (sb);
|
|
|
+ //Assert.Null (sb);
|
|
|
|
|
|
top.Add (new StatusBar ());
|
|
|
- Assert.NotNull (top.StatusBar);
|
|
|
+ //Assert.NotNull (top.StatusBar);
|
|
|
|
|
|
// Application.Top with a menu and status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (win, 30, 20, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (win, 30, 20, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (0, nx);
|
|
|
|
|
|
// The available height is lower than the Application.Top height minus
|
|
|
// the menu bar and status bar, then the top can go beyond the bottom
|
|
|
Assert.Equal (20, ny);
|
|
|
- Assert.NotNull (sb);
|
|
|
+ //Assert.NotNull (sb);
|
|
|
|
|
|
menuBar = top.MenuBar;
|
|
|
- statusBar = top.StatusBar;
|
|
|
+ //statusBar = top.StatusBar;
|
|
|
top.Remove (top.MenuBar);
|
|
|
Assert.Null (top.MenuBar);
|
|
|
Assert.NotNull (menuBar);
|
|
|
- top.Remove (top.StatusBar);
|
|
|
- Assert.Null (top.StatusBar);
|
|
|
- Assert.NotNull (statusBar);
|
|
|
+ //top.Remove (top.StatusBar);
|
|
|
+ //Assert.Null (top.StatusBar);
|
|
|
+ //Assert.NotNull (statusBar);
|
|
|
|
|
|
top.Remove (win);
|
|
|
|
|
@@ -167,28 +167,28 @@ public partial class ToplevelTests (ITestOutputHelper output)
|
|
|
top.Add (win);
|
|
|
|
|
|
// Application.Top without menu and status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (win, 0, 0, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (0, nx);
|
|
|
Assert.Equal (0, ny);
|
|
|
- Assert.Null (sb);
|
|
|
+ //Assert.Null (sb);
|
|
|
|
|
|
top.Add (new MenuBar ());
|
|
|
Assert.NotNull (top.MenuBar);
|
|
|
|
|
|
// Application.Top with a menu and without status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (win, 2, 2, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (win, 2, 2, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (2, nx);
|
|
|
Assert.Equal (2, ny);
|
|
|
- Assert.Null (sb);
|
|
|
+ //Assert.Null (sb);
|
|
|
|
|
|
top.Add (new StatusBar ());
|
|
|
- Assert.NotNull (top.StatusBar);
|
|
|
+ //Assert.NotNull (top.StatusBar);
|
|
|
|
|
|
// Application.Top with a menu and status bar.
|
|
|
- View.GetLocationEnsuringFullVisibility (win, 30, 20, out nx, out ny, out sb);
|
|
|
+ View.GetLocationEnsuringFullVisibility (win, 30, 20, out nx, out ny/*, out sb*/);
|
|
|
Assert.Equal (20, nx); // 20+60=80
|
|
|
Assert.Equal (9, ny); // 9+15+1(mb)=25
|
|
|
- Assert.NotNull (sb);
|
|
|
+ //Assert.NotNull (sb);
|
|
|
|
|
|
//Assert.Null (Toplevel._dragPosition);
|
|
|
win.NewMouseEvent (new () { Position = new (6, 0), Flags = MouseFlags.Button1Pressed });
|
|
@@ -204,18 +204,18 @@ public partial class ToplevelTests (ITestOutputHelper output)
|
|
|
#if DEBUG_IDISPOSABLE
|
|
|
|
|
|
Assert.False (top.MenuBar.WasDisposed);
|
|
|
- Assert.False (top.StatusBar.WasDisposed);
|
|
|
+ //Assert.False (top.StatusBar.WasDisposed);
|
|
|
#endif
|
|
|
menuBar = top.MenuBar;
|
|
|
- statusBar = top.StatusBar;
|
|
|
+ //statusBar = top.StatusBar;
|
|
|
top.Dispose ();
|
|
|
Assert.Null (top.MenuBar);
|
|
|
- Assert.Null (top.StatusBar);
|
|
|
+ //Assert.Null (top.StatusBar);
|
|
|
Assert.NotNull (menuBar);
|
|
|
- Assert.NotNull (statusBar);
|
|
|
+ //Assert.NotNull (statusBar);
|
|
|
#if DEBUG_IDISPOSABLE
|
|
|
Assert.True (menuBar.WasDisposed);
|
|
|
- Assert.True (statusBar.WasDisposed);
|
|
|
+ //Assert.True (statusBar.WasDisposed);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -1191,14 +1191,14 @@ public partial class ToplevelTests (ITestOutputHelper output)
|
|
|
#endif
|
|
|
tl.Add (mb, sb);
|
|
|
Assert.NotNull (tl.MenuBar);
|
|
|
- Assert.NotNull (tl.StatusBar);
|
|
|
+ //Assert.NotNull (tl.StatusBar);
|
|
|
#if DEBUG
|
|
|
Assert.False (mb.WasDisposed);
|
|
|
Assert.False (sb.WasDisposed);
|
|
|
#endif
|
|
|
tl.RemoveAll ();
|
|
|
Assert.Null (tl.MenuBar);
|
|
|
- Assert.Null (tl.StatusBar);
|
|
|
+ //Assert.Null (tl.StatusBar);
|
|
|
#if DEBUG
|
|
|
Assert.False (mb.WasDisposed);
|
|
|
Assert.False (sb.WasDisposed);
|