Browse Source

Reamed Bounds -> ViewPort to see how it feels

Tig 1 năm trước cách đây
mục cha
commit
f6ff36968e
78 tập tin đã thay đổi với 610 bổ sung610 xóa
  1. 2 2
      Terminal.Gui/Application.cs
  2. 3 3
      Terminal.Gui/Input/Mouse.cs
  3. 1 1
      Terminal.Gui/Text/Autocomplete/AppendAutocomplete.cs
  4. 11 11
      Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs
  5. 1 1
      Terminal.Gui/Text/TextFormatter.cs
  6. 3 3
      Terminal.Gui/View/Adornment/Adornment.cs
  7. 1 1
      Terminal.Gui/View/Adornment/Padding.cs
  8. 15 15
      Terminal.Gui/View/Layout/ViewLayout.cs
  9. 2 2
      Terminal.Gui/View/View.cs
  10. 3 3
      Terminal.Gui/View/ViewAdornments.cs
  11. 19 19
      Terminal.Gui/View/ViewDrawing.cs
  12. 10 10
      Terminal.Gui/View/ViewMouse.cs
  13. 17 17
      Terminal.Gui/View/ViewText.cs
  14. 3 3
      Terminal.Gui/Views/ColorPicker.cs
  15. 15 15
      Terminal.Gui/Views/ComboBox.cs
  16. 4 4
      Terminal.Gui/Views/Dialog.cs
  17. 8 8
      Terminal.Gui/Views/FileDialog.cs
  18. 7 7
      Terminal.Gui/Views/GraphView/Annotations.cs
  19. 15 15
      Terminal.Gui/Views/GraphView/Axis.cs
  20. 8 8
      Terminal.Gui/Views/GraphView/GraphView.cs
  21. 1 1
      Terminal.Gui/Views/GraphView/Series.cs
  22. 3 3
      Terminal.Gui/Views/HexView.cs
  23. 1 1
      Terminal.Gui/Views/LineView.cs
  24. 14 14
      Terminal.Gui/Views/ListView.cs
  25. 6 6
      Terminal.Gui/Views/Menu/Menu.cs
  26. 1 1
      Terminal.Gui/Views/MessageBox.cs
  27. 8 8
      Terminal.Gui/Views/ProgressBar.cs
  28. 24 24
      Terminal.Gui/Views/ScrollBarView.cs
  29. 16 16
      Terminal.Gui/Views/ScrollView.cs
  30. 15 15
      Terminal.Gui/Views/Slider.cs
  31. 7 7
      Terminal.Gui/Views/TabView.cs
  32. 4 4
      Terminal.Gui/Views/TableView/ListTableSource.cs
  33. 20 20
      Terminal.Gui/Views/TableView/TableView.cs
  34. 6 6
      Terminal.Gui/Views/TextField.cs
  35. 4 4
      Terminal.Gui/Views/TextValidateField.cs
  36. 20 20
      Terminal.Gui/Views/TileView.cs
  37. 4 4
      Terminal.Gui/Views/Toplevel.cs
  38. 13 13
      Terminal.Gui/Views/TreeView/TreeView.cs
  39. 2 2
      UICatalog/Scenarios/ASCIICustomButton.cs
  40. 3 3
      UICatalog/Scenarios/Animation.cs
  41. 1 1
      UICatalog/Scenarios/BackgroundWorkerCollection.cs
  42. 9 9
      UICatalog/Scenarios/CharacterMap.cs
  43. 4 4
      UICatalog/Scenarios/ComputedLayout.cs
  44. 2 2
      UICatalog/Scenarios/Editor.cs
  45. 2 2
      UICatalog/Scenarios/GraphViewExample.cs
  46. 1 1
      UICatalog/Scenarios/ProgressBarStyles.cs
  47. 6 6
      UICatalog/Scenarios/Scrolling.cs
  48. 1 1
      UICatalog/Scenarios/Snake.cs
  49. 3 3
      UICatalog/Scenarios/ViewExperiments.cs
  50. 6 6
      UICatalog/Scenarios/VkeyPacketSimulator.cs
  51. 4 4
      UnitTests/Drawing/LineCanvasTests.cs
  52. 1 1
      UnitTests/UICatalog/ScenarioTests.cs
  53. 16 16
      UnitTests/View/Adornment/AdornmentTests.cs
  54. 1 1
      UnitTests/View/Adornment/ToScreenTests.cs
  55. 5 5
      UnitTests/View/DrawTests.cs
  56. 24 24
      UnitTests/View/Layout/AbsoluteLayoutTests.cs
  57. 4 4
      UnitTests/View/Layout/BoundsTests.cs
  58. 3 3
      UnitTests/View/Layout/DimTests.cs
  59. 4 4
      UnitTests/View/Layout/PosTests.cs
  60. 8 8
      UnitTests/View/Layout/SetRelativeLayoutTests.cs
  61. 4 4
      UnitTests/View/SubviewTests.cs
  62. 3 3
      UnitTests/View/Text/AutoSizeFalseTests.cs
  63. 7 7
      UnitTests/View/Text/AutoSizeTrueTests.cs
  64. 29 29
      UnitTests/View/ViewTests.cs
  65. 6 6
      UnitTests/Views/ButtonTests.cs
  66. 18 18
      UnitTests/Views/ComboBoxTests.cs
  67. 23 23
      UnitTests/Views/GraphViewTests.cs
  68. 5 5
      UnitTests/Views/LabelTests.cs
  69. 28 28
      UnitTests/Views/ScrollBarViewTests.cs
  70. 5 5
      UnitTests/Views/ScrollViewTests.cs
  71. 2 2
      UnitTests/Views/StatusBarTests.cs
  72. 40 40
      UnitTests/Views/TableViewTests.cs
  73. 1 1
      UnitTests/Views/TextValidateFieldTests.cs
  74. 6 6
      UnitTests/Views/TextViewTests.cs
  75. 1 1
      UnitTests/Views/ToplevelTests.cs
  76. 1 1
      UnitTests/Views/TreeTableSourceTests.cs
  77. 3 3
      UnitTests/Views/TreeViewTests.cs
  78. 3 3
      UnitTests/Views/WindowTests.cs

+ 2 - 2
Terminal.Gui/Application.cs

@@ -1420,7 +1420,7 @@ public static partial class Application
                 View = view
             };
 
-            if (MouseGrabView.Bounds.Contains (viewRelativeMouseEvent.X, viewRelativeMouseEvent.Y) is false)
+            if (MouseGrabView.Viewport.Contains (viewRelativeMouseEvent.X, viewRelativeMouseEvent.Y) is false)
             {
                 // The mouse has moved outside the bounds of the view that
                 // grabbed the mouse, so we tell the view that last got 
@@ -1476,7 +1476,7 @@ public static partial class Application
                 View = view
             };
         }
-        else if (view.BoundsToScreen (view.Bounds).Contains (a.MouseEvent.X, a.MouseEvent.Y))
+        else if (view.BoundsToScreen (view.Viewport).Contains (a.MouseEvent.X, a.MouseEvent.Y))
         {
             Point boundsPoint = view.ScreenToBounds (a.MouseEvent.X, a.MouseEvent.Y);
 

+ 3 - 3
Terminal.Gui/Input/Mouse.cs

@@ -116,10 +116,10 @@ public class MouseEvent
     /// <summary>The View at the location for the mouse event.</summary>
     public View View { get; set; }
 
-    /// <summary>The X position of the mouse in <see cref="View.Bounds"/>-relative coordinates.</summary>
+    /// <summary>The X position of the mouse in <see cref="Gui.View.Viewport"/>-relative coordinates.</summary>
     public int X { get; set; }
 
-    /// <summary>The Y position of the mouse in <see cref="View.Bounds"/>-relative coordinates.</summary>
+    /// <summary>The Y position of the mouse in <see cref="Gui.View.Viewport"/>-relative coordinates.</summary>
     public int Y { get; set; }
 
     /// <summary>
@@ -133,7 +133,7 @@ public class MouseEvent
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         The <see cref="X"/> and <see cref="Y"/> properties are always <see cref="View.Bounds"/>-relative. When the mouse is grabbed by a view,
+    ///         The <see cref="X"/> and <see cref="Y"/> properties are always <see cref="Gui.View.Viewport"/>-relative. When the mouse is grabbed by a view,
     ///         <see cref="ScreenPosition"/> provides the mouse position screen-relative coordinates, enabling the grabbed view to know how much the
     ///         mouse has moved.
     ///     </para>

+ 1 - 1
Terminal.Gui/Text/Autocomplete/AppendAutocomplete.cs

@@ -117,7 +117,7 @@ public class AppendAutocomplete : AutocompleteBase
         Suggestion suggestion = Suggestions.ElementAt (SelectedIdx);
         string fragment = suggestion.Replacement.Substring (suggestion.Remove);
 
-        int spaceAvailable = textField.Bounds.Width - textField.Text.GetColumns ();
+        int spaceAvailable = textField.Viewport.Width - textField.Text.GetColumns ();
         int spaceRequired = fragment.EnumerateRunes ().Sum (c => c.GetColumns ());
 
         if (spaceAvailable < spaceRequired)

+ 11 - 11
Terminal.Gui/Text/Autocomplete/PopupAutocomplete.cs

@@ -271,13 +271,13 @@ public abstract partial class PopupAutocomplete : AutocompleteBase
         if (PopupInsideContainer)
         {
             // don't overspill vertically
-            height = Math.Min (HostControl.Bounds.Height - renderAt.Y, MaxHeight);
+            height = Math.Min (HostControl.Viewport.Height - renderAt.Y, MaxHeight);
 
             // There is no space below, lets see if can popup on top
-            if (height < Suggestions.Count && HostControl.Bounds.Height - renderAt.Y >= height)
+            if (height < Suggestions.Count && HostControl.Viewport.Height - renderAt.Y >= height)
             {
                 // Verifies that the upper limit available is greater than the lower limit
-                if (renderAt.Y > HostControl.Bounds.Height - renderAt.Y)
+                if (renderAt.Y > HostControl.Viewport.Height - renderAt.Y)
                 {
                     renderAt.Y = Math.Max (renderAt.Y - Math.Min (Suggestions.Count + 1, MaxHeight + 1), 0);
                     height = Math.Min (Math.Min (Suggestions.Count, MaxHeight), LastPopupPos.Value.Y - 1);
@@ -287,13 +287,13 @@ public abstract partial class PopupAutocomplete : AutocompleteBase
         else
         {
             // don't overspill vertically
-            height = Math.Min (Math.Min (top.Bounds.Height - HostControl.Frame.Bottom, MaxHeight), Suggestions.Count);
+            height = Math.Min (Math.Min (top.Viewport.Height - HostControl.Frame.Bottom, MaxHeight), Suggestions.Count);
 
             // There is no space below, lets see if can popup on top
             if (height < Suggestions.Count && HostControl.Frame.Y - top.Frame.Y >= height)
             {
                 // Verifies that the upper limit available is greater than the lower limit
-                if (HostControl.Frame.Y > top.Bounds.Height - HostControl.Frame.Y)
+                if (HostControl.Frame.Y > top.Viewport.Height - HostControl.Frame.Y)
                 {
                     renderAt.Y = Math.Max (HostControl.Frame.Y - Math.Min (Suggestions.Count, MaxHeight), 0);
                     height = Math.Min (Math.Min (Suggestions.Count, MaxHeight), HostControl.Frame.Y);
@@ -323,34 +323,34 @@ public abstract partial class PopupAutocomplete : AutocompleteBase
         if (PopupInsideContainer)
         {
             // don't overspill horizontally, let's see if can be displayed on the left
-            if (width > HostControl.Bounds.Width - renderAt.X)
+            if (width > HostControl.Viewport.Width - renderAt.X)
             {
                 // Verifies that the left limit available is greater than the right limit
-                if (renderAt.X > HostControl.Bounds.Width - renderAt.X)
+                if (renderAt.X > HostControl.Viewport.Width - renderAt.X)
                 {
                     renderAt.X -= Math.Min (width, LastPopupPos.Value.X);
                     width = Math.Min (width, LastPopupPos.Value.X);
                 }
                 else
                 {
-                    width = Math.Min (width, HostControl.Bounds.Width - renderAt.X);
+                    width = Math.Min (width, HostControl.Viewport.Width - renderAt.X);
                 }
             }
         }
         else
         {
             // don't overspill horizontally, let's see if can be displayed on the left
-            if (width > top.Bounds.Width - (renderAt.X + HostControl.Frame.X))
+            if (width > top.Viewport.Width - (renderAt.X + HostControl.Frame.X))
             {
                 // Verifies that the left limit available is greater than the right limit
-                if (renderAt.X + HostControl.Frame.X > top.Bounds.Width - (renderAt.X + HostControl.Frame.X))
+                if (renderAt.X + HostControl.Frame.X > top.Viewport.Width - (renderAt.X + HostControl.Frame.X))
                 {
                     renderAt.X -= Math.Min (width, LastPopupPos.Value.X);
                     width = Math.Min (width, LastPopupPos.Value.X);
                 }
                 else
                 {
-                    width = Math.Min (width, top.Bounds.Width - renderAt.X);
+                    width = Math.Min (width, top.Viewport.Width - renderAt.X);
                 }
             }
         }

+ 1 - 1
Terminal.Gui/Text/TextFormatter.cs

@@ -30,7 +30,7 @@ public class TextFormatter
 
     /// <summary>Gets or sets whether the <see cref="Size"/> should be automatically changed to fit the <see cref="Text"/>.</summary>
     /// <remarks>
-    ///     <para>Used by <see cref="View.AutoSize"/> to resize the view's <see cref="View.Bounds"/> to fit <see cref="Size"/>.</para>
+    ///     <para>Used by <see cref="View.AutoSize"/> to resize the view's <see cref="View.Viewport"/> to fit <see cref="Size"/>.</para>
     ///     <para>
     ///         AutoSize is ignored if <see cref="TextAlignment.Justified"/> and
     ///         <see cref="VerticalTextAlignment.Justified"/> are used.

+ 3 - 3
Terminal.Gui/View/Adornment/Adornment.cs

@@ -1,7 +1,7 @@
 namespace Terminal.Gui;
 
 /// <summary>
-///     Adornments are a special form of <see cref="View"/> that appear outside the <see cref="View.Bounds"/>:
+///     Adornments are a special form of <see cref="View"/> that appear outside the <see cref="View.Viewport"/>:
 ///     <see cref="Margin"/>, <see cref="Border"/>, and <see cref="Padding"/>. They are defined using the
 ///     <see cref="Thickness"/> class, which specifies the thickness of the sides of a rectangle.
 /// </summary>
@@ -109,7 +109,7 @@ public class Adornment : View
     ///     Gets the rectangle that describes the area of the Adornment. The Location is always (0,0).
     ///     The size is the size of the <see cref="View.Frame"/>.
     /// </summary>
-    public override Rectangle Bounds
+    public override Rectangle Viewport
     {
         get => Frame with { Location = Point.Empty };
         set => throw new InvalidOperationException ("It makes no sense to set Bounds of a Thickness.");
@@ -231,7 +231,7 @@ public class Adornment : View
     /// <summary>Called when a mouse event occurs within the Adornment.</summary>
     /// <remarks>
     ///     <para>
-    ///         The coordinates are relative to <see cref="View.Bounds"/>.
+    ///         The coordinates are relative to <see cref="View.Viewport"/>.
     ///     </para>
     ///     <para>
     ///         A mouse click on the Adornment will cause the Parent to focus.

+ 1 - 1
Terminal.Gui/View/Adornment/Padding.cs

@@ -42,7 +42,7 @@ public class Padding : Adornment
     /// <summary>Called when a mouse event occurs within the Padding.</summary>
     /// <remarks>
     /// <para>
-    /// The coordinates are relative to <see cref="View.Bounds"/>.
+    /// The coordinates are relative to <see cref="View.Viewport"/>.
     /// </para>
     /// <para>
     /// A mouse click on the Padding will cause the Parent to focus.

+ 15 - 15
Terminal.Gui/View/Layout/ViewLayout.cs

@@ -42,10 +42,10 @@ public partial class View
     /// <summary>Gets or sets the absolute location and dimension of the view.</summary>
     /// <value>
     ///     The rectangle describing absolute location and dimension of the view, in coordinates relative to the
-    ///     <see cref="SuperView"/>'s <see cref="Bounds"/>.
+    ///     <see cref="SuperView"/>'s <see cref="Viewport"/>.
     /// </value>
     /// <remarks>
-    ///     <para>Frame is relative to the <see cref="SuperView"/>'s <see cref="Bounds"/>.</para>
+    ///     <para>Frame is relative to the <see cref="SuperView"/>'s <see cref="Viewport"/>.</para>
     ///     <para>
     ///         Setting Frame will set <see cref="X"/>, <see cref="Y"/>, <see cref="Width"/>, and <see cref="Height"/> to the
     ///         values of the corresponding properties of the <paramref name="value"/> parameter.
@@ -113,9 +113,9 @@ public partial class View
 
     /// <summary>
     ///     Converts a screen-relative coordinate to a Frame-relative coordinate. Frame-relative means relative to the
-    ///     View's <see cref="SuperView"/>'s <see cref="Bounds"/>.
+    ///     View's <see cref="SuperView"/>'s <see cref="Viewport"/>.
     /// </summary>
-    /// <returns>The coordinate relative to the <see cref="SuperView"/>'s <see cref="Bounds"/>.</returns>
+    /// <returns>The coordinate relative to the <see cref="SuperView"/>'s <see cref="Viewport"/>.</returns>
     /// <param name="x">Screen-relative column.</param>
     /// <param name="y">Screen-relative row.</param>
     public virtual Point ScreenToFrame (int x, int y)
@@ -306,12 +306,12 @@ public partial class View
     ///         <see cref="LayoutSubview(View, Rectangle)"/> and <see cref="OnDrawContent(Rectangle)"/> methods to be called.
     ///     </para>
     ///     <para>
-    ///         Because <see cref="Bounds"/> coordinates are relative to the upper-left corner of the <see cref="View"/>, the
+    ///         Because <see cref="Viewport"/> coordinates are relative to the upper-left corner of the <see cref="View"/>, the
     ///         coordinates of the upper-left corner of the rectangle returned by this property are (0,0). Use this property to
     ///         obtain the size of the area of the view for tasks such as drawing the view's contents.
     ///     </para>
     /// </remarks>
-    public virtual Rectangle Bounds
+    public virtual Rectangle Viewport
     {
         get
         {
@@ -362,7 +362,7 @@ public partial class View
         }
     }
 
-    /// <summary>Converts a <see cref="Bounds"/>-relative rectangle to a screen-relative rectangle.</summary>
+    /// <summary>Converts a <see cref="Viewport"/>-relative rectangle to a screen-relative rectangle.</summary>
     public Rectangle BoundsToScreen (in Rectangle bounds)
     {
         // Translate bounds to Frame (our SuperView's Bounds-relative coordinates)
@@ -374,7 +374,7 @@ public partial class View
     }
 
     /// <summary>Converts a screen-relative coordinate to a bounds-relative coordinate.</summary>
-    /// <returns>The coordinate relative to this view's <see cref="Bounds"/>.</returns>
+    /// <returns>The coordinate relative to this view's <see cref="Viewport"/>.</returns>
     /// <param name="x">Screen-relative column.</param>
     /// <param name="y">Screen-relative row.</param>
     public Point ScreenToBounds (int x, int y)
@@ -400,7 +400,7 @@ public partial class View
 
     /// <summary>
     ///     Gets or sets a flag that determines whether the View will be automatically resized to fit the <see cref="Text"/>
-    ///     within <see cref="Bounds"/>.
+    ///     within <see cref="Viewport"/>.
     ///     <para>
     ///         The default is <see langword="false"/>. Set to <see langword="true"/> to turn on AutoSize. If
     ///         <see langword="true"/> then <see cref="Width"/> and <see cref="Height"/> will be used if <see cref="Text"/> can
@@ -598,7 +598,7 @@ public partial class View
 
         if (boundsChanged)
         {
-            Bounds = new (Bounds.X, Bounds.Y, canSizeW ? rW : Bounds.Width, canSizeH ? rH : Bounds.Height);
+            Viewport = new (Viewport.X, Viewport.Y, canSizeW ? rW : Viewport.Width, canSizeH ? rH : Viewport.Height);
         }
 
         return boundsChanged;
@@ -766,7 +766,7 @@ public partial class View
         else
         {
             // Use the SuperView's Bounds, not Frame
-            maxDimension = viewToMove.SuperView.Bounds.Width;
+            maxDimension = viewToMove.SuperView.Viewport.Width;
             superView = viewToMove.SuperView;
         }
 
@@ -912,7 +912,7 @@ public partial class View
 
         LayoutAdornments ();
 
-        Rectangle oldBounds = Bounds;
+        Rectangle oldBounds = Viewport;
         OnLayoutStarted (new () { OldBounds = oldBounds });
 
         SetTextFormatterSize ();
@@ -925,7 +925,7 @@ public partial class View
 
         foreach (View v in ordered)
         {
-            LayoutSubview (v, new (GetBoundsOffset (), Bounds.Size));
+            LayoutSubview (v, new (GetBoundsOffset (), Viewport.Size));
         }
 
         // If the 'to' is rooted to 'from' and the layoutstyle is Computed it's a special-case.
@@ -974,8 +974,8 @@ public partial class View
         // TODO: Until then leave it `internal` and non-virtual
         // First try SuperView.Bounds, then Application.Top, then Driver.Bounds.
         // Finally, if none of those are valid, use int.MaxValue (for Unit tests).
-        Rectangle relativeBounds = SuperView is { IsInitialized: true } ? SuperView.Bounds :
-                                   Application.Top is { } && Application.Top.IsInitialized ? Application.Top.Bounds :
+        Rectangle relativeBounds = SuperView is { IsInitialized: true } ? SuperView.Viewport :
+                                   Application.Top is { } && Application.Top.IsInitialized ? Application.Top.Viewport :
                                    Application.Driver?.Bounds ?? new Rectangle (0, 0, int.MaxValue, int.MaxValue);
         SetRelativeLayout (relativeBounds);
 

+ 2 - 2
Terminal.Gui/View/View.cs

@@ -52,7 +52,7 @@ namespace Terminal.Gui;
 ///         To create a View using Absolute layout, call a constructor that takes a Rect parameter to specify the
 ///         absolute position and size or simply set <see cref="View.Frame "/>). To create a View using Computed layout use
 ///         a constructor that does not take a Rect parameter and set the X, Y, Width and Height properties on the view to
-///         non-absolute values. Both approaches use coordinates that are relative to the <see cref="Bounds"/> of the
+///         non-absolute values. Both approaches use coordinates that are relative to the <see cref="Viewport"/> of the
 ///         <see cref="SuperView"/> the View is added to.
 ///     </para>
 ///     <para>
@@ -73,7 +73,7 @@ namespace Terminal.Gui;
 ///         a View can be accessed with the <see cref="SuperView"/> property.
 ///     </para>
 ///     <para>
-///         To flag a region of the View's <see cref="Bounds"/> to be redrawn call <see cref="SetNeedsDisplay(Rectangle)"/>
+///         To flag a region of the View's <see cref="Viewport"/> to be redrawn call <see cref="SetNeedsDisplay(Rectangle)"/>
 ///         .
 ///         To flag the entire view for redraw call <see cref="SetNeedsDisplay()"/>.
 ///     </para>

+ 3 - 3
Terminal.Gui/View/ViewAdornments.cs

@@ -39,7 +39,7 @@ public partial class View
 
     /// <summary>
     ///     The <see cref="Adornment"/> that enables separation of a View from other SubViews of the same
-    ///     SuperView. The margin offsets the <see cref="Bounds"/> from the <see cref="Frame"/>.
+    ///     SuperView. The margin offsets the <see cref="Viewport"/> from the <see cref="Frame"/>.
     /// </summary>
     /// <remarks>
     ///     <para>
@@ -55,7 +55,7 @@ public partial class View
     public Margin Margin { get; private set; }
 
     /// <summary>
-    ///     The <see cref="Adornment"/> that offsets the <see cref="Bounds"/> from the <see cref="Margin"/>.
+    ///     The <see cref="Adornment"/> that offsets the <see cref="Viewport"/> from the <see cref="Margin"/>.
     ///     The Border provides the space for a visual border (drawn using
     ///     line-drawing glyphs) and the Title. The Border expands inward; in other words if `Border.Thickness.Top == 2` the
     ///     border and title will take up the first row and the second row will be filled with spaces.
@@ -113,7 +113,7 @@ public partial class View
     }
 
     /// <summary>
-    ///     The <see cref="Adornment"/> inside of the view that offsets the <see cref="Bounds"/>
+    ///     The <see cref="Adornment"/> inside of the view that offsets the <see cref="Viewport"/>
     ///     from the <see cref="Border"/>.
     /// </summary>
     /// <remarks>

+ 19 - 19
Terminal.Gui/View/ViewDrawing.cs

@@ -80,11 +80,11 @@ public partial class View
         Driver.AddRune (ch);
     }
 
-    /// <summary>Clears <see cref="Bounds"/> with the normal background.</summary>
+    /// <summary>Clears <see cref="Viewport"/> with the normal background.</summary>
     /// <remarks></remarks>
-    public void Clear () { Clear (Bounds); }
+    public void Clear () { Clear (Viewport); }
 
-    /// <summary>Clears the specified <see cref="Bounds"/>-relative rectangle with the normal background.</summary>
+    /// <summary>Clears the specified <see cref="Viewport"/>-relative rectangle with the normal background.</summary>
     /// <remarks></remarks>
     /// <param name="contentArea">The Bounds-relative rectangle to clear.</param>
     public void Clear (Rectangle contentArea)
@@ -97,19 +97,19 @@ public partial class View
         Attribute prev = Driver.SetAttribute (GetNormalColor ());
 
         // Clamp the region to the bounds of the view
-        contentArea = Rectangle.Intersect (contentArea, Bounds);
+        contentArea = Rectangle.Intersect (contentArea, Viewport);
         Driver.FillRect (BoundsToScreen (contentArea));
         Driver.SetAttribute (prev);
     }
 
-    /// <summary>Expands the <see cref="ConsoleDriver"/>'s clip region to include <see cref="Bounds"/>.</summary>
+    /// <summary>Expands the <see cref="ConsoleDriver"/>'s clip region to include <see cref="Viewport"/>.</summary>
     /// <returns>
     ///     The current screen-relative clip region, which can be then re-applied by setting
     ///     <see cref="ConsoleDriver.Clip"/>.
     /// </returns>
     /// <remarks>
     ///     <para>
-    ///         If <see cref="ConsoleDriver.Clip"/> and <see cref="Bounds"/> do not intersect, the clip region will be set to
+    ///         If <see cref="ConsoleDriver.Clip"/> and <see cref="Viewport"/> do not intersect, the clip region will be set to
     ///         <see cref="Rectangle.Empty"/>.
     ///     </para>
     /// </remarks>
@@ -121,7 +121,7 @@ public partial class View
         }
 
         Rectangle previous = Driver.Clip;
-        Driver.Clip = Rectangle.Intersect (previous, BoundsToScreen (Bounds));
+        Driver.Clip = Rectangle.Intersect (previous, BoundsToScreen (Viewport));
 
         return previous;
     }
@@ -132,7 +132,7 @@ public partial class View
     /// </summary>
     /// <remarks>
     ///     <para>
-    ///         Always use <see cref="Bounds"/> (view-relative) when calling <see cref="OnDrawContent(Rectangle)"/>, NOT
+    ///         Always use <see cref="Viewport"/> (view-relative) when calling <see cref="OnDrawContent(Rectangle)"/>, NOT
     ///         <see cref="Frame"/> (superview-relative).
     ///     </para>
     ///     <para>
@@ -162,12 +162,12 @@ public partial class View
         }
 
         // Invoke DrawContentEvent
-        var dev = new DrawEventArgs (Bounds);
+        var dev = new DrawEventArgs (Viewport);
         DrawContent?.Invoke (this, dev);
 
         if (!dev.Cancel)
         {
-            OnDrawContent (Bounds);
+            OnDrawContent (Viewport);
         }
 
         if (Driver is { })
@@ -178,7 +178,7 @@ public partial class View
         OnRenderLineCanvas ();
 
         // Invoke DrawContentCompleteEvent
-        OnDrawContentComplete (Bounds);
+        OnDrawContentComplete (Viewport);
 
         // BUGBUG: v2 - We should be able to use View.SetClip here and not have to resort to knowing Driver details.
         ClearLayoutNeeded ();
@@ -346,9 +346,9 @@ public partial class View
 
         // Each of these renders lines to either this View's LineCanvas 
         // Those lines will be finally rendered in OnRenderLineCanvas
-        Margin?.OnDrawContent (Margin.Bounds);
-        Border?.OnDrawContent (Border.Bounds);
-        Padding?.OnDrawContent (Padding.Bounds);
+        Margin?.OnDrawContent (Margin.Viewport);
+        Border?.OnDrawContent (Border.Viewport);
+        Padding?.OnDrawContent (Padding.Viewport);
 
         return true;
     }
@@ -483,7 +483,7 @@ public partial class View
         return true;
     }
 
-    /// <summary>Sets the area of this view needing to be redrawn to <see cref="Bounds"/>.</summary>
+    /// <summary>Sets the area of this view needing to be redrawn to <see cref="Viewport"/>.</summary>
     /// <remarks>
     ///     If the view has not been initialized (<see cref="IsInitialized"/> is <see langword="false"/>), this method
     ///     does nothing.
@@ -492,7 +492,7 @@ public partial class View
     {
         if (IsInitialized)
         {
-            SetNeedsDisplay (Bounds);
+            SetNeedsDisplay (Viewport);
         }
     }
 
@@ -525,9 +525,9 @@ public partial class View
 
         _superView?.SetSubViewNeedsDisplay ();
 
-        Margin?.SetNeedsDisplay (Margin.Bounds);
-        Border?.SetNeedsDisplay (Border.Bounds);
-        Padding?.SetNeedsDisplay (Padding.Bounds);
+        Margin?.SetNeedsDisplay (Margin.Viewport);
+        Border?.SetNeedsDisplay (Border.Viewport);
+        Padding?.SetNeedsDisplay (Padding.Viewport);
 
         foreach (View subview in Subviews)
         {

+ 10 - 10
Terminal.Gui/View/ViewMouse.cs

@@ -12,7 +12,7 @@ public partial class View
     /// <summary>Event fired when a mouse event occurs.</summary>
     /// <remarks>
     /// <para>
-    /// The coordinates are relative to <see cref="View.Bounds"/>.
+    /// The coordinates are relative to <see cref="Viewport"/>.
     /// </para>
     /// </remarks>
     public event EventHandler<MouseEventEventArgs> MouseEvent;
@@ -24,24 +24,24 @@ public partial class View
     /// <see cref="MouseEvent.Flags"/> to see which button was clicked.
     /// </para>
     /// <para>
-    /// The coordinates are relative to <see cref="View.Bounds"/>.
+    /// The coordinates are relative to <see cref="Viewport"/>.
     /// </para>
     /// </remarks>
     public event EventHandler<MouseEventEventArgs> MouseClick;
 
-    /// <summary>Event fired when the mouse moves into the View's <see cref="Bounds"/>.</summary>
+    /// <summary>Event fired when the mouse moves into the View's <see cref="Viewport"/>.</summary>
     public event EventHandler<MouseEventEventArgs> MouseEnter;
 
-    /// <summary>Event fired when the mouse leaves the View's <see cref="Bounds"/>.</summary>
+    /// <summary>Event fired when the mouse leaves the View's <see cref="Viewport"/>.</summary>
     public event EventHandler<MouseEventEventArgs> MouseLeave;
 
     // TODO: OnMouseEnter should not be public virtual, but protected.
     /// <summary>
-    ///     Called when the mouse enters the View's <see cref="Bounds"/>. The view will now receive mouse events until the mouse leaves
+    ///     Called when the mouse enters the View's <see cref="Viewport"/>. The view will now receive mouse events until the mouse leaves
     ///     the view. At which time, <see cref="OnMouseLeave(Gui.MouseEvent)"/> will be called.
     /// </summary>
     /// <remarks>
-    /// The coordinates are relative to <see cref="View.Bounds"/>.
+    /// The coordinates are relative to <see cref="Viewport"/>.
     /// </remarks>
     /// <param name="mouseEvent"></param>
     /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
@@ -65,11 +65,11 @@ public partial class View
 
     // TODO: OnMouseLeave should not be public virtual, but protected.
     /// <summary>
-    ///     Called when the mouse has moved out of the View's <see cref="Bounds"/>. The view will no longer receive mouse events (until the
+    ///     Called when the mouse has moved out of the View's <see cref="Viewport"/>. The view will no longer receive mouse events (until the
     ///     mouse moves within the view again and <see cref="OnMouseEnter(Gui.MouseEvent)"/> is called).
     /// </summary>
     /// <remarks>
-    /// The coordinates are relative to <see cref="View.Bounds"/>.
+    /// The coordinates are relative to <see cref="Viewport"/>.
     /// </remarks>
     /// <param name="mouseEvent"></param>
     /// <returns><see langword="true"/>, if the event was handled, <see langword="false"/> otherwise.</returns>
@@ -92,10 +92,10 @@ public partial class View
     }
 
     // TODO: OnMouseEvent should not be public virtual, but protected.
-    /// <summary>Called when a mouse event occurs within the view's <see cref="Bounds"/>.</summary>
+    /// <summary>Called when a mouse event occurs within the view's <see cref="Viewport"/>.</summary>
     /// <remarks>
     /// <para>
-    /// The coordinates are relative to <see cref="View.Bounds"/>.
+    /// The coordinates are relative to <see cref="Viewport"/>.
     /// </para>
     /// </remarks>
     /// <param name="mouseEvent"></param>

+ 17 - 17
Terminal.Gui/View/ViewText.cs

@@ -30,10 +30,10 @@ public partial class View
     ///         <see cref="TextAlignment"/> and <see cref="TextDirection"/>.
     ///     </para>
     ///     <para>
-    ///         The text will word-wrap to additional lines if it does not fit horizontally. If <see cref="Bounds"/>'s height
+    ///         The text will word-wrap to additional lines if it does not fit horizontally. If <see cref="Viewport"/>'s height
     ///         is 1, the text will be clipped.
     ///     </para>
-    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Bounds"/> will be adjusted to fit the text.</para>
+    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Viewport"/> will be adjusted to fit the text.</para>
     ///     <para>When the text changes, the <see cref="TextChanged"/> is fired.</para>
     /// </remarks>
     public virtual string Text
@@ -80,7 +80,7 @@ public partial class View
     ///     redisplay the <see cref="View"/>.
     /// </summary>
     /// <remarks>
-    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Bounds"/> will be adjusted to fit the text.</para>
+    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Viewport"/> will be adjusted to fit the text.</para>
     /// </remarks>
     /// <value>The text alignment.</value>
     public virtual TextAlignment TextAlignment
@@ -99,7 +99,7 @@ public partial class View
     ///     <see cref="View"/>.
     /// </summary>
     /// <remarks>
-    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Bounds"/> will be adjusted to fit the text.</para>
+    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Viewport"/> will be adjusted to fit the text.</para>
     /// </remarks>
     /// <value>The text alignment.</value>
     public virtual TextDirection TextDirection
@@ -120,7 +120,7 @@ public partial class View
     ///     redisplay the <see cref="View"/>.
     /// </summary>
     /// <remarks>
-    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Bounds"/> will be adjusted to fit the text.</para>
+    ///     <para>If <see cref="AutoSize"/> is <c>true</c>, the <see cref="Viewport"/> will be adjusted to fit the text.</para>
     /// </remarks>
     /// <value>The text alignment.</value>
     public virtual VerticalTextAlignment VerticalTextAlignment
@@ -134,7 +134,7 @@ public partial class View
     }
 
     /// <summary>
-    ///     Gets the Frame dimensions required to fit <see cref="Text"/> within <see cref="Bounds"/> using the text
+    ///     Gets the Frame dimensions required to fit <see cref="Text"/> within <see cref="Viewport"/> using the text
     ///     <see cref="NavigationDirection"/> specified by the <see cref="TextFormatter"/> property and accounting for any
     ///     <see cref="HotKeySpecifier"/> characters.
     /// </summary>
@@ -146,8 +146,8 @@ public partial class View
 
         if (IsInitialized)
         {
-            x = Bounds.X;
-            y = Bounds.Y;
+            x = Viewport.X;
+            y = Viewport.Y;
         }
 
         Rectangle rect = TextFormatter.CalcRect (x, y, TextFormatter.Text, TextFormatter.Direction);
@@ -225,7 +225,7 @@ public partial class View
     }
 
     /// <summary>
-    ///     Internal API. Sets <see cref="TextFormatter"/>.Size to the current <see cref="Bounds"/> size, adjusted for
+    ///     Internal API. Sets <see cref="TextFormatter"/>.Size to the current <see cref="Viewport"/> size, adjusted for
     ///     <see cref="TextFormatter.HotKeySpecifier"/>.
     /// </summary>
     /// <remarks>
@@ -244,14 +244,14 @@ public partial class View
 
         if (string.IsNullOrEmpty (TextFormatter.Text))
         {
-            TextFormatter.Size = Bounds.Size;
+            TextFormatter.Size = Viewport.Size;
 
             return;
         }
 
         TextFormatter.Size = new (
-                                  Bounds.Size.Width + GetHotKeySpecifierLength (),
-                                  Bounds.Size.Height + GetHotKeySpecifierLength (false)
+                                  Viewport.Size.Width + GetHotKeySpecifierLength (),
+                                  Viewport.Size.Height + GetHotKeySpecifierLength (false)
                                  );
     }
 
@@ -324,7 +324,7 @@ public partial class View
                 return false;
             }
 
-            sizeRequired = Bounds.Size;
+            sizeRequired = Viewport.Size;
 
             if (AutoSize || string.IsNullOrEmpty (TextFormatter.Text))
             {
@@ -338,9 +338,9 @@ public partial class View
 
                     // TODO: v2 - This uses frame.Width; it should only use Bounds
                     if (_frame.Width < colWidth
-                        && (Width is null || (Bounds.Width >= 0 && Width is Dim.DimAbsolute && Width.Anchor (0) >= 0 && Width.Anchor (0) < colWidth)))
+                        && (Width is null || (Viewport.Width >= 0 && Width is Dim.DimAbsolute && Width.Anchor (0) >= 0 && Width.Anchor (0) < colWidth)))
                     {
-                        sizeRequired = new (colWidth, Bounds.Height);
+                        sizeRequired = new (colWidth, Viewport.Height);
 
                         return true;
                     }
@@ -349,7 +349,7 @@ public partial class View
                 default:
                     if (_frame.Height < 1 && (Height is null || (Height is Dim.DimAbsolute && Height.Anchor (0) == 0)))
                     {
-                        sizeRequired = new (Bounds.Width, 1);
+                        sizeRequired = new (Viewport.Width, 1);
 
                         return true;
                     }
@@ -392,7 +392,7 @@ public partial class View
         }
         else if (AutoSize && directionChanged && IsAdded)
         {
-            ResizeBoundsToFit (Bounds.Size);
+            ResizeBoundsToFit (Viewport.Size);
         }
 
         SetTextFormatterSize ();

+ 3 - 3
Terminal.Gui/Views/ColorPicker.cs

@@ -98,7 +98,7 @@ public class ColorPicker : View
 
         SetFocus ();
 
-        if (me.X > Bounds.Width || me.Y > Bounds.Height)
+        if (me.X > Viewport.Width || me.Y > Viewport.Height)
         {
             return true;
         }
@@ -164,9 +164,9 @@ public class ColorPicker : View
         Driver.SetAttribute (HasFocus ? ColorScheme.Focus : GetNormalColor ());
         var colorIndex = 0;
 
-        for (var y = 0; y < Bounds.Height / BoxHeight; y++)
+        for (var y = 0; y < Viewport.Height / BoxHeight; y++)
         {
-            for (var x = 0; x < Bounds.Width / BoxWidth; x++)
+            for (var x = 0; x < Viewport.Width / BoxWidth; x++)
             {
                 int foregroundColorIndex = y == 0 ? colorIndex + _cols : colorIndex - _cols;
                 Driver.SetAttribute (new Attribute ((ColorName)foregroundColorIndex, (ColorName)colorIndex));

+ 15 - 15
Terminal.Gui/Views/ComboBox.cs

@@ -245,8 +245,8 @@ public class ComboBox : View
     /// <inheritdoc/>
     protected internal override bool OnMouseEvent  (MouseEvent me)
     {
-        if (me.X == Bounds.Right - 1
-            && me.Y == Bounds.Top
+        if (me.X == Viewport.Right - 1
+            && me.Y == Viewport.Top
             && me.Flags == MouseFlags.Button1Pressed
             && _autoHide)
         {
@@ -294,7 +294,7 @@ public class ComboBox : View
         }
 
         Driver.SetAttribute (ColorScheme.Focus);
-        Move (Bounds.Right - 1, 0);
+        Move (Viewport.Right - 1, 0);
         Driver.AddRune (Glyphs.DownArrow);
     }
 
@@ -401,15 +401,15 @@ public class ComboBox : View
     /// <returns></returns>
     private int CalculatetHeight ()
     {
-        if (!IsInitialized || Bounds.Height == 0)
+        if (!IsInitialized || Viewport.Height == 0)
         {
             return 0;
         }
 
         return Math.Min (
-                         Math.Max (Bounds.Height - 1, _minimumHeight - 1),
+                         Math.Max (Viewport.Height - 1, _minimumHeight - 1),
                          _searchset?.Count > 0 ? _searchset.Count :
-                         IsShow ? Math.Max (Bounds.Height - 1, _minimumHeight - 1) : 0
+                         IsShow ? Math.Max (Viewport.Height - 1, _minimumHeight - 1) : 0
                         );
     }
 
@@ -491,10 +491,10 @@ public class ComboBox : View
         }
 
         Reset (true);
-        _listview.Clear (_listview.IsInitialized ? _listview.Bounds : Rectangle.Empty);
+        _listview.Clear (_listview.IsInitialized ? _listview.Viewport : Rectangle.Empty);
         _listview.TabStop = false;
         SuperView?.SendSubviewToBack (this);
-        Rectangle rect = _listview.BoundsToScreen (_listview.IsInitialized ? _listview.Bounds : Rectangle.Empty);
+        Rectangle rect = _listview.BoundsToScreen (_listview.IsInitialized ? _listview.Viewport : Rectangle.Empty);
         SuperView?.SetNeedsDisplay (rect);
         OnCollapsed ();
     }
@@ -607,18 +607,18 @@ public class ComboBox : View
 
     private void ProcessLayout ()
     {
-        if (Bounds.Height < _minimumHeight && (Height is null || Height is Dim.DimAbsolute))
+        if (Viewport.Height < _minimumHeight && (Height is null || Height is Dim.DimAbsolute))
         {
             Height = _minimumHeight;
         }
 
-        if ((!_autoHide && Bounds.Width > 0 && _search.Frame.Width != Bounds.Width)
-            || (_autoHide && Bounds.Width > 0 && _search.Frame.Width != Bounds.Width - 1))
+        if ((!_autoHide && Viewport.Width > 0 && _search.Frame.Width != Viewport.Width)
+            || (_autoHide && Viewport.Width > 0 && _search.Frame.Width != Viewport.Width - 1))
         {
-            _search.Width = _listview.Width = _autoHide ? Bounds.Width - 1 : Bounds.Width;
+            _search.Width = _listview.Width = _autoHide ? Viewport.Width - 1 : Viewport.Width;
             _listview.Height = CalculatetHeight ();
-            _search.SetRelativeLayout (Bounds);
-            _listview.SetRelativeLayout (Bounds);
+            _search.SetRelativeLayout (Viewport);
+            _listview.SetRelativeLayout (Viewport);
         }
     }
 
@@ -761,7 +761,7 @@ public class ComboBox : View
     private void ShowList ()
     {
         _listview.SetSource (_searchset);
-        _listview.Clear (Bounds); // Ensure list shrinks in Dialog as you type
+        _listview.Clear (Viewport); // Ensure list shrinks in Dialog as you type
         _listview.Height = CalculatetHeight ();
         SuperView?.BringSubviewToFront (this);
     }

+ 4 - 4
Terminal.Gui/Views/Dialog.cs

@@ -165,7 +165,7 @@ public class Dialog : Window
         {
             case ButtonAlignments.Center:
                 // Center Buttons
-                shiftLeft = (Bounds.Width - buttonsWidth - _buttons.Count - 1) / 2 + 1;
+                shiftLeft = (Viewport.Width - buttonsWidth - _buttons.Count - 1) / 2 + 1;
 
                 for (int i = _buttons.Count - 1; i >= 0; i--)
                 {
@@ -178,7 +178,7 @@ public class Dialog : Window
                     }
                     else
                     {
-                        button.X = Bounds.Width - shiftLeft;
+                        button.X = Viewport.Width - shiftLeft;
                     }
 
                     button.Y = Pos.AnchorEnd (1);
@@ -190,7 +190,7 @@ public class Dialog : Window
                 // Justify Buttons
                 // leftmost and rightmost buttons are hard against edges. The rest are evenly spaced.
 
-                var spacing = (int)Math.Ceiling ((double)(Bounds.Width - buttonsWidth) / (_buttons.Count - 1));
+                var spacing = (int)Math.Ceiling ((double)(Viewport.Width - buttonsWidth) / (_buttons.Count - 1));
 
                 for (int i = _buttons.Count - 1; i >= 0; i--)
                 {
@@ -206,7 +206,7 @@ public class Dialog : Window
                         if (i == 0)
                         {
                             // first (leftmost) button 
-                            int left = Bounds.Width;
+                            int left = Viewport.Width;
                             button.X = Pos.AnchorEnd (left);
                         }
                         else

+ 8 - 8
Terminal.Gui/Views/FileDialog.cs

@@ -414,16 +414,16 @@ public class FileDialog : Dialog
         if (!string.IsNullOrWhiteSpace (_feedback))
         {
             int feedbackWidth = _feedback.EnumerateRunes ().Sum (c => c.GetColumns ());
-            int feedbackPadLeft = (Bounds.Width - feedbackWidth) / 2 - 1;
+            int feedbackPadLeft = (Viewport.Width - feedbackWidth) / 2 - 1;
 
-            feedbackPadLeft = Math.Min (Bounds.Width, feedbackPadLeft);
+            feedbackPadLeft = Math.Min (Viewport.Width, feedbackPadLeft);
             feedbackPadLeft = Math.Max (0, feedbackPadLeft);
 
-            int feedbackPadRight = Bounds.Width - (feedbackPadLeft + feedbackWidth + 2);
-            feedbackPadRight = Math.Min (Bounds.Width, feedbackPadRight);
+            int feedbackPadRight = Viewport.Width - (feedbackPadLeft + feedbackWidth + 2);
+            feedbackPadRight = Math.Min (Viewport.Width, feedbackPadRight);
             feedbackPadRight = Math.Max (0, feedbackPadRight);
 
-            Move (0, Bounds.Height / 2);
+            Move (0, Viewport.Height / 2);
 
             Driver.SetAttribute (new Attribute (Color.Red, ColorScheme.Normal.Background));
             Driver.AddStr (new string (' ', feedbackPadLeft));
@@ -773,9 +773,9 @@ public class FileDialog : Dialog
             return 0;
         }
 
-        return Bounds.Width
-               - _btnOk.Bounds.Width
-               - _btnCancel.Bounds.Width
+        return Viewport.Width
+               - _btnOk.Viewport.Width
+               - _btnCancel.Viewport.Width
                - 1
 
                // TODO: Fiddle factor, seems the Bounds are wrong for someone

+ 7 - 7
Terminal.Gui/Views/GraphView/Annotations.cs

@@ -18,7 +18,7 @@ public interface IAnnotation
 
     /// <summary>
     ///     Called once after series have been rendered (or before if <see cref="BeforeSeries"/> is true). Use
-    ///     <see cref="View.Driver"/> to draw and <see cref="View.Bounds"/> to avoid drawing outside of graph
+    ///     <see cref="View.Driver"/> to draw and <see cref="View.Viewport"/> to avoid drawing outside of graph
     /// </summary>
     /// <param name="graph"></param>
     void Render (GraphView graph);
@@ -70,7 +70,7 @@ public class TextAnnotation : IAnnotation
     protected void DrawText (GraphView graph, int x, int y)
     {
         // the draw point is out of control bounds
-        if (!graph.Bounds.Contains (new Point (x, y)))
+        if (!graph.Viewport.Contains (new Point (x, y)))
         {
             return;
         }
@@ -83,7 +83,7 @@ public class TextAnnotation : IAnnotation
 
         graph.Move (x, y);
 
-        int availableWidth = graph.Bounds.Width - x;
+        int availableWidth = graph.Viewport.Width - x;
 
         if (availableWidth <= 0)
         {
@@ -127,7 +127,7 @@ public class LegendAnnotation : View, IAnnotation
     /// <summary>Returns false i.e. Legends render after series</summary>
     public bool BeforeSeries => false;
 
-    /// <summary>Draws the Legend and all entries into the area within <see cref="View.Bounds"/></summary>
+    /// <summary>Draws the Legend and all entries into the area within <see cref="View.Viewport"/></summary>
     /// <param name="graph"></param>
     public void Render (GraphView graph)
     {
@@ -165,13 +165,13 @@ public class LegendAnnotation : View, IAnnotation
             // add the text
             Move (1, linesDrawn);
 
-            string str = TextFormatter.ClipOrPad (entry.Item2, Bounds.Width - 1);
+            string str = TextFormatter.ClipOrPad (entry.Item2, Viewport.Width - 1);
             Application.Driver.AddStr (str);
 
             linesDrawn++;
 
             // Legend has run out of space
-            if (linesDrawn >= Bounds.Height)
+            if (linesDrawn >= Viewport.Height)
             {
                 break;
             }
@@ -182,7 +182,7 @@ public class LegendAnnotation : View, IAnnotation
     /// <param name="graphCellToRender">The symbol appearing on the graph that should appear in the legend</param>
     /// <param name="text">
     ///     Text to render on this line of the legend.  Will be truncated if outside of Legend
-    ///     <see cref="View.Bounds"/>
+    ///     <see cref="View.Viewport"/>
     /// </param>
     public void AddEntry (GraphCellToRender graphCellToRender, string text) { _entries.Add (Tuple.Create (graphCellToRender, text)); }
 }

+ 15 - 15
Terminal.Gui/Views/GraphView/Axis.cs

@@ -113,7 +113,7 @@ public class HorizontalAxis : Axis
             string toRender = text;
 
             // this is how much space is left
-            int xSpaceAvailable = graph.Bounds.Width - drawAtX;
+            int xSpaceAvailable = graph.Viewport.Width - drawAtX;
 
             // There is no space for the label at all!
             if (xSpaceAvailable <= 0)
@@ -127,7 +127,7 @@ public class HorizontalAxis : Axis
                 toRender = toRender.Substring (0, xSpaceAvailable);
             }
 
-            graph.Move (drawAtX, Math.Min (y + 1, graph.Bounds.Height - 1));
+            graph.Move (drawAtX, Math.Min (y + 1, graph.Viewport.Height - 1));
             driver.AddStr (toRender);
         }
     }
@@ -140,7 +140,7 @@ public class HorizontalAxis : Axis
             return;
         }
 
-        Rectangle bounds = graph.Bounds;
+        Rectangle bounds = graph.Viewport;
 
         IEnumerable<AxisIncrementToRender> labels = GetLabels (graph, bounds);
 
@@ -155,12 +155,12 @@ public class HorizontalAxis : Axis
             string toRender = Text;
 
             // if label is too long
-            if (toRender.Length > graph.Bounds.Width)
+            if (toRender.Length > graph.Viewport.Width)
             {
-                toRender = toRender.Substring (0, graph.Bounds.Width);
+                toRender = toRender.Substring (0, graph.Viewport.Width);
             }
 
-            graph.Move (graph.Bounds.Width / 2 - toRender.Length / 2, graph.Bounds.Height - 1);
+            graph.Move (graph.Viewport.Width / 2 - toRender.Length / 2, graph.Viewport.Height - 1);
             Application.Driver.AddStr (toRender);
         }
     }
@@ -174,7 +174,7 @@ public class HorizontalAxis : Axis
             return;
         }
 
-        Rectangle bounds = graph.Bounds;
+        Rectangle bounds = graph.Viewport;
 
         graph.Move (0, 0);
 
@@ -212,7 +212,7 @@ public class HorizontalAxis : Axis
 
         // float the X axis so that it accurately represents the origin of the graph
         // but anchor it to top/bottom if the origin is offscreen
-        return Math.Min (Math.Max (0, origin.Y), graph.Bounds.Height - ((int)graph.MarginBottom + 1));
+        return Math.Min (Math.Max (0, origin.Y), graph.Viewport.Height - ((int)graph.MarginBottom + 1));
     }
 
     /// <summary>Draws a horizontal axis line at the given <paramref name="x"/>, <paramref name="y"/> screen coordinates</summary>
@@ -317,7 +317,7 @@ public class VerticalAxis : Axis
             return;
         }
 
-        Rectangle bounds = graph.Bounds;
+        Rectangle bounds = graph.Viewport;
         IEnumerable<AxisIncrementToRender> labels = GetLabels (graph, bounds);
 
         foreach (AxisIncrementToRender label in labels)
@@ -331,13 +331,13 @@ public class VerticalAxis : Axis
             string toRender = Text;
 
             // if label is too long
-            if (toRender.Length > graph.Bounds.Height)
+            if (toRender.Length > graph.Viewport.Height)
             {
-                toRender = toRender.Substring (0, graph.Bounds.Height);
+                toRender = toRender.Substring (0, graph.Viewport.Height);
             }
 
             // Draw it 1 letter at a time vertically down row 0 of the control
-            int startDrawingAtY = graph.Bounds.Height / 2 - toRender.Length / 2;
+            int startDrawingAtY = graph.Viewport.Height / 2 - toRender.Length / 2;
 
             for (var i = 0; i < toRender.Length; i++)
             {
@@ -356,7 +356,7 @@ public class VerticalAxis : Axis
             return;
         }
 
-        Rectangle bounds = graph.Bounds;
+        Rectangle bounds = graph.Viewport;
 
         int x = GetAxisXPosition (graph);
 
@@ -385,7 +385,7 @@ public class VerticalAxis : Axis
 
         // float the Y axis so that it accurately represents the origin of the graph
         // but anchor it to left/right if the origin is offscreen
-        return Math.Min (Math.Max ((int)graph.MarginLeft, origin.X), graph.Bounds.Width - 1);
+        return Math.Min (Math.Max ((int)graph.MarginLeft, origin.X), graph.Viewport.Width - 1);
     }
 
     /// <summary>Draws a vertical axis line at the given <paramref name="x"/>, <paramref name="y"/> screen coordinates</summary>
@@ -409,7 +409,7 @@ public class VerticalAxis : Axis
             return graph.GraphSpaceToScreen (new PointF (0, Minimum.Value)).Y;
         }
 
-        return graph.Bounds.Height;
+        return graph.Viewport.Height;
     }
 
     private IEnumerable<AxisIncrementToRender> GetLabels (GraphView graph, Rectangle bounds)

+ 8 - 8
Terminal.Gui/Views/GraphView/GraphView.cs

@@ -192,7 +192,7 @@ public class GraphView : View
                           (int)((location.X - ScrollOffset.X) / CellSize.X) + (int)MarginLeft,
 
                           // screen coordinates are top down while graph coordinates are bottom up
-                          Bounds.Height - 1 - (int)MarginBottom - (int)((location.Y - ScrollOffset.Y) / CellSize.Y)
+                          Viewport.Height - 1 - (int)MarginBottom - (int)((location.Y - ScrollOffset.Y) / CellSize.Y)
                          );
     }
 
@@ -209,10 +209,10 @@ public class GraphView : View
         Move (0, 0);
 
         // clear all old content
-        for (var i = 0; i < Bounds.Height; i++)
+        for (var i = 0; i < Viewport.Height; i++)
         {
             Move (0, i);
-            Driver.AddStr (new string (' ', Bounds.Width));
+            Driver.AddStr (new string (' ', Viewport.Width));
         }
 
         // If there is no data do not display a graph
@@ -222,8 +222,8 @@ public class GraphView : View
         }
 
         // The drawable area of the graph (anything that isn't in the margins)
-        int graphScreenWidth = Bounds.Width - (int)MarginLeft;
-        int graphScreenHeight = Bounds.Height - (int)MarginBottom;
+        int graphScreenWidth = Viewport.Width - (int)MarginLeft;
+        int graphScreenHeight = Viewport.Height - (int)MarginBottom;
 
         // if the margins take up the full draw bounds don't render
         if (graphScreenWidth < 0 || graphScreenHeight < 0)
@@ -287,10 +287,10 @@ public class GraphView : View
     }
 
     /// <summary>Scrolls the graph down 1 page.</summary>
-    public void PageDown () { Scroll (0, -1 * CellSize.Y * Bounds.Height); }
+    public void PageDown () { Scroll (0, -1 * CellSize.Y * Viewport.Height); }
 
     /// <summary>Scrolls the graph up 1 page.</summary>
-    public void PageUp () { Scroll (0, CellSize.Y * Bounds.Height); }
+    public void PageUp () { Scroll (0, CellSize.Y * Viewport.Height); }
 
     /// <summary>
     ///     Clears all settings configured on the graph and resets all properties to default values (
@@ -316,7 +316,7 @@ public class GraphView : View
     {
         return new (
                     ScrollOffset.X + (col - MarginLeft) * CellSize.X,
-                    ScrollOffset.Y + (Bounds.Height - (row + MarginBottom + 1)) * CellSize.Y,
+                    ScrollOffset.Y + (Viewport.Height - (row + MarginBottom + 1)) * CellSize.Y,
                     CellSize.X,
                     CellSize.Y
                    );

+ 1 - 1
Terminal.Gui/Views/GraphView/Series.cs

@@ -192,7 +192,7 @@ public class BarSeries : ISeries
                 screenStart.X = graph.AxisY.GetAxisXPosition (graph);
 
                 // dont draw bar off the right of the control
-                screenEnd.X = Math.Min (graph.Bounds.Width - 1, screenEnd.X);
+                screenEnd.X = Math.Min (graph.Viewport.Width - 1, screenEnd.X);
 
                 // if bar is off the screen
                 if (screenStart.Y < 0 || screenStart.Y > drawBounds.Height - graph.MarginBottom)

+ 3 - 3
Terminal.Gui/Views/HexView.cs

@@ -373,7 +373,7 @@ public class HexView : View
         {
             Rectangle lineRect = new (0, line, frame.Width, 1);
 
-            if (!Bounds.Contains (lineRect))
+            if (!Viewport.Contains (lineRect))
             {
                 continue;
             }
@@ -611,9 +611,9 @@ public class HexView : View
         // Small buffers will just show the position, with the bsize field value (4 bytes)
         bytesPerLine = bsize;
 
-        if (Bounds.Width - displayWidth > 17)
+        if (Viewport.Width - displayWidth > 17)
         {
-            bytesPerLine = bsize * ((Bounds.Width - displayWidth) / 18);
+            bytesPerLine = bsize * ((Viewport.Width - displayWidth) / 18);
         }
     }
 

+ 1 - 1
Terminal.Gui/Views/LineView.cs

@@ -63,7 +63,7 @@ public class LineView : View
 
         int hLineWidth = Math.Max (1, Glyphs.HLine.GetColumns ());
 
-        int dEnd = Orientation == Orientation.Horizontal ? Bounds.Width : Bounds.Height;
+        int dEnd = Orientation == Orientation.Horizontal ? Viewport.Width : Viewport.Height;
 
         for (var d = 0; d < dEnd; d += hLineWidth)
         {

+ 14 - 14
Terminal.Gui/Views/ListView.cs

@@ -318,9 +318,9 @@ public class ListView : View
             {
                 _top = Math.Max (_selected, 0);
             }
-            else if (Bounds.Height > 0 && _selected >= _top + Bounds.Height)
+            else if (Viewport.Height > 0 && _selected >= _top + Viewport.Height)
             {
-                _top = Math.Max (_selected - Bounds.Height + 1, 0);
+                _top = Math.Max (_selected - Viewport.Height + 1, 0);
             }
 
             LayoutStarted -= ListView_LayoutStarted;
@@ -399,7 +399,7 @@ public class ListView : View
 
         if (me.Y + _top >= _source.Count
             || me.Y + _top < 0
-            || me.Y + _top > _top + Bounds.Height)
+            || me.Y + _top > _top + Viewport.Height)
         {
             return true;
         }
@@ -449,7 +449,7 @@ public class ListView : View
             //can move by down by one.
             _selected++;
 
-            if (_selected >= _top + Bounds.Height)
+            if (_selected >= _top + Viewport.Height)
             {
                 _top++;
             }
@@ -466,9 +466,9 @@ public class ListView : View
             OnSelectedChanged ();
             SetNeedsDisplay ();
         }
-        else if (_selected >= _top + Bounds.Height)
+        else if (_selected >= _top + Viewport.Height)
         {
-            _top = Math.Max (_source.Count - Bounds.Height, 0);
+            _top = Math.Max (_source.Count - Viewport.Height, 0);
             SetNeedsDisplay ();
         }
 
@@ -483,7 +483,7 @@ public class ListView : View
         {
             _selected = _source.Count - 1;
 
-            if (_top + _selected > Bounds.Height - 1)
+            if (_top + _selected > Viewport.Height - 1)
             {
                 _top = Math.Max (_selected, 0);
             }
@@ -517,7 +517,7 @@ public class ListView : View
     /// <returns></returns>
     public virtual bool MovePageDown ()
     {
-        int n = _selected + Bounds.Height;
+        int n = _selected + Viewport.Height;
 
         if (n >= _source.Count)
         {
@@ -528,7 +528,7 @@ public class ListView : View
         {
             _selected = n;
 
-            if (_source.Count >= Bounds.Height)
+            if (_source.Count >= Viewport.Height)
             {
                 _top = Math.Max (_selected, 0);
             }
@@ -548,7 +548,7 @@ public class ListView : View
     /// <returns></returns>
     public virtual bool MovePageUp ()
     {
-        int n = _selected - Bounds.Height;
+        int n = _selected - Viewport.Height;
 
         if (n < 0)
         {
@@ -598,9 +598,9 @@ public class ListView : View
             {
                 _top = Math.Max (_selected, 0);
             }
-            else if (_selected > _top + Bounds.Height)
+            else if (_selected > _top + Viewport.Height)
             {
-                _top = Math.Max (_selected - Bounds.Height + 1, 0);
+                _top = Math.Max (_selected - Viewport.Height + 1, 0);
             }
 
             OnSelectedChanged ();
@@ -623,7 +623,7 @@ public class ListView : View
         Attribute current = ColorScheme.Focus;
         Driver.SetAttribute (current);
         Move (0, 0);
-        Rectangle f = Bounds;
+        Rectangle f = Viewport;
         int item = _top;
         bool focused = HasFocus;
         int col = _allowsMarking ? 2 : 0;
@@ -768,7 +768,7 @@ public class ListView : View
         }
         else
         {
-            Move (Bounds.Width - 1, _selected - _top);
+            Move (Viewport.Width - 1, _selected - _top);
         }
     }
 

+ 6 - 6
Terminal.Gui/Views/Menu/Menu.cs

@@ -769,14 +769,14 @@ internal sealed class Menu : View
         OnDrawAdornments ();
         OnRenderLineCanvas ();
 
-        for (int i = Bounds.Y; i < _barItems.Children.Length; i++)
+        for (int i = Viewport.Y; i < _barItems.Children.Length; i++)
         {
             if (i < 0)
             {
                 continue;
             }
 
-            if (BoundsToScreen (Bounds).Y + i >= Driver.Rows)
+            if (BoundsToScreen (Viewport).Y + i >= Driver.Rows)
             {
                 break;
             }
@@ -800,7 +800,7 @@ internal sealed class Menu : View
 
             Driver.SetAttribute (DetermineColorSchemeFor (item, i));
 
-            for (int p = Bounds.X; p < Frame.Width - 2; p++)
+            for (int p = Viewport.X; p < Frame.Width - 2; p++)
             {
                 // This - 2 is for the border
                 if (p < 0)
@@ -808,7 +808,7 @@ internal sealed class Menu : View
                     continue;
                 }
 
-                if (BoundsToScreen (Bounds).X + p >= Driver.Cols)
+                if (BoundsToScreen (Viewport).X + p >= Driver.Cols)
                 {
                     break;
                 }
@@ -894,7 +894,7 @@ internal sealed class Menu : View
                              BoundsToScreen (new (1, i, Frame.Width - 3, 1)),
                              i == _currentChild ? ColorScheme.Focus : GetNormalColor (),
                              i == _currentChild ? ColorScheme.HotFocus : ColorScheme.HotNormal,
-                             SuperView?.BoundsToScreen (SuperView.Bounds) ?? Rectangle.Empty
+                             SuperView?.BoundsToScreen (SuperView.Viewport) ?? Rectangle.Empty
                             );
                 }
                 else
@@ -937,7 +937,7 @@ internal sealed class Menu : View
     {
         if (Visible)
         {
-            OnDrawContent (Bounds);
+            OnDrawContent (Viewport);
         }
     }
 

+ 1 - 1
Terminal.Gui/Views/MessageBox.cs

@@ -394,7 +394,7 @@ public static class MessageBox
                         }
 
                         // TODO: replace with Dim.Fit when implemented
-                        Rectangle maxBounds = d.SuperView?.Bounds ?? Application.Top.Bounds;
+                        Rectangle maxBounds = d.SuperView?.Viewport ?? Application.Top.Viewport;
 
                         Thickness adornmentsThickness = d.GetAdornmentsThickness ();
 

+ 8 - 8
Terminal.Gui/Views/ProgressBar.cs

@@ -151,7 +151,7 @@ public class ProgressBar : View
 
         if (_isActivity)
         {
-            for (var i = 0; i < Bounds.Width; i++)
+            for (var i = 0; i < Viewport.Width; i++)
             {
                 if (Array.IndexOf (_activityPos, i) != -1)
                 {
@@ -165,15 +165,15 @@ public class ProgressBar : View
         }
         else
         {
-            var mid = (int)(_fraction * Bounds.Width);
+            var mid = (int)(_fraction * Viewport.Width);
             int i;
 
-            for (i = 0; (i < mid) & (i < Bounds.Width); i++)
+            for (i = 0; (i < mid) & (i < Viewport.Width); i++)
             {
                 Driver.AddRune (SegmentCharacter);
             }
 
-            for (; i < Bounds.Width; i++)
+            for (; i < Viewport.Width; i++)
             {
                 Driver.AddRune ((Rune)' ');
             }
@@ -190,10 +190,10 @@ public class ProgressBar : View
             }
 
             tf?.Draw (
-                      BoundsToScreen (Bounds),
+                      BoundsToScreen (Viewport),
                       attr,
                       ColorScheme.Normal,
-                      SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rectangle)
+                      SuperView?.BoundsToScreen (SuperView.Viewport) ?? default (Rectangle)
                      );
         }
     }
@@ -244,13 +244,13 @@ public class ProgressBar : View
 
                 _delta = 1;
             }
-            else if (_activityPos [0] >= Bounds.Width)
+            else if (_activityPos [0] >= Viewport.Width)
             {
                 if (_bidirectionalMarquee)
                 {
                     for (var i = 0; i < _activityPos.Length; i++)
                     {
-                        _activityPos [i] = Bounds.Width + i - 2;
+                        _activityPos [i] = Viewport.Width + i - 2;
                     }
 
                     _delta = -1;

+ 24 - 24
Terminal.Gui/Views/ScrollBarView.cs

@@ -152,14 +152,14 @@ public class ScrollBarView : View
                 _keepContentAlwaysInViewport = value;
                 var pos = 0;
 
-                if (value && !_vertical && _position + Host.Bounds.Width > _size)
+                if (value && !_vertical && _position + Host.Viewport.Width > _size)
                 {
-                    pos = _size - Host.Bounds.Width + (_showBothScrollIndicator ? 1 : 0);
+                    pos = _size - Host.Viewport.Width + (_showBothScrollIndicator ? 1 : 0);
                 }
 
-                if (value && _vertical && _position + Host.Bounds.Height > _size)
+                if (value && _vertical && _position + Host.Viewport.Height > _size)
                 {
-                    pos = _size - Host.Bounds.Height + (_showBothScrollIndicator ? 1 : 0);
+                    pos = _size - Host.Viewport.Height + (_showBothScrollIndicator ? 1 : 0);
                 }
 
                 if (pos != 0)
@@ -301,7 +301,7 @@ public class ScrollBarView : View
         }
 
         int location = _vertical ? mouseEvent.Y : mouseEvent.X;
-        int barsize = _vertical ? Bounds.Height : Bounds.Width;
+        int barsize = _vertical ? Viewport.Height : Viewport.Width;
         int posTopLeftTee = _vertical ? _posTopTee + 1 : _posLeftTee + 1;
         int posBottomRightTee = _vertical ? _posBottomTee + 1 : _posRightTee + 1;
         barsize -= 2;
@@ -461,7 +461,7 @@ public class ScrollBarView : View
             return;
         }
 
-        if (Size == 0 || (_vertical && Bounds.Height == 0) || (!_vertical && Bounds.Width == 0))
+        if (Size == 0 || (_vertical && Viewport.Height == 0) || (!_vertical && Viewport.Width == 0))
         {
             return;
         }
@@ -470,13 +470,13 @@ public class ScrollBarView : View
 
         if (_vertical)
         {
-            if (Bounds.Right < Bounds.Width - 1)
+            if (Viewport.Right < Viewport.Width - 1)
             {
                 return;
             }
 
-            int col = Bounds.Width - 1;
-            int bh = Bounds.Height;
+            int col = Viewport.Width - 1;
+            int bh = Viewport.Height;
             Rune special;
 
             if (bh < 4)
@@ -486,7 +486,7 @@ public class ScrollBarView : View
 
                 Move (col, 0);
 
-                if (Bounds.Height == 1)
+                if (Viewport.Height == 1)
                 {
                     Driver.AddRune (Glyphs.Diamond);
                 }
@@ -495,15 +495,15 @@ public class ScrollBarView : View
                     Driver.AddRune (Glyphs.UpArrow);
                 }
 
-                if (Bounds.Height == 3)
+                if (Viewport.Height == 3)
                 {
                     Move (col, 1);
                     Driver.AddRune (Glyphs.Diamond);
                 }
 
-                if (Bounds.Height > 1)
+                if (Viewport.Height > 1)
                 {
-                    Move (col, Bounds.Height - 1);
+                    Move (col, Viewport.Height - 1);
                     Driver.AddRune (Glyphs.DownArrow);
                 }
             }
@@ -572,23 +572,23 @@ public class ScrollBarView : View
 
                 if (!hasTopTee)
                 {
-                    Move (col, Bounds.Height - 2);
+                    Move (col, Viewport.Height - 2);
                     Driver.AddRune (Glyphs.TopTee);
                 }
 
-                Move (col, Bounds.Height - 1);
+                Move (col, Viewport.Height - 1);
                 Driver.AddRune (Glyphs.DownArrow);
             }
         }
         else
         {
-            if (Bounds.Bottom < Bounds.Height - 1)
+            if (Viewport.Bottom < Viewport.Height - 1)
             {
                 return;
             }
 
-            int row = Bounds.Height - 1;
-            int bw = Bounds.Width;
+            int row = Viewport.Height - 1;
+            int bw = Viewport.Width;
             Rune special;
 
             if (bw < 4)
@@ -663,7 +663,7 @@ public class ScrollBarView : View
 
                 if (!hasLeftTee)
                 {
-                    Move (Bounds.Width - 2, row);
+                    Move (Viewport.Width - 2, row);
                     Driver.AddRune (Glyphs.LeftTee);
                 }
 
@@ -685,7 +685,7 @@ public class ScrollBarView : View
 
     internal bool CanScroll (int n, out int max, bool isVertical = false)
     {
-        if (Host?.Bounds.IsEmpty != false)
+        if (Host?.Viewport.IsEmpty != false)
         {
             max = 0;
 
@@ -706,7 +706,7 @@ public class ScrollBarView : View
 
     private bool CheckBothScrollBars (ScrollBarView scrollBarView, bool pending = false)
     {
-        int barsize = scrollBarView._vertical ? scrollBarView.Bounds.Height : scrollBarView.Bounds.Width;
+        int barsize = scrollBarView._vertical ? scrollBarView.Viewport.Height : scrollBarView.Viewport.Width;
 
         if (barsize == 0 || barsize >= scrollBarView._size)
         {
@@ -845,15 +845,15 @@ public class ScrollBarView : View
 
     private int GetBarsize (bool isVertical)
     {
-        if (Host?.Bounds.IsEmpty != false)
+        if (Host?.Viewport.IsEmpty != false)
         {
             return 0;
         }
 
         return isVertical ? KeepContentAlwaysInViewport
-                                ? Host.Bounds.Height + (_showBothScrollIndicator ? -2 : -1)
+                                ? Host.Viewport.Height + (_showBothScrollIndicator ? -2 : -1)
                                 : 0 :
-               KeepContentAlwaysInViewport ? Host.Bounds.Width + (_showBothScrollIndicator ? -2 : -1) : 0;
+               KeepContentAlwaysInViewport ? Host.Viewport.Width + (_showBothScrollIndicator ? -2 : -1) : 0;
     }
 
     private void Host_EnabledChanged (object sender, EventArgs e)

+ 16 - 16
Terminal.Gui/Views/ScrollView.cs

@@ -83,10 +83,10 @@ public class ScrollView : View
         AddCommand (Command.ScrollDown, () => ScrollDown (1));
         AddCommand (Command.ScrollLeft, () => ScrollLeft (1));
         AddCommand (Command.ScrollRight, () => ScrollRight (1));
-        AddCommand (Command.PageUp, () => ScrollUp (Bounds.Height));
-        AddCommand (Command.PageDown, () => ScrollDown (Bounds.Height));
-        AddCommand (Command.PageLeft, () => ScrollLeft (Bounds.Width));
-        AddCommand (Command.PageRight, () => ScrollRight (Bounds.Width));
+        AddCommand (Command.PageUp, () => ScrollUp (Viewport.Height));
+        AddCommand (Command.PageDown, () => ScrollDown (Viewport.Height));
+        AddCommand (Command.PageLeft, () => ScrollLeft (Viewport.Width));
+        AddCommand (Command.PageRight, () => ScrollRight (Viewport.Width));
         AddCommand (Command.TopHome, () => ScrollUp (_contentSize.Height));
         AddCommand (Command.BottomEnd, () => ScrollDown (_contentSize.Height));
         AddCommand (Command.LeftHome, () => ScrollLeft (_contentSize.Width));
@@ -210,26 +210,26 @@ public class ScrollView : View
                 _horizontal.OtherScrollBarView.KeepContentAlwaysInViewport = value;
                 Point p = default;
 
-                if (value && -_contentOffset.X + Bounds.Width > _contentSize.Width)
+                if (value && -_contentOffset.X + Viewport.Width > _contentSize.Width)
                 {
                     p = new Point (
-                                   _contentSize.Width - Bounds.Width + (_showVerticalScrollIndicator ? 1 : 0),
+                                   _contentSize.Width - Viewport.Width + (_showVerticalScrollIndicator ? 1 : 0),
                                    -_contentOffset.Y
                                   );
                 }
 
-                if (value && -_contentOffset.Y + Bounds.Height > _contentSize.Height)
+                if (value && -_contentOffset.Y + Viewport.Height > _contentSize.Height)
                 {
                     if (p == default (Point))
                     {
                         p = new Point (
                                        -_contentOffset.X,
-                                       _contentSize.Height - Bounds.Height + (_showHorizontalScrollIndicator ? 1 : 0)
+                                       _contentSize.Height - Viewport.Height + (_showHorizontalScrollIndicator ? 1 : 0)
                                       );
                     }
                     else
                     {
-                        p.Y = _contentSize.Height - Bounds.Height + (_showHorizontalScrollIndicator ? 1 : 0);
+                        p.Y = _contentSize.Height - Viewport.Height + (_showHorizontalScrollIndicator ? 1 : 0);
                     }
                 }
 
@@ -612,7 +612,7 @@ public class ScrollView : View
         bool v = false, h = false;
         var p = false;
 
-        if (Bounds.Height == 0 || Bounds.Height > _contentSize.Height)
+        if (Viewport.Height == 0 || Viewport.Height > _contentSize.Height)
         {
             if (ShowVerticalScrollIndicator)
             {
@@ -621,7 +621,7 @@ public class ScrollView : View
 
             v = false;
         }
-        else if (Bounds.Height > 0 && Bounds.Height == _contentSize.Height)
+        else if (Viewport.Height > 0 && Viewport.Height == _contentSize.Height)
         {
             p = true;
         }
@@ -635,7 +635,7 @@ public class ScrollView : View
             v = true;
         }
 
-        if (Bounds.Width == 0 || Bounds.Width > _contentSize.Width)
+        if (Viewport.Width == 0 || Viewport.Width > _contentSize.Width)
         {
             if (ShowHorizontalScrollIndicator)
             {
@@ -644,7 +644,7 @@ public class ScrollView : View
 
             h = false;
         }
-        else if (Bounds.Width > 0 && Bounds.Width == _contentSize.Width && p)
+        else if (Viewport.Width > 0 && Viewport.Width == _contentSize.Width && p)
         {
             if (ShowHorizontalScrollIndicator)
             {
@@ -696,13 +696,13 @@ public class ScrollView : View
 
         if (v)
         {
-            _vertical.SetRelativeLayout (Bounds);
+            _vertical.SetRelativeLayout (Viewport);
             _vertical.Draw ();
         }
 
         if (h)
         {
-            _horizontal.SetRelativeLayout (Bounds);
+            _horizontal.SetRelativeLayout (Viewport);
             _horizontal.Draw ();
         }
 
@@ -710,7 +710,7 @@ public class ScrollView : View
 
         if (v && h)
         {
-            _contentBottomRightCorner.SetRelativeLayout (Bounds);
+            _contentBottomRightCorner.SetRelativeLayout (Viewport);
             _contentBottomRightCorner.Draw ();
         }
     }

+ 15 - 15
Terminal.Gui/Views/Slider.cs

@@ -669,11 +669,11 @@ public class Slider<T> : View
                 // Calculate the size of the slider based on the size of the SuperView's Bounds.
                 if (_config._sliderOrientation == Orientation.Horizontal)
                 {
-                    size = int.Min (SuperView.Bounds.Width, CalcBestLength ());
+                    size = int.Min (SuperView.Viewport.Width, CalcBestLength ());
                 }
                 else
                 {
-                    size = int.Min (SuperView.Bounds.Height, CalcBestLength ());
+                    size = int.Min (SuperView.Viewport.Height, CalcBestLength ());
                 }
             }
             else
@@ -689,11 +689,11 @@ public class Slider<T> : View
             // Fit Slider to the Bounds
             if (_config._sliderOrientation == Orientation.Horizontal)
             {
-                size = Bounds.Width;
+                size = Viewport.Width;
             }
             else
             {
-                size = Bounds.Height;
+                size = Viewport.Height;
             }
         }
 
@@ -777,15 +777,15 @@ public class Slider<T> : View
 
         if (_config._sliderOrientation == Orientation.Horizontal)
         {
-            Bounds = new (
-                          Bounds.Location,
+            Viewport = new (
+                          Viewport.Location,
                           new (
                                int.Min (
-                                        SuperView.Bounds.Width - adornmentsThickness.Horizontal,
+                                        SuperView.Viewport.Width - adornmentsThickness.Horizontal,
                                         CalcBestLength ()
                                        ),
                                int.Min (
-                                        SuperView.Bounds.Height - adornmentsThickness.Vertical,
+                                        SuperView.Viewport.Height - adornmentsThickness.Vertical,
                                         CalcThickness ()
                                        )
                               )
@@ -793,15 +793,15 @@ public class Slider<T> : View
         }
         else
         {
-            Bounds = new (
-                          Bounds.Location,
+            Viewport = new (
+                          Viewport.Location,
                           new (
                                int.Min (
-                                        SuperView.Bounds.Width - adornmentsThickness.Horizontal,
+                                        SuperView.Viewport.Width - adornmentsThickness.Horizontal,
                                         CalcThickness ()
                                        ),
                                int.Min (
-                                        SuperView.Bounds.Height - adornmentsThickness.Vertical,
+                                        SuperView.Viewport.Height - adornmentsThickness.Vertical,
                                         CalcBestLength ()
                                        )
                               )
@@ -988,7 +988,7 @@ public class Slider<T> : View
 
         if (TryGetPositionByOption (FocusedOption, out (int x, int y) position))
         {
-            if (IsInitialized && Bounds.Contains (position.x, position.y))
+            if (IsInitialized && Viewport.Contains (position.x, position.y))
             {
                 Move (position.x, position.y);
             }
@@ -1073,7 +1073,7 @@ public class Slider<T> : View
     private void DrawSlider ()
     {
         // TODO: be more surgical on clear
-        Clear (Bounds);
+        Clear (Viewport);
 
         // Attributes
 
@@ -1241,7 +1241,7 @@ public class Slider<T> : View
             }
         }
 
-        int remaining = isVertical ? Bounds.Height - y : Bounds.Width - x;
+        int remaining = isVertical ? Viewport.Height - y : Viewport.Width - x;
 
         // Right Spacing
         if (_config._showEndSpacing)

+ 7 - 7
Terminal.Gui/Views/TabView.cs

@@ -297,7 +297,7 @@ public class TabView : View
         }
 
         // if current viewport does not include the selected tab
-        if (!CalculateViewport (Bounds).Any (r => Equals (SelectedTab, r.Tab)))
+        if (!CalculateViewport (Viewport).Any (r => Equals (SelectedTab, r.Tab)))
         {
             // Set scroll offset so the first tab rendered is the
             TabScrollOffset = Math.Max (0, Tabs.IndexOf (SelectedTab));
@@ -659,7 +659,7 @@ public class TabView : View
 
         public override void OnDrawContent (Rectangle contentArea)
         {
-            _host._tabLocations = _host.CalculateViewport (Bounds).ToArray ();
+            _host._tabLocations = _host.CalculateViewport (Viewport).ToArray ();
 
             // clear any old text
             Clear (contentArea);
@@ -683,7 +683,7 @@ public class TabView : View
             for (var i = 0; i < tabLocations.Length; i++)
             {
                 View tab = tabLocations [i].Tab;
-                Rectangle vts = tab.BoundsToScreen (tab.Bounds);
+                Rectangle vts = tab.BoundsToScreen (tab.Viewport);
                 var lc = new LineCanvas ();
                 int selectedOffset = _host.Style.ShowTopLine && tabLocations [i].IsSelected ? 0 : 1;
 
@@ -1115,7 +1115,7 @@ public class TabView : View
 
                     int lastSelectedTab = !_host.Style.ShowTopLine && i == selectedTab ? 1 :
                                           _host.Style.TabsOnBottom ? 1 : 0;
-                    Rectangle tabsBarVts = BoundsToScreen (Bounds);
+                    Rectangle tabsBarVts = BoundsToScreen (Viewport);
                     int lineLength = tabsBarVts.Right - vts.Right;
 
                     // Right horizontal line
@@ -1238,7 +1238,7 @@ public class TabView : View
 
             View selected = null;
             int topLine = _host.Style.ShowTopLine ? 1 : 0;
-            int width = Bounds.Width;
+            int width = Viewport.Width;
 
             foreach (TabToRender toRender in tabLocations)
             {
@@ -1314,7 +1314,7 @@ public class TabView : View
                 }
 
                 tab.TextFormatter.Draw (
-                                        tab.BoundsToScreen (tab.Bounds),
+                                        tab.BoundsToScreen (tab.Viewport),
                                         prevAttr,
                                         ColorScheme.HotNormal
                                        );
@@ -1360,7 +1360,7 @@ public class TabView : View
             // if there are more tabs to the right not visible
             if (ShouldDrawRightScrollIndicator ())
             {
-                _rightScrollIndicator.X = Bounds.Width - 1;
+                _rightScrollIndicator.X = Viewport.Width - 1;
                 _rightScrollIndicator.Y = y;
 
                 // indicate that

+ 4 - 4
Terminal.Gui/Views/TableView/ListTableSource.cs

@@ -109,12 +109,12 @@ public class ListTableSource : ITableSource
 
         if (Style.Orientation == Orientation.Vertical != Style.ScrollParallel)
         {
-            float f = (float)_tableView.Bounds.Height - _tableView.GetHeaderHeight ();
+            float f = (float)_tableView.Viewport.Height - _tableView.GetHeaderHeight ();
             cols = (int)Math.Ceiling (Count / f);
         }
         else
         {
-            cols = (int)Math.Ceiling (((float)_tableView.Bounds.Width - 1) / colWidth) - 2;
+            cols = (int)Math.Ceiling (((float)_tableView.Viewport.Width - 1) / colWidth) - 2;
         }
 
         return cols > 1 ? cols : 1;
@@ -179,7 +179,7 @@ public class ListTableSource : ITableSource
 
     private void TableView_DrawContent (object sender, DrawEventArgs e)
     {
-        if (!_tableView.Bounds.Equals (_lastBounds)
+        if (!_tableView.Viewport.Equals (_lastBounds)
             || _tableView.MaxCellWidth != _lastMaxCellWidth
             || _tableView.MinCellWidth != _lastMinCellWidth
             || Style != _lastStyle
@@ -188,7 +188,7 @@ public class ListTableSource : ITableSource
             DataTable = CreateTable (CalculateColumns ());
         }
 
-        _lastBounds = _tableView.Bounds;
+        _lastBounds = _tableView.Viewport;
         _lastMinCellWidth = _tableView.MaxCellWidth;
         _lastMaxCellWidth = _tableView.MaxCellWidth;
         _lastStyle = Style;

+ 20 - 20
Terminal.Gui/Views/TableView/TableView.cs

@@ -483,7 +483,7 @@ public class TableView : View
             return null;
         }
 
-        IEnumerable<ColumnToRender> viewPort = CalculateViewport (Bounds);
+        IEnumerable<ColumnToRender> viewPort = CalculateViewport (Viewport);
 
         int headerHeight = GetHeaderHeightIfAny ();
 
@@ -502,7 +502,7 @@ public class TableView : View
         }
 
         // the cell is way down below the scroll area and off the screen
-        if (tableRow > RowOffset + (Bounds.Height - headerHeight))
+        if (tableRow > RowOffset + (Viewport.Height - headerHeight))
         {
             return null;
         }
@@ -577,7 +577,7 @@ public class TableView : View
             return;
         }
 
-        ColumnToRender [] columnsToRender = CalculateViewport (Bounds).ToArray ();
+        ColumnToRender [] columnsToRender = CalculateViewport (Viewport).ToArray ();
         int headerHeight = GetHeaderHeightIfAny ();
 
         //if we have scrolled too far to the left 
@@ -595,7 +595,7 @@ public class TableView : View
                 while (SelectedColumn > columnsToRender.Max (r => r.Column))
                 {
                     ColumnOffset++;
-                    columnsToRender = CalculateViewport (Bounds).ToArray ();
+                    columnsToRender = CalculateViewport (Viewport).ToArray ();
 
                     // if we are already scrolled to the last column then break
                     // this will prevent any theoretical infinite loop
@@ -612,9 +612,9 @@ public class TableView : View
         }
 
         //if we have scrolled too far down
-        if (SelectedRow >= RowOffset + (Bounds.Height - headerHeight))
+        if (SelectedRow >= RowOffset + (Viewport.Height - headerHeight))
         {
-            RowOffset = SelectedRow - (Bounds.Height - headerHeight) + 1;
+            RowOffset = SelectedRow - (Viewport.Height - headerHeight) + 1;
         }
 
         //if we have scrolled too far up
@@ -906,12 +906,12 @@ public class TableView : View
         scrollLeftPoint = null;
 
         // What columns to render at what X offset in viewport
-        ColumnToRender [] columnsToRender = CalculateViewport (Bounds).ToArray ();
+        ColumnToRender [] columnsToRender = CalculateViewport (Viewport).ToArray ();
 
         Driver.SetAttribute (GetNormalColor ());
 
         //invalidate current row (prevents scrolling around leaving old characters in the frame
-        Driver.AddStr (new string (' ', Bounds.Width));
+        Driver.AddStr (new string (' ', Viewport.Width));
 
         var line = 0;
 
@@ -925,7 +925,7 @@ public class TableView : View
             */
             if (Style.ShowHorizontalHeaderOverline)
             {
-                RenderHeaderOverline (line, Bounds.Width, columnsToRender);
+                RenderHeaderOverline (line, Viewport.Width, columnsToRender);
                 line++;
             }
 
@@ -937,7 +937,7 @@ public class TableView : View
 
             if (Style.ShowHorizontalHeaderUnderline)
             {
-                RenderHeaderUnderline (line, Bounds.Width, columnsToRender);
+                RenderHeaderUnderline (line, Viewport.Width, columnsToRender);
                 line++;
             }
         }
@@ -945,9 +945,9 @@ public class TableView : View
         int headerLinesConsumed = line;
 
         //render the cells
-        for (; line < Bounds.Height; line++)
+        for (; line < Viewport.Height; line++)
         {
-            ClearLine (line, Bounds.Width);
+            ClearLine (line, Viewport.Width);
 
             //work out what Row to render
             int rowToRender = RowOffset + (line - headerLinesConsumed);
@@ -963,7 +963,7 @@ public class TableView : View
             {
                 if (rowToRender == Table.Rows && Style.ShowHorizontalBottomline)
                 {
-                    RenderBottomLine (line, Bounds.Width, columnsToRender);
+                    RenderBottomLine (line, Viewport.Width, columnsToRender);
                 }
 
                 continue;
@@ -1001,7 +1001,7 @@ public class TableView : View
     /// <param name="extend">true to extend the current selection (if any) instead of replacing</param>
     public void PageDown (bool extend)
     {
-        ChangeSelectionByOffset (0, Bounds.Height - GetHeaderHeightIfAny (), extend);
+        ChangeSelectionByOffset (0, Viewport.Height - GetHeaderHeightIfAny (), extend);
         Update ();
     }
 
@@ -1009,7 +1009,7 @@ public class TableView : View
     /// <param name="extend">true to extend the current selection (if any) instead of replacing</param>
     public void PageUp (bool extend)
     {
-        ChangeSelectionByOffset (0, -(Bounds.Height - GetHeaderHeightIfAny ()), extend);
+        ChangeSelectionByOffset (0, -(Viewport.Height - GetHeaderHeightIfAny ()), extend);
         Update ();
     }
 
@@ -1073,7 +1073,7 @@ public class TableView : View
             return null;
         }
 
-        IEnumerable<ColumnToRender> viewPort = CalculateViewport (Bounds);
+        IEnumerable<ColumnToRender> viewPort = CalculateViewport (Viewport);
 
         int headerHeight = GetHeaderHeightIfAny ();
 
@@ -1658,7 +1658,7 @@ public class TableView : View
         // Renders something like:
         // │ArithmeticComparator│chi       │Healthboard│Interpretation│Labnumber│
 
-        ClearLine (row, Bounds.Width);
+        ClearLine (row, Viewport.Width);
 
         //render start of line
         if (style.ShowVerticalHeaderLines)
@@ -1688,7 +1688,7 @@ public class TableView : View
         //render end of line
         if (style.ShowVerticalHeaderLines)
         {
-            AddRune (Bounds.Width - 1, row, Glyphs.VLine);
+            AddRune (Viewport.Width - 1, row, Glyphs.VLine);
         }
     }
 
@@ -1846,7 +1846,7 @@ public class TableView : View
         }
 
         Driver.SetAttribute (color);
-        Driver.AddStr (new string (' ', Bounds.Width));
+        Driver.AddStr (new string (' ', Viewport.Width));
 
         // Render cells for each visible header for the current row
         for (var i = 0; i < columnsToRender.Length; i++)
@@ -1955,7 +1955,7 @@ public class TableView : View
 
             //render start and end of line
             AddRune (0, row, Glyphs.VLine);
-            AddRune (Bounds.Width - 1, row, Glyphs.VLine);
+            AddRune (Viewport.Width - 1, row, Glyphs.VLine);
         }
     }
 

+ 6 - 6
Terminal.Gui/Views/TextField.cs

@@ -1196,8 +1196,8 @@ public class TextField : View
 
         int pos = _cursorPosition - ScrollOffset + Math.Min (Frame.X, 0);
         int offB = OffSetBackground ();
-        Rectangle containerFrame = SuperView?.BoundsToScreen (SuperView.Bounds) ?? default (Rectangle);
-        Rectangle thisFrame = BoundsToScreen (Bounds);
+        Rectangle containerFrame = SuperView?.BoundsToScreen (SuperView.Viewport) ?? default (Rectangle);
+        Rectangle thisFrame = BoundsToScreen (Viewport);
 
         if (pos > -1
             && col >= pos
@@ -1878,9 +1878,9 @@ public class TextField : View
         Move (0, 0);
         string render = Caption;
 
-        if (render.GetColumns () > Bounds.Width)
+        if (render.GetColumns () > Viewport.Width)
         {
-            render = render [..Bounds.Width];
+            render = render [..Viewport.Width];
         }
 
         Driver.AddStr (render);
@@ -1941,9 +1941,9 @@ public class TextField : View
     {
         _cursorPosition = Text.GetRuneCount ();
 
-        if (Bounds.Width > 0)
+        if (Viewport.Width > 0)
         {
-            ScrollOffset = _cursorPosition > Bounds.Width + 1 ? _cursorPosition - Bounds.Width + 1 : 0;
+            ScrollOffset = _cursorPosition > Viewport.Width + 1 ? _cursorPosition - Viewport.Width + 1 : 0;
         }
 
         Autocomplete.HostControl = this;

+ 4 - 4
Terminal.Gui/Views/TextValidateField.cs

@@ -537,7 +537,7 @@ namespace Terminal.Gui
         {
             if (mouseEvent.Flags.HasFlag (MouseFlags.Button1Pressed))
             {
-                int c = _provider.Cursor (mouseEvent.X - GetMargins (Bounds.Width).left);
+                int c = _provider.Cursor (mouseEvent.X - GetMargins (Viewport.Width).left);
 
                 if (_provider.Fixed == false && TextAlignment == TextAlignment.Right && Text.Length > 0)
                 {
@@ -568,7 +568,7 @@ namespace Terminal.Gui
             Color bgcolor = !IsValid ? new Color (Color.BrightRed) : ColorScheme.Focus.Background;
             var textColor = new Attribute (ColorScheme.Focus.Foreground, bgcolor);
 
-            (int margin_left, int margin_right) = GetMargins (Bounds.Width);
+            (int margin_left, int margin_right) = GetMargins (Viewport.Width);
 
             Move (0, 0);
 
@@ -642,7 +642,7 @@ namespace Terminal.Gui
         /// <inheritdoc/>
         public override void PositionCursor ()
         {
-            (int left, _) = GetMargins (Bounds.Width);
+            (int left, _) = GetMargins (Viewport.Width);
 
             // Fixed = true, is for inputs that have fixed width, like masked ones.
             // Fixed = false, is for normal input.
@@ -660,7 +660,7 @@ namespace Terminal.Gui
                 Move (curPos, 0);
             }
 
-            if (curPos < 0 || curPos >= Bounds.Width)
+            if (curPos < 0 || curPos >= Viewport.Width)
             {
                 Application.Driver.SetCursorVisibility (CursorVisibility.Invisible);
             }

+ 20 - 20
Terminal.Gui/Views/TileView.cs

@@ -156,7 +156,7 @@ public class TileView : View
             return;
         }
 
-        Rectangle contentArea = Bounds;
+        Rectangle contentArea = Viewport;
 
         if (HasBorder ())
         {
@@ -195,19 +195,19 @@ public class TileView : View
         {
             if (HasBorder ())
             {
-                lc.AddLine (Point.Empty, Bounds.Width, Orientation.Horizontal, LineStyle);
-                lc.AddLine (Point.Empty, Bounds.Height, Orientation.Vertical, LineStyle);
+                lc.AddLine (Point.Empty, Viewport.Width, Orientation.Horizontal, LineStyle);
+                lc.AddLine (Point.Empty, Viewport.Height, Orientation.Vertical, LineStyle);
 
                 lc.AddLine (
-                            new Point (Bounds.Width - 1, Bounds.Height - 1),
-                            -Bounds.Width,
+                            new Point (Viewport.Width - 1, Viewport.Height - 1),
+                            -Viewport.Width,
                             Orientation.Horizontal,
                             LineStyle
                            );
 
                 lc.AddLine (
-                            new Point (Bounds.Width - 1, Bounds.Height - 1),
-                            -Bounds.Height,
+                            new Point (Viewport.Width - 1, Viewport.Height - 1),
+                            -Viewport.Height,
                             Orientation.Vertical,
                             LineStyle
                            );
@@ -241,7 +241,7 @@ public class TileView : View
 
         Driver.SetAttribute (ColorScheme.Normal);
 
-        foreach (KeyValuePair<Point, Rune> p in lc.GetMap (Bounds))
+        foreach (KeyValuePair<Point, Rune> p in lc.GetMap (Viewport))
         {
             AddRune (p.Key.X, p.Key.Y, p.Value);
         }
@@ -423,7 +423,7 @@ public class TileView : View
                                         );
         }
 
-        int fullSpace = _orientation == Orientation.Vertical ? Bounds.Width : Bounds.Height;
+        int fullSpace = _orientation == Orientation.Vertical ? Viewport.Width : Viewport.Height;
 
         if (fullSpace != 0 && !IsValidNewSplitterPos (idx, value, fullSpace))
         {
@@ -806,14 +806,14 @@ public class TileView : View
                 tile.ContentView.X = i == 0 ? contentArea.X : Pos.Right (visibleSplitterLines [i - 1]);
                 tile.ContentView.Y = contentArea.Y;
                 tile.ContentView.Height = contentArea.Height;
-                tile.ContentView.Width = GetTileWidthOrHeight (i, Bounds.Width, visibleTiles, visibleSplitterLines);
+                tile.ContentView.Width = GetTileWidthOrHeight (i, Viewport.Width, visibleTiles, visibleSplitterLines);
             }
             else
             {
                 tile.ContentView.X = contentArea.X;
                 tile.ContentView.Y = i == 0 ? contentArea.Y : Pos.Bottom (visibleSplitterLines [i - 1]);
                 tile.ContentView.Width = contentArea.Width;
-                tile.ContentView.Height = GetTileWidthOrHeight (i, Bounds.Height, visibleTiles, visibleSplitterLines);
+                tile.ContentView.Height = GetTileWidthOrHeight (i, Viewport.Height, visibleTiles, visibleSplitterLines);
             }
         }
     }
@@ -845,7 +845,7 @@ public class TileView : View
         {
             Dim spaceDim = Tile.ContentView.Width;
 
-            int spaceAbs = spaceDim.Anchor (Parent.Bounds.Width);
+            int spaceAbs = spaceDim.Anchor (Parent.Viewport.Width);
 
             var title = $" {Tile.Title} ";
 
@@ -893,7 +893,7 @@ public class TileView : View
         {
             if (dragPosition is { } || CanFocus)
             {
-                Point location = moveRuneRenderLocation ?? new Point (Bounds.Width / 2, Bounds.Height / 2);
+                Point location = moveRuneRenderLocation ?? new Point (Viewport.Width / 2, Viewport.Height / 2);
 
                 AddRune (location.X, location.Y, Glyphs.Diamond);
             }
@@ -919,7 +919,7 @@ public class TileView : View
                     {
                         moveRuneRenderLocation = new Point (
                                                             0,
-                                                            Math.Max (1, Math.Min (Bounds.Height - 2, mouseEvent.Y))
+                                                            Math.Max (1, Math.Min (Viewport.Height - 2, mouseEvent.Y))
                                                            );
                     }
                 }
@@ -943,7 +943,7 @@ public class TileView : View
                 {
                     int dx = mouseEvent.X - dragPosition.Value.X;
                     Parent.SetSplitterPos (Idx, Offset (X, dx));
-                    moveRuneRenderLocation = new Point (0, Math.Max (1, Math.Min (Bounds.Height - 2, mouseEvent.Y)));
+                    moveRuneRenderLocation = new Point (0, Math.Max (1, Math.Min (Viewport.Height - 2, mouseEvent.Y)));
                 }
 
                 Parent.SetNeedsDisplay ();
@@ -988,7 +988,7 @@ public class TileView : View
         {
             base.PositionCursor ();
 
-            Point location = moveRuneRenderLocation ?? new Point (Bounds.Width / 2, Bounds.Height / 2);
+            Point location = moveRuneRenderLocation ?? new Point (Viewport.Width / 2, Viewport.Height / 2);
             Move (location.X, location.Y);
         }
 
@@ -1032,10 +1032,10 @@ public class TileView : View
             {
                 if (Orientation == Orientation.Horizontal)
                 {
-                    return Parent.SetSplitterPos (Idx, ConvertToPosFactor (newValue, Parent.Bounds.Height));
+                    return Parent.SetSplitterPos (Idx, ConvertToPosFactor (newValue, Parent.Viewport.Height));
                 }
 
-                return Parent.SetSplitterPos (Idx, ConvertToPosFactor (newValue, Parent.Bounds.Width));
+                return Parent.SetSplitterPos (Idx, ConvertToPosFactor (newValue, Parent.Viewport.Width));
             }
 
             return Parent.SetSplitterPos (Idx, newValue);
@@ -1071,8 +1071,8 @@ public class TileView : View
         {
             int posAbsolute = pos.Anchor (
                                           Orientation == Orientation.Horizontal
-                                              ? Parent.Bounds.Height
-                                              : Parent.Bounds.Width
+                                              ? Parent.Viewport.Height
+                                              : Parent.Viewport.Width
                                          );
 
             return posAbsolute + delta;

+ 4 - 4
Terminal.Gui/Views/Toplevel.cs

@@ -268,12 +268,12 @@ public partial class Toplevel : View
             {
                 foreach (Toplevel top in Application.OverlappedChildren.AsEnumerable ().Reverse ())
                 {
-                    if (top.Frame.IntersectsWith (Bounds))
+                    if (top.Frame.IntersectsWith (Viewport))
                     {
                         if (top != this && !top.IsCurrentTop && !OutsideTopFrame (top) && top.Visible)
                         {
                             top.SetNeedsLayout ();
-                            top.SetNeedsDisplay (top.Bounds);
+                            top.SetNeedsDisplay (top.Viewport);
                             top.Draw ();
                             top.OnRenderLineCanvas ();
                         }
@@ -284,10 +284,10 @@ public partial class Toplevel : View
             // This should not be here, but in base
             foreach (View view in Subviews)
             {
-                if (view.Frame.IntersectsWith (Bounds) && !OutsideTopFrame (this))
+                if (view.Frame.IntersectsWith (Viewport) && !OutsideTopFrame (this))
                 {
                     //view.SetNeedsLayout ();
-                    view.SetNeedsDisplay (view.Bounds);
+                    view.SetNeedsDisplay (view.Viewport);
                     view.SetSubViewNeedsDisplay ();
                 }
             }

+ 13 - 13
Terminal.Gui/Views/TreeView/TreeView.cs

@@ -742,10 +742,10 @@ public class TreeView<T> : View, ITreeView where T : class
             //if user has scrolled up too far to see their selection
             ScrollOffsetVertical = idx;
         }
-        else if (idx >= ScrollOffsetVertical + Bounds.Height - leaveSpace)
+        else if (idx >= ScrollOffsetVertical + Viewport.Height - leaveSpace)
         {
             //if user has scrolled off bottom of visible tree
-            ScrollOffsetVertical = Math.Max (0, idx + 1 - (Bounds.Height - leaveSpace));
+            ScrollOffsetVertical = Math.Max (0, idx + 1 - (Viewport.Height - leaveSpace));
         }
     }
 
@@ -868,12 +868,12 @@ public class TreeView<T> : View, ITreeView where T : class
             }
 
             // If control has no height to it then there is no visible area for content
-            if (Bounds.Height == 0)
+            if (Viewport.Height == 0)
             {
                 return 0;
             }
 
-            return map.Skip (ScrollOffsetVertical).Take (Bounds.Height).Max (b => b.GetWidth (Driver));
+            return map.Skip (ScrollOffsetVertical).Take (Viewport.Height).Max (b => b.GetWidth (Driver));
         }
 
         return map.Max (b => b.GetWidth (Driver));
@@ -886,13 +886,13 @@ public class TreeView<T> : View, ITreeView where T : class
     ///     If you have screen coordinates then use <see cref="View.ScreenToFrame"/> to translate these into the client area of
     ///     the <see cref="TreeView{T}"/>.
     /// </summary>
-    /// <param name="row">The row of the <see cref="View.Bounds"/> of the <see cref="TreeView{T}"/>.</param>
+    /// <param name="row">The row of the <see cref="View.Viewport"/> of the <see cref="TreeView{T}"/>.</param>
     /// <returns>The object currently displayed on this row or null.</returns>
     public T GetObjectOnRow (int row) { return HitTest (row)?.Model; }
 
     /// <summary>
     ///     <para>
-    ///         Returns the Y coordinate within the <see cref="View.Bounds"/> of the tree at which <paramref name="toFind"/>
+    ///         Returns the Y coordinate within the <see cref="View.Viewport"/> of the tree at which <paramref name="toFind"/>
     ///         would be displayed or null if it is not currently exposed (e.g. its parent is collapsed).
     ///     </para>
     ///     <para>
@@ -967,7 +967,7 @@ public class TreeView<T> : View, ITreeView where T : class
     public void GoToEnd ()
     {
         IReadOnlyCollection<Branch<T>> map = BuildLineMap ();
-        ScrollOffsetVertical = Math.Max (0, map.Count - Bounds.Height + 1);
+        ScrollOffsetVertical = Math.Max (0, map.Count - Viewport.Height + 1);
         SelectedObject = map.LastOrDefault ()?.Model;
 
         SetNeedsDisplay ();
@@ -1129,12 +1129,12 @@ public class TreeView<T> : View, ITreeView where T : class
     /// <summary>Moves the selection down by the height of the control (1 page).</summary>
     /// <param name="expandSelection">True if the navigation should add the covered nodes to the selected current selection.</param>
     /// <exception cref="NotImplementedException"></exception>
-    public void MovePageDown (bool expandSelection = false) { AdjustSelection (Bounds.Height, expandSelection); }
+    public void MovePageDown (bool expandSelection = false) { AdjustSelection (Viewport.Height, expandSelection); }
 
     /// <summary>Moves the selection up by the height of the control (1 page).</summary>
     /// <param name="expandSelection">True if the navigation should add the covered nodes to the selected current selection.</param>
     /// <exception cref="NotImplementedException"></exception>
-    public void MovePageUp (bool expandSelection = false) { AdjustSelection (-Bounds.Height, expandSelection); }
+    public void MovePageUp (bool expandSelection = false) { AdjustSelection (-Viewport.Height, expandSelection); }
 
     /// <summary>
     ///     This event is raised when an object is activated e.g. by double clicking or pressing
@@ -1160,7 +1160,7 @@ public class TreeView<T> : View, ITreeView where T : class
 
         IReadOnlyCollection<Branch<T>> map = BuildLineMap ();
 
-        for (var line = 0; line < Bounds.Height; line++)
+        for (var line = 0; line < Viewport.Height; line++)
         {
             int idxToRender = ScrollOffsetVertical + line;
 
@@ -1168,14 +1168,14 @@ public class TreeView<T> : View, ITreeView where T : class
             if (idxToRender < map.Count)
             {
                 // Render the line
-                map.ElementAt (idxToRender).Draw (Driver, ColorScheme, line, Bounds.Width);
+                map.ElementAt (idxToRender).Draw (Driver, ColorScheme, line, Viewport.Width);
             }
             else
             {
                 // Else clear the line to prevent stale symbols due to scrolling etc
                 Move (0, line);
                 Driver.SetAttribute (GetNormalColor ());
-                Driver.AddStr (new string (' ', Bounds.Width));
+                Driver.AddStr (new string (' ', Viewport.Width));
             }
         }
     }
@@ -1247,7 +1247,7 @@ public class TreeView<T> : View, ITreeView where T : class
             int idx = map.IndexOf (b => b.Model.Equals (SelectedObject));
 
             // if currently selected line is visible
-            if (idx - ScrollOffsetVertical >= 0 && idx - ScrollOffsetVertical < Bounds.Height)
+            if (idx - ScrollOffsetVertical >= 0 && idx - ScrollOffsetVertical < Viewport.Height)
             {
                 Move (0, idx - ScrollOffsetVertical);
             }

+ 2 - 2
UICatalog/Scenarios/ASCIICustomButton.cs

@@ -79,14 +79,14 @@ public class ASCIICustomButtonTest : Scenario
 
             var fillText = new StringBuilder ();
 
-            for (var i = 0; i < Bounds.Height; i++)
+            for (var i = 0; i < Viewport.Height; i++)
             {
                 if (i > 0)
                 {
                     fillText.AppendLine ("");
                 }
 
-                for (var j = 0; j < Bounds.Width; j++)
+                for (var j = 0; j < Viewport.Width; j++)
                 {
                     fillText.Append ("█");
                 }

+ 3 - 3
UICatalog/Scenarios/Animation.cs

@@ -167,12 +167,12 @@ public class Animation : Scenario
         {
             base.OnDrawContent (contentArea);
 
-            if (oldSize != Bounds)
+            if (oldSize != Viewport)
             {
                 // Invalidate cached images now size has changed
                 matchSizes = new Image<Rgba32> [frameCount];
                 brailleCache = new string [frameCount];
-                oldSize = Bounds;
+                oldSize = Viewport;
             }
 
             Image<Rgba32> imgScaled = matchSizes [currentFrame];
@@ -183,7 +183,7 @@ public class Animation : Scenario
                 Image<Rgba32> imgFull = fullResImages [currentFrame];
 
                 // keep aspect ratio
-                int newSize = Math.Min (Bounds.Width, Bounds.Height);
+                int newSize = Math.Min (Viewport.Width, Viewport.Height);
 
                 // generate one
                 matchSizes [currentFrame] = imgScaled = imgFull.Clone (

+ 1 - 1
UICatalog/Scenarios/BackgroundWorkerCollection.cs

@@ -285,7 +285,7 @@ public class BackgroundWorkerCollection : Scenario
             LayoutStarted += (s, e) =>
                              {
                                  int btnsWidth = _start.Frame.Width + _close.Frame.Width + 2 - 1;
-                                 int shiftLeft = Math.Max ((Bounds.Width - btnsWidth) / 2 - 2, 0);
+                                 int shiftLeft = Math.Max ((Viewport.Width - btnsWidth) / 2 - 2, 0);
 
                                  shiftLeft += _close.Frame.Width + 1;
                                  _close.X = Pos.AnchorEnd (shiftLeft);

+ 9 - 9
UICatalog/Scenarios/CharacterMap.cs

@@ -373,7 +373,7 @@ internal class CharMap : ScrollView
                     Command.PageUp,
                     () =>
                     {
-                        int page = (Bounds.Height / _rowHeight - 1) * 16;
+                        int page = (Viewport.Height / _rowHeight - 1) * 16;
                         SelectedCodePoint -= Math.Min (page, SelectedCodePoint);
 
                         return true;
@@ -384,7 +384,7 @@ internal class CharMap : ScrollView
                     Command.PageDown,
                     () =>
                     {
-                        int page = (Bounds.Height / _rowHeight - 1) * 16;
+                        int page = (Viewport.Height / _rowHeight - 1) * 16;
                         SelectedCodePoint += Math.Min (page, MaxCodePoint - SelectedCodePoint);
 
                         return true;
@@ -457,7 +457,7 @@ internal class CharMap : ScrollView
                 int row = SelectedCodePoint / 16 * _rowHeight;
                 int col = SelectedCodePoint % 16 * COLUMN_WIDTH;
 
-                int height = Bounds.Height - (ShowHorizontalScrollIndicator ? 2 : 1);
+                int height = Viewport.Height - (ShowHorizontalScrollIndicator ? 2 : 1);
 
                 if (row + ContentOffset.Y < 0)
                 {
@@ -473,7 +473,7 @@ internal class CharMap : ScrollView
                                               );
                 }
 
-                int width = Bounds.Width / COLUMN_WIDTH * COLUMN_WIDTH - (ShowVerticalScrollIndicator ? RowLabelWidth + 1 : RowLabelWidth);
+                int width = Viewport.Width / COLUMN_WIDTH * COLUMN_WIDTH - (ShowVerticalScrollIndicator ? RowLabelWidth + 1 : RowLabelWidth);
 
                 if (col + ContentOffset.X < 0)
                 {
@@ -559,8 +559,8 @@ internal class CharMap : ScrollView
         Rectangle viewport = new (
                                   ContentOffset,
                                   new (
-                                       Math.Max (Bounds.Width - (ShowVerticalScrollIndicator ? 1 : 0), 0),
-                                       Math.Max (Bounds.Height - (ShowHorizontalScrollIndicator ? 1 : 0), 0)
+                                       Math.Max (Viewport.Width - (ShowVerticalScrollIndicator ? 1 : 0), 0),
+                                       Math.Max (Viewport.Height - (ShowHorizontalScrollIndicator ? 1 : 0), 0)
                                       )
                                  );
 
@@ -608,7 +608,7 @@ internal class CharMap : ScrollView
 
         int firstColumnX = viewport.X + RowLabelWidth;
 
-        for (var y = 1; y < Bounds.Height; y++)
+        for (var y = 1; y < Viewport.Height; y++)
         {
             // What row is this?
             int row = (y - ContentOffset.Y - 1) / _rowHeight;
@@ -733,9 +733,9 @@ internal class CharMap : ScrollView
     {
         if (HasFocus
             && Cursor.X >= RowLabelWidth
-            && Cursor.X < Bounds.Width - (ShowVerticalScrollIndicator ? 1 : 0)
+            && Cursor.X < Viewport.Width - (ShowVerticalScrollIndicator ? 1 : 0)
             && Cursor.Y > 0
-            && Cursor.Y < Bounds.Height - (ShowHorizontalScrollIndicator ? 1 : 0))
+            && Cursor.Y < Viewport.Height - (ShowHorizontalScrollIndicator ? 1 : 0))
         {
             Driver.SetCursorVisibility (_cursor);
             Move (Cursor.X, Cursor.Y);

+ 4 - 4
UICatalog/Scenarios/ComputedLayout.cs

@@ -56,12 +56,12 @@ public class ComputedLayout : Scenario
         Application.Top.LayoutComplete += (s, a) =>
                                           {
                                               horizontalRuler.Text =
-                                                  rule.Repeat ((int)Math.Ceiling (horizontalRuler.Bounds.Width / (double)rule.Length)) [
-                                                   ..horizontalRuler.Bounds.Width];
+                                                  rule.Repeat ((int)Math.Ceiling (horizontalRuler.Viewport.Width / (double)rule.Length)) [
+                                                   ..horizontalRuler.Viewport.Width];
 
                                               verticalRuler.Text =
-                                                  vrule.Repeat ((int)Math.Ceiling (verticalRuler.Bounds.Height * 2 / (double)rule.Length))
-                                                      [..(verticalRuler.Bounds.Height * 2)];
+                                                  vrule.Repeat ((int)Math.Ceiling (verticalRuler.Viewport.Height * 2 / (double)rule.Length))
+                                                      [..(verticalRuler.Viewport.Height * 2)];
                                           };
 
         Application.Top.Add (verticalRuler);

+ 2 - 2
UICatalog/Scenarios/Editor.cs

@@ -758,8 +758,8 @@ public class Editor : Scenario
         _winDialog = new Window
         {
             Title = isFind ? "Find" : "Replace",
-            X = Win.Bounds.Width / 2 - 30,
-            Y = Win.Bounds.Height / 2 - 10,
+            X = Win.Viewport.Width / 2 - 30,
+            Y = Win.Viewport.Height / 2 - 10,
             ColorScheme = Colors.ColorSchemes ["TopLevel"]
         };
 

+ 2 - 2
UICatalog/Scenarios/GraphViewExample.cs

@@ -254,7 +254,7 @@ public class GraphViewExample : Scenario
 
         _graphView.AxisY.Minimum = 0;
 
-        var legend = new LegendAnnotation (new Rectangle (_graphView.Bounds.Width - 20, 0, 20, 5));
+        var legend = new LegendAnnotation (new Rectangle (_graphView.Viewport.Width - 20, 0, 20, 5));
 
         legend.AddEntry (
                          new GraphCellToRender (stiple, series.SubSeries.ElementAt (0).OverrideBarColor),
@@ -872,7 +872,7 @@ public class GraphViewExample : Scenario
         _graphView.Annotations.Add (new TextAnnotation { Text = "M", ScreenPosition = new Point (0, 10) });
 
         _graphView.Annotations.Add (
-                                    new TextAnnotation { Text = "F", ScreenPosition = new Point (_graphView.Bounds.Width - 1, 10) }
+                                    new TextAnnotation { Text = "F", ScreenPosition = new Point (_graphView.Viewport.Width - 1, 10) }
                                    );
 
         _graphView.SetNeedsDisplay ();

+ 1 - 1
UICatalog/Scenarios/ProgressBarStyles.cs

@@ -70,7 +70,7 @@ public class ProgressBarStyles : Scenario
                                          dialog.X = pbList.Frame.X;
                                          dialog.Y = pbList.Frame.Height;
 
-                                         dialog.Bounds = new Rectangle (0, 0, colorPicker.Frame.Width, colorPicker.Frame.Height);
+                                         dialog.Viewport = new Rectangle (0, 0, colorPicker.Frame.Width, colorPicker.Frame.Height);
 
                                          Application.Top.LayoutSubviews ();
                                      };

+ 6 - 6
UICatalog/Scenarios/Scrolling.cs

@@ -67,17 +67,17 @@ public class Scrolling : Scenario
         void Top_Loaded (object sender, EventArgs args)
         {
             horizontalRuler.Text =
-                rule.Repeat ((int)Math.Ceiling (horizontalRuler.Bounds.Width / (double)rule.Length)) [
-                                                                                                      ..horizontalRuler.Bounds.Width]
+                rule.Repeat ((int)Math.Ceiling (horizontalRuler.Viewport.Width / (double)rule.Length)) [
+                                                                                                      ..horizontalRuler.Viewport.Width]
                 + "\n"
                 + "|         ".Repeat (
-                                       (int)Math.Ceiling (horizontalRuler.Bounds.Width / (double)rule.Length)
+                                       (int)Math.Ceiling (horizontalRuler.Viewport.Width / (double)rule.Length)
                                       ) [
-                                         ..horizontalRuler.Bounds.Width];
+                                         ..horizontalRuler.Viewport.Width];
 
             verticalRuler.Text =
-                vrule.Repeat ((int)Math.Ceiling (verticalRuler.Bounds.Height * 2 / (double)rule.Length))
-                    [..(verticalRuler.Bounds.Height * 2)];
+                vrule.Repeat ((int)Math.Ceiling (verticalRuler.Viewport.Height * 2 / (double)rule.Length))
+                    [..(verticalRuler.Viewport.Height * 2)];
             Application.Top.Loaded -= Top_Loaded;
         }
 

+ 1 - 1
UICatalog/Scenarios/Snake.cs

@@ -341,7 +341,7 @@ public class Snake : Scenario
                                );
             }
 
-            foreach (KeyValuePair<Point, Rune> p in canvas.GetMap (Bounds))
+            foreach (KeyValuePair<Point, Rune> p in canvas.GetMap (Viewport))
             {
                 AddRune (p.Key.X, p.Key.Y, p.Value);
             }

+ 3 - 3
UICatalog/Scenarios/ViewExperiments.cs

@@ -218,17 +218,17 @@ public class ViewExperiments : Scenario
                                        $"Container.Frame: {
                                            Application.Top.Frame
                                        } .Bounds: {
-                                           Application.Top.Bounds
+                                           Application.Top.Viewport
                                        }\nView.Frame: {
                                            view.Frame
                                        } .Bounds: {
-                                           view.Bounds
+                                           view.Viewport
                                        } .BoundsOffset: {
                                            view.GetBoundsOffset ()
                                        }\n .Padding.Frame: {
                                            view.Padding.Frame
                                        } .Padding.Bounds: {
-                                           view.Padding.Bounds
+                                           view.Padding.Viewport
                                        }";
                                };
 

+ 6 - 6
UICatalog/Scenarios/VkeyPacketSimulator.cs

@@ -265,20 +265,20 @@ public class VkeyPacketSimulator : Scenario
             inputHorizontalRuler.Text = outputHorizontalRuler.Text =
                                             ruler.Repeat (
                                                           (int)Math.Ceiling (
-                                                                             inputHorizontalRuler.Bounds.Width
+                                                                             inputHorizontalRuler.Viewport.Width
                                                                              / (double)ruler.Length
                                                                             )
                                                          ) [
-                                                            ..inputHorizontalRuler.Bounds.Width];
+                                                            ..inputHorizontalRuler.Viewport.Width];
             inputVerticalRuler.Height = tvInput.Frame.Height + 1;
 
             inputVerticalRuler.Text =
-                ruler.Repeat ((int)Math.Ceiling (inputVerticalRuler.Bounds.Height / (double)ruler.Length)) [
-                     ..inputVerticalRuler.Bounds.Height];
+                ruler.Repeat ((int)Math.Ceiling (inputVerticalRuler.Viewport.Height / (double)ruler.Length)) [
+                     ..inputVerticalRuler.Viewport.Height];
 
             outputVerticalRuler.Text =
-                ruler.Repeat ((int)Math.Ceiling (outputVerticalRuler.Bounds.Height / (double)ruler.Length)) [
-                     ..outputVerticalRuler.Bounds.Height];
+                ruler.Repeat ((int)Math.Ceiling (outputVerticalRuler.Viewport.Height / (double)ruler.Length)) [
+                     ..outputVerticalRuler.Viewport.Height];
         }
 
         Win.LayoutComplete += Win_LayoutComplete;

+ 4 - 4
UnitTests/Drawing/LineCanvasTests.cs

@@ -293,7 +293,7 @@ public class LineCanvasTests
         View v = GetCanvas (out LineCanvas lc);
         v.Width = 10;
         v.Height = 10;
-        v.Bounds = new Rectangle (0, 0, 10, 10);
+        v.Viewport = new Rectangle (0, 0, 10, 10);
 
         lc.AddLine (new Point (x1, y1), len1, o1, s1);
         lc.AddLine (new Point (x2, y2), len2, o2, s2);
@@ -990,7 +990,7 @@ public class LineCanvasTests
         View v = GetCanvas (out LineCanvas lc);
         v.Width = 10;
         v.Height = 10;
-        v.Bounds = new Rectangle (0, 0, 10, 10);
+        v.Viewport = new Rectangle (0, 0, 10, 10);
 
         lc.AddLine (new Point (x1, y1), length, o1, s1);
 
@@ -1304,7 +1304,7 @@ public class LineCanvasTests
     /// <returns></returns>
     private View GetCanvas (out LineCanvas canvas, int offsetX = 0, int offsetY = 0)
     {
-        var v = new View { Width = 10, Height = 5, Bounds = new Rectangle (0, 0, 10, 5) };
+        var v = new View { Width = 10, Height = 5, Viewport = new Rectangle (0, 0, 10, 5) };
         Application.Top.Add (v);
         Application.Begin (Application.Top);
 
@@ -1312,7 +1312,7 @@ public class LineCanvasTests
 
         v.DrawContentComplete += (s, e) =>
                                  {
-                                     v.Clear (v.Bounds);
+                                     v.Clear (v.Viewport);
 
                                      foreach (KeyValuePair<Point, Rune> p in canvasCopy.GetMap ())
                                      {

+ 1 - 1
UnitTests/UICatalog/ScenarioTests.cs

@@ -254,7 +254,7 @@ public class ScenarioTests
                                                       _hostPane.Remove (_curView);
                                                       _curView.Dispose ();
                                                       _curView = null;
-                                                      _hostPane.Clear (_hostPane.Bounds);
+                                                      _hostPane.Clear (_hostPane.Viewport);
                                                   }
 
                                                   _curView = CreateClass (_viewClasses.Values.ToArray () [_classListView.SelectedItem]);

+ 16 - 16
UnitTests/View/Adornment/AdornmentTests.cs

@@ -21,25 +21,25 @@ public class AdornmentTests (ITestOutputHelper output)
         view.EndInit ();
 
         Assert.Equal (new (1, 2, 20, 20), view.Frame);
-        Assert.Equal (new (0, 0, 20, 20), view.Bounds);
+        Assert.Equal (new (0, 0, 20, 20), view.Viewport);
 
         var marginThickness = 1;
         view.Margin.Thickness = new  (marginThickness);
-        Assert.Equal (new (0, 0, 18, 18), view.Bounds);
+        Assert.Equal (new (0, 0, 18, 18), view.Viewport);
 
         var borderThickness = 2;
         view.Border.Thickness = new (borderThickness);
-        Assert.Equal (new (0, 0, 14, 14), view.Bounds);
+        Assert.Equal (new (0, 0, 14, 14), view.Viewport);
 
         var paddingThickness = 3;
         view.Padding.Thickness = new Thickness (paddingThickness);
-        Assert.Equal (new (0, 0, 8, 8), view.Bounds);
+        Assert.Equal (new (0, 0, 8, 8), view.Viewport);
 
-        Assert.Equal (new (0, 0, view.Margin.Frame.Width, view.Margin.Frame.Height), view.Margin.Bounds);
+        Assert.Equal (new (0, 0, view.Margin.Frame.Width, view.Margin.Frame.Height), view.Margin.Viewport);
 
-        Assert.Equal (new (0, 0, view.Border.Frame.Width, view.Border.Frame.Height), view.Border.Bounds);
+        Assert.Equal (new (0, 0, view.Border.Frame.Width, view.Border.Frame.Height), view.Border.Viewport);
 
-        Assert.Equal (new (0, 0, view.Padding.Frame.Width , view.Padding.Frame.Height), view.Padding.Bounds);
+        Assert.Equal (new (0, 0, view.Padding.Frame.Width , view.Padding.Frame.Height), view.Padding.Viewport);
     }
 
     // Test that Adornment.Bounds_get override returns Frame.Size minus Thickness
@@ -87,7 +87,7 @@ public class AdornmentTests (ITestOutputHelper output)
         Assert.Equal (new Rectangle (x, y, w, h), adornment.Frame);
 
         var expectedBounds = new Rectangle (0, 0, w, h);
-        Assert.Equal (expectedBounds, adornment.Bounds);
+        Assert.Equal (expectedBounds, adornment.Viewport);
     }
 
     // Test that Adornment.Bounds_get override uses Parent not SuperView
@@ -100,9 +100,9 @@ public class AdornmentTests (ITestOutputHelper output)
         parent.EndInit ();
 
         Assert.Equal (new Rectangle (1, 2, 10, 10), parent.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Viewport);
         Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Viewport);
 
         Assert.Null (parent.Margin.SuperView);
         Rectangle boundsAsScreen = parent.Margin.BoundsToScreen (new Rectangle (1, 2, 5, 5));
@@ -133,7 +133,7 @@ public class AdornmentTests (ITestOutputHelper output)
         view.EndInit ();
 
         Assert.Equal (new Rectangle (1, 2, 20, 31), view.Frame);
-        Assert.Equal (new Rectangle (0, 0, 8, 19), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 8, 19), view.Viewport);
 
         // Margin.Frame is always the same as the view frame
         Assert.Equal (new Rectangle (0, 0, 20, 31), view.Margin.Frame);
@@ -246,9 +246,9 @@ public class AdornmentTests (ITestOutputHelper output)
         parent.EndInit ();
 
         Assert.Equal (new Rectangle (1, 2, 10, 10), parent.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Viewport);
         Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Margin.Viewport);
 
         Assert.Null (parent.Margin.SuperView);
         Assert.Equal (new Rectangle (1, 2, 10, 10), parent.Margin.FrameToScreen ());
@@ -284,7 +284,7 @@ public class AdornmentTests (ITestOutputHelper output)
     public void Setting_Bounds_Throws ()
     {
         var adornment = new Adornment (null);
-        Assert.Throws<InvalidOperationException> (() => adornment.Bounds = new Rectangle (1, 2, 3, 4));
+        Assert.Throws<InvalidOperationException> (() => adornment.Viewport = new Rectangle (1, 2, 3, 4));
     }
 
     [Fact]
@@ -309,11 +309,11 @@ public class AdornmentTests (ITestOutputHelper output)
         parent.EndInit ();
 
         Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Viewport);
 
         parent.Margin.Thickness = new Thickness (1);
         Assert.Equal (new Rectangle (0, 0, 10, 10), parent.Frame);
-        Assert.Equal (new Rectangle (0, 0, 8, 8), parent.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 8, 8), parent.Viewport);
     }
 
     [Fact]

+ 1 - 1
UnitTests/View/Adornment/ToScreenTests.cs

@@ -289,7 +289,7 @@ public class AdornmentToScreenTests (ITestOutputHelper output)
         // Total thickness is 3 (view.Bounds will be Frame.Width - 6)
         view.Frame = frame;
 
-        Assert.Equal(4, view.Bounds.Width);
+        Assert.Equal(4, view.Viewport.Width);
 
         // Act
         var marginScreen = view.Margin.BoundsToScreen (new (boundsX, 0, 0, 0));

+ 5 - 5
UnitTests/View/DrawTests.cs

@@ -235,7 +235,7 @@ public class DrawTests
         view.SetRelativeLayout (Application.Driver.Bounds);
 
         Assert.Equal (new (0,0,2,2), view.Frame);
-        Assert.Equal (Rectangle.Empty, view.Bounds);
+        Assert.Equal (Rectangle.Empty, view.Viewport);
 
         view.Draw ();
 
@@ -260,7 +260,7 @@ public class DrawTests
         view.SetRelativeLayout (Application.Driver.Bounds);
 
         Assert.Equal (new (0,0,2,1), view.Frame);
-        Assert.Equal (Rectangle.Empty, view.Bounds);
+        Assert.Equal (Rectangle.Empty, view.Viewport);
 
         view.Draw ();
 
@@ -278,7 +278,7 @@ public class DrawTests
         view.SetRelativeLayout (Application.Driver.Bounds);
 
         Assert.Equal (new (0,0,1,2), view.Frame);
-        Assert.Equal (Rectangle.Empty, view.Bounds);
+        Assert.Equal (Rectangle.Empty, view.Viewport);
 
         view.Draw ();
 
@@ -303,7 +303,7 @@ public class DrawTests
         view.SetRelativeLayout (Application.Driver.Bounds);
 
         Assert.Equal (new (0,0,1,2), view.Frame);
-        Assert.Equal (Rectangle.Empty, view.Bounds);
+        Assert.Equal (Rectangle.Empty, view.Viewport);
 
         view.Draw ();
 
@@ -329,7 +329,7 @@ public class DrawTests
         view.SetRelativeLayout (Application.Driver.Bounds);
 
         Assert.Equal (new (0,0,2,1), view.Frame);
-        Assert.Equal (Rectangle.Empty, view.Bounds);
+        Assert.Equal (Rectangle.Empty, view.Viewport);
 
         view.Draw ();
 

+ 24 - 24
UnitTests/View/Layout/AbsoluteLayoutTests.cs

@@ -31,7 +31,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
@@ -46,7 +46,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
@@ -62,7 +62,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (10), v.X);
         Assert.Equal (Pos.At (20), v.Y);
@@ -77,7 +77,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (10), v.X);
         Assert.Equal (Pos.At (20), v.Y);
@@ -101,7 +101,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
@@ -136,7 +136,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, newFrame.Width, newFrame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal ($"Absolute({newFrame.X})", v.X.ToString ());
         Assert.Equal ($"Absolute({newFrame.Y})", v.Y.ToString ());
@@ -250,7 +250,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, frame.Width, frame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (0), v.X);
         Assert.Equal (Pos.At (0), v.Y);
@@ -265,7 +265,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, frame.Width, frame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
@@ -279,7 +279,7 @@ public class AbsoluteLayoutTests
 
         Assert.Equal (
                       new Rectangle (0, 0, frame.Width, frame.Height),
-                      v.Bounds
+                      v.Viewport
                      ); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
@@ -294,7 +294,7 @@ public class AbsoluteLayoutTests
         // That is correct it should be 0,0 because AutoSize is false
         // and the size wasn't set on the initializer
         Assert.Equal (new Rectangle (frame.X, frame.Y, 0, 0), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Viewport); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (0), v.Width);
@@ -304,7 +304,7 @@ public class AbsoluteLayoutTests
         v = new View ();
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (new Rectangle (0, 0, 0, 0), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (0, 0, 0, 0), v.Viewport); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (0), v.X);
         Assert.Equal (Pos.At (0), v.Y);
         Assert.Equal (Dim.Sized (0), v.Width);
@@ -314,7 +314,7 @@ public class AbsoluteLayoutTests
         v = new View { X = frame.X, Y = frame.Y, Width = frame.Width, Height = frame.Height };
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
         Assert.Equal (new Rectangle (frame.X, frame.Y, 3, 4), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, 3, 4), v.Bounds); // With Absolute Bounds *is* deterministic before Layout
+        Assert.Equal (new Rectangle (0, 0, 3, 4), v.Viewport); // With Absolute Bounds *is* deterministic before Layout
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -353,8 +353,8 @@ public class AbsoluteLayoutTests
         var frame = new Rectangle (1, 2, 3, 4);
         var newBounds = new Rectangle (10, 20, 30, 40);
         var view = new View { Frame = frame };
-        view.Bounds = newBounds;
-        Assert.Equal (new Rectangle (0, 0, 30, 40), view.Bounds);
+        view.Viewport = newBounds;
+        Assert.Equal (new Rectangle (0, 0, 30, 40), view.Viewport);
         Assert.Equal (new Rectangle (1, 2, 30, 40), view.Frame);
     }
 
@@ -367,21 +367,21 @@ public class AbsoluteLayoutTests
         var v = new View { Frame = frame };
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
 
-        v.Bounds = newBounds;
+        v.Viewport = newBounds;
         Assert.True (v.LayoutStyle == LayoutStyle.Absolute);
-        Assert.Equal (newBounds, v.Bounds);
+        Assert.Equal (newBounds, v.Viewport);
         Assert.Equal (new Rectangle (1, 2, newBounds.Width, newBounds.Height), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
+        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Viewport);
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (30), v.Width);
         Assert.Equal (Dim.Sized (40), v.Height);
 
         newBounds = new Rectangle (0, 0, 3, 4);
-        v.Bounds = newBounds;
-        Assert.Equal (newBounds, v.Bounds);
+        v.Viewport = newBounds;
+        Assert.Equal (newBounds, v.Viewport);
         Assert.Equal (new Rectangle (1, 2, newBounds.Width, newBounds.Height), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
+        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Viewport);
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (3), v.Width);
@@ -390,7 +390,7 @@ public class AbsoluteLayoutTests
         v.BorderStyle = LineStyle.Single;
 
         // Bounds should shrink
-        Assert.Equal (new Rectangle (0, 0, 1, 2), v.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 1, 2), v.Viewport);
 
         // Frame should not change
         Assert.Equal (new Rectangle (1, 2, 3, 4), v.Frame);
@@ -401,12 +401,12 @@ public class AbsoluteLayoutTests
 
         // Now set bounds bigger as before
         newBounds = new Rectangle (0, 0, 3, 4);
-        v.Bounds = newBounds;
-        Assert.Equal (newBounds, v.Bounds);
+        v.Viewport = newBounds;
+        Assert.Equal (newBounds, v.Viewport);
 
         // Frame grows because there's now a border
         Assert.Equal (new Rectangle (1, 2, 5, 6), v.Frame);
-        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Bounds);
+        Assert.Equal (new Rectangle (0, 0, newBounds.Width, newBounds.Height), v.Viewport);
         Assert.Equal (Pos.At (1), v.X);
         Assert.Equal (Pos.At (2), v.Y);
         Assert.Equal (Dim.Sized (5), v.Width);

+ 4 - 4
UnitTests/View/Layout/BoundsTests.cs

@@ -3,7 +3,7 @@
 namespace Terminal.Gui.ViewTests;
 
 /// <summary>
-/// Test the <see cref="View.Bounds"/>.
+/// Test the <see cref="View.Viewport"/>.
 /// DOES NOT TEST Adornment.Bounds methods. Those are in ./Adornment/BoundsTests.cs
 /// </summary>
 /// <param name="output"></param>
@@ -28,7 +28,7 @@ public class BoundsTests (ITestOutputHelper output)
         view.EndInit();
 
         // Act
-        var bounds = view.Bounds;
+        var bounds = view.Viewport;
 
         // Assert
         Assert.Equal(expectedW, bounds.Width);
@@ -85,7 +85,7 @@ public class BoundsTests (ITestOutputHelper output)
         superSuperView.LayoutSubviews ();
 
         // Act
-        var bounds = view.Bounds;
+        var bounds = view.Viewport;
 
         // Assert
         Assert.Equal (expectedW, bounds.Width);
@@ -144,7 +144,7 @@ public class BoundsTests (ITestOutputHelper output)
         superSuperView.LayoutSubviews ();
 
         // Act
-        var bounds = view.Bounds;
+        var bounds = view.Viewport;
 
         // Assert
         Assert.Equal (expectedW, bounds.Width);

+ 3 - 3
UnitTests/View/Layout/DimTests.cs

@@ -39,7 +39,7 @@ public class DimTests
                              if (k.KeyCode == KeyCode.Enter)
                              {
                                  field.Text = $"Label {count}";
-                                 var label = new Label { X = 0, Y = view.Bounds.Height, /*Width = 20,*/ Text = field.Text };
+                                 var label = new Label { X = 0, Y = view.Viewport.Height, /*Width = 20,*/ Text = field.Text };
                                  view.Add (label);
                                  Assert.Equal ($"Label {count}", label.Text);
                                  Assert.Equal ($"Absolute({count})", label.Y.ToString ());
@@ -112,7 +112,7 @@ public class DimTests
         for (var i = 0; i < count; i++)
         {
             field.Text = $"Label {i}";
-            var label = new Label { X = 0, Y = view.Bounds.Height, /*Width = 20,*/ Text = field.Text };
+            var label = new Label { X = 0, Y = view.Viewport.Height, /*Width = 20,*/ Text = field.Text };
             view.Add (label);
             Assert.Equal ($"Label {i}", label.Text);
             Assert.Equal ($"Absolute({i})", label.Y.ToString ());
@@ -667,7 +667,7 @@ public class DimTests
                        Assert.Equal (50, v4.Frame.Width);
                        Assert.Equal (50, v4.Frame.Height);
                    #if DEBUG
-                       Assert.Equal ($"Combine(View(Width,Button(v1){v1.Frame})-View(Width,Button(v3){v3.Bounds}))", v5.Width.ToString ());
+                       Assert.Equal ($"Combine(View(Width,Button(v1){v1.Frame})-View(Width,Button(v3){v3.Viewport}))", v5.Width.ToString ());
                     #else
                        Assert.Equal ($"Combine(View(Height,Button(){v1.Frame})-View(Height,Button(){v3.Bounds}))", v5.Height.ToString ( ));
                    #endif

+ 4 - 4
UnitTests/View/Layout/PosTests.cs

@@ -116,11 +116,11 @@ public class PosTests
         var b = $"{CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket}";
 
         var frame = new FrameView { Width = 18, Height = 3 };
-        Assert.Equal (16, frame.Bounds.Width);
+        Assert.Equal (16, frame.Viewport.Width);
 
         Button btn = null;
 
-        int Btn_Width () { return btn?.Bounds.Width ?? 0; }
+        int Btn_Width () { return btn?.Viewport.Width ?? 0; }
 
         btn = new Button { Text = "Ok", X = Pos.AnchorEnd () - Pos.Function (Btn_Width) };
 
@@ -140,13 +140,13 @@ public class PosTests
         frame.EndInit ();
         frame.Draw ();
 
-        Assert.Equal (6, btn.Bounds.Width);
+        Assert.Equal (6, btn.Viewport.Width);
         Assert.Equal (10, btn.Frame.X); // frame.Bounds.Width (16) - btn.Frame.Width (6) = 10
         Assert.Equal (0, btn.Frame.Y);
         Assert.Equal (6, btn.Frame.Width);
         Assert.Equal (1, btn.Frame.Height);
 
-        Assert.Equal (9, view.Bounds.Width); // frame.Bounds.Width (16) - Dim.Fill (1) - Dim.Function (6) = 9
+        Assert.Equal (9, view.Viewport.Width); // frame.Bounds.Width (16) - Dim.Fill (1) - Dim.Function (6) = 9
         Assert.Equal (0, view.Frame.X);
         Assert.Equal (0, view.Frame.Y);
         Assert.Equal (9, view.Frame.Width);

+ 8 - 8
UnitTests/View/Layout/SetRelativeLayoutTests.cs

@@ -54,10 +54,10 @@ public class SetRelativeLayoutTests
         Assert.Equal (1, view.Frame.Y);
         Assert.Equal (79, view.Frame.Width);
         Assert.Equal (24, view.Frame.Height);
-        Assert.Equal (0, view.Bounds.X);
-        Assert.Equal (0, view.Bounds.Y);
-        Assert.Equal (79, view.Bounds.Width);
-        Assert.Equal (24, view.Bounds.Height);
+        Assert.Equal (0, view.Viewport.X);
+        Assert.Equal (0, view.Viewport.Y);
+        Assert.Equal (79, view.Viewport.Width);
+        Assert.Equal (24, view.Viewport.Height);
 
         view.X = 0;
         view.Y = 0;
@@ -68,10 +68,10 @@ public class SetRelativeLayoutTests
         Assert.Equal (0, view.Frame.Y);
         Assert.Equal (80, view.Frame.Width);
         Assert.Equal (25, view.Frame.Height);
-        Assert.Equal (0, view.Bounds.X);
-        Assert.Equal (0, view.Bounds.Y);
-        Assert.Equal (80, view.Bounds.Width);
-        Assert.Equal (25, view.Bounds.Height);
+        Assert.Equal (0, view.Viewport.X);
+        Assert.Equal (0, view.Viewport.Y);
+        Assert.Equal (80, view.Viewport.Width);
+        Assert.Equal (25, view.Viewport.Height);
     }
 
     [Fact]

+ 4 - 4
UnitTests/View/SubviewTests.cs

@@ -151,8 +151,8 @@ public class SubviewTests
         winAddedToTop.Initialized += (s, e) =>
                                      {
                                          wc++;
-                                         Assert.Equal (top.Bounds.Width, winAddedToTop.Frame.Width);
-                                         Assert.Equal (top.Bounds.Height, winAddedToTop.Frame.Height);
+                                         Assert.Equal (top.Viewport.Width, winAddedToTop.Frame.Width);
+                                         Assert.Equal (top.Viewport.Height, winAddedToTop.Frame.Height);
                                      };
 
         v1AddedToWin.Initialized += (s, e) =>
@@ -258,8 +258,8 @@ public class SubviewTests
         w.Initialized += (s, e) =>
                          {
                              wc++;
-                             Assert.Equal (t.Bounds.Width, w.Frame.Width);
-                             Assert.Equal (t.Bounds.Height, w.Frame.Height);
+                             Assert.Equal (t.Viewport.Width, w.Frame.Width);
+                             Assert.Equal (t.Viewport.Height, w.Frame.Height);
                          };
 
         v1.Initialized += (s, e) =>

+ 3 - 3
UnitTests/View/Text/AutoSizeFalseTests.cs

@@ -145,7 +145,7 @@ public class AutoSizeFalseTests
         Rectangle expectedViewBounds = new (0, 0, 0, 0);
 
         Assert.False (view.AutoSize);
-        Assert.Equal (expectedViewBounds, view.Bounds);
+        Assert.Equal (expectedViewBounds, view.Viewport);
         super.Dispose ();
     }
 
@@ -162,7 +162,7 @@ public class AutoSizeFalseTests
         Rectangle expectedViewBounds = new (0, 0, 30, 80);
 
         Assert.False (view.AutoSize);
-        Assert.Equal (expectedViewBounds, view.Bounds);
+        Assert.Equal (expectedViewBounds, view.Viewport);
         Assert.False (view.IsInitialized);
 
         super.BeginInit ();
@@ -170,7 +170,7 @@ public class AutoSizeFalseTests
 
         Assert.True (view.IsInitialized);
         Assert.False (view.AutoSize);
-        Assert.Equal (expectedViewBounds, view.Bounds);
+        Assert.Equal (expectedViewBounds, view.Viewport);
     }
 
     [Fact]

+ 7 - 7
UnitTests/View/Text/AutoSizeTrueTests.cs

@@ -587,7 +587,7 @@ public class AutoSizeTrueTests
                                      field.Text = $"Label {count}";
 
                                      // Label is AutoSize = true
-                                     var label = new Label { Text = field.Text, X = 0, Y = view.Bounds.Height /*, Width = 10*/ };
+                                     var label = new Label { Text = field.Text, X = 0, Y = view.Viewport.Height /*, Width = 10*/ };
                                      view.Add (label);
                                      Assert.Equal ($"Label {count}", label.Text);
                                      Assert.Equal ($"Absolute({count + 1})", label.Y.ToString ());
@@ -871,7 +871,7 @@ public class AutoSizeTrueTests
 
         Assert.True (label.AutoSize);
         Rectangle expectedLabelBounds = Rectangle.Empty;
-        Assert.Equal (expectedLabelBounds, label.Bounds);
+        Assert.Equal (expectedLabelBounds, label.Viewport);
         Assert.True (label.AutoSize);
 
         label.Text = "First line\nSecond line";
@@ -879,7 +879,7 @@ public class AutoSizeTrueTests
 
         expectedLabelBounds = new (0, 0, 11, 2);
         Assert.True (label.AutoSize);
-        Assert.Equal (expectedLabelBounds, label.Bounds);
+        Assert.Equal (expectedLabelBounds, label.Viewport);
 
         label.AutoSize = false;
         label.Width = Dim.Fill ();
@@ -891,7 +891,7 @@ public class AutoSizeTrueTests
         // Height set to 2.
         expectedLabelBounds = new (0, 0, 28, 2);
         Assert.False (label.AutoSize);
-        Assert.Equal (expectedLabelBounds, label.Bounds);
+        Assert.Equal (expectedLabelBounds, label.Viewport);
 
         label.Text = "First changed line\nSecond changed line\nNew line";
         win.LayoutSubviews ();
@@ -901,7 +901,7 @@ public class AutoSizeTrueTests
         // #3127: After: (0,0,28,2) because setting Text leaves Height set to 2.
         expectedLabelBounds = new (0, 0, 28, 2);
         Assert.False (label.AutoSize);
-        Assert.Equal (expectedLabelBounds, label.Bounds);
+        Assert.Equal (expectedLabelBounds, label.Viewport);
 
         label.AutoSize = true;
 
@@ -911,7 +911,7 @@ public class AutoSizeTrueTests
         // and height 3 because the text has 3 lines
         expectedLabelBounds = new (0, 0, 19, 3);
         Assert.True (label.AutoSize);
-        Assert.Equal (expectedLabelBounds, label.Bounds);
+        Assert.Equal (expectedLabelBounds, label.Viewport);
     }
 
     [Fact]
@@ -1494,7 +1494,7 @@ public class AutoSizeTrueTests
 
         Assert.True (label.AutoSize);
         Rectangle expectedLabelBounds = new (0, 0, 8, 1);
-        Assert.Equal (expectedLabelBounds, label.Bounds);
+        Assert.Equal (expectedLabelBounds, label.Viewport);
         super.Dispose ();
     }
 

+ 29 - 29
UnitTests/View/ViewTests.cs

@@ -18,13 +18,13 @@ public class ViewTests
         view.DrawContent += (s, e) =>
                             {
                                 Rectangle savedClip = Application.Driver.Clip;
-                                Application.Driver.Clip = new Rectangle (1, 1, view.Bounds.Width, view.Bounds.Height);
+                                Application.Driver.Clip = new Rectangle (1, 1, view.Viewport.Width, view.Viewport.Height);
 
-                                for (var row = 0; row < view.Bounds.Height; row++)
+                                for (var row = 0; row < view.Viewport.Height; row++)
                                 {
                                     Application.Driver.Move (1, row + 1);
 
-                                    for (var col = 0; col < view.Bounds.Width; col++)
+                                    for (var col = 0; col < view.Viewport.Width; col++)
                                     {
                                         Application.Driver.AddStr ($"{col}");
                                     }
@@ -53,7 +53,7 @@ public class ViewTests
         Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
         Assert.Equal (new Rectangle (0, 0, 20, 10), pos);
 
-        view.Clear (view.Bounds);
+        view.Clear (view.Viewport);
 
         expected = @"
 ┌──────────────────┐
@@ -80,13 +80,13 @@ public class ViewTests
         view.DrawContent += (s, e) =>
                             {
                                 Rectangle savedClip = Application.Driver.Clip;
-                                Application.Driver.Clip = new Rectangle (1, 1, view.Bounds.Width, view.Bounds.Height);
+                                Application.Driver.Clip = new Rectangle (1, 1, view.Viewport.Width, view.Viewport.Height);
 
-                                for (var row = 0; row < view.Bounds.Height; row++)
+                                for (var row = 0; row < view.Viewport.Height; row++)
                                 {
                                     Application.Driver.Move (1, row + 1);
 
-                                    for (var col = 0; col < view.Bounds.Width; col++)
+                                    for (var col = 0; col < view.Viewport.Width; col++)
                                     {
                                         Application.Driver.AddStr ($"{col}");
                                     }
@@ -115,7 +115,7 @@ public class ViewTests
         Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
         Assert.Equal (new Rectangle (0, 0, 20, 10), pos);
 
-        view.Clear (view.Bounds);
+        view.Clear (view.Viewport);
 
         expected = @"
 ┌──────────────────┐
@@ -248,7 +248,7 @@ At 0,0
         view.Frame = new Rectangle (3, 3, 10, 1);
         Assert.Equal (new Rectangle (3, 3, 10, 1), view.Frame);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         top.Draw ();
 
@@ -297,7 +297,7 @@ At 0,0
         view.Width = 10;
         view.Height = 1;
         Assert.Equal (new Rectangle (3, 3, 10, 1), view.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         top.Draw ();
 
@@ -344,7 +344,7 @@ At 0,0
         view.Frame = new Rectangle (1, 1, 10, 1);
         Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         top.Draw ();
 
@@ -391,7 +391,7 @@ At 0,0
         view.Width = 10;
         view.Height = 1;
         Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         top.Draw ();
 
@@ -555,7 +555,7 @@ At 0,0
                                                      );
 
         view.Frame = new Rectangle (3, 3, 10, 1);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         view.Draw ();
 
@@ -604,7 +604,7 @@ At 0,0
         view.Width = 10;
         view.Height = 1;
         Assert.Equal (new Rectangle (3, 3, 10, 1), view.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         view.Draw ();
 
@@ -651,7 +651,7 @@ At 0,0
         view.Frame = new Rectangle (1, 1, 10, 1);
         Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
         Assert.Equal (LayoutStyle.Absolute, view.LayoutStyle);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 10, 1), view._needsDisplayRect);
         view.Draw ();
 
@@ -700,7 +700,7 @@ At 0,0
         view.Width = 10;
         view.Height = 1;
         Assert.Equal (new Rectangle (1, 1, 10, 1), view.Frame);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), view.Viewport);
         Assert.Equal (new Rectangle (0, 0, 30, 2), view._needsDisplayRect);
         view.Draw ();
 
@@ -748,10 +748,10 @@ At 0,0
         Assert.True (r.Visible);
 
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ($"View(){r.Bounds}", r.ToString ());
+        Assert.Equal ($"View(){r.Viewport}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Viewport);
         Assert.Equal (new Rectangle (0, 0, 0, 0), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
@@ -773,10 +773,10 @@ At 0,0
         r = new View { Frame = Rectangle.Empty };
         Assert.NotNull (r);
         Assert.Equal (LayoutStyle.Absolute, r.LayoutStyle);
-        Assert.Equal ($"View(){r.Bounds}", r.ToString ());
+        Assert.Equal ($"View(){r.Viewport}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 0, 0), r.Viewport);
         Assert.Equal (new Rectangle (0, 0, 0, 0), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
@@ -801,7 +801,7 @@ At 0,0
         Assert.Equal ($"View(){r.Frame}", r.ToString ());
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rectangle (0, 0, 3, 4), r.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 3, 4), r.Viewport);
         Assert.Equal (new Rectangle (1, 2, 3, 4), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
@@ -832,7 +832,7 @@ At 0,0
         r.EndInit ();
         Assert.False (r.CanFocus);
         Assert.False (r.HasFocus);
-        Assert.Equal (new Rectangle (0, 0, 1, 13), r.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 1, 13), r.Viewport);
         Assert.Equal (new Rectangle (0, 0, 1, 13), r.Frame);
         Assert.Null (r.Focused);
         Assert.Null (r.ColorScheme);
@@ -929,8 +929,8 @@ At 0,0
         Assert.Equal (4, view.Height);
         Assert.False (view.Frame.IsEmpty);
         Assert.Equal (new Rectangle (1, 2, 3, 4), view.Frame);
-        Assert.False (view.Bounds.IsEmpty);
-        Assert.Equal (new Rectangle (0, 0, 3, 4), view.Bounds);
+        Assert.False (view.Viewport.IsEmpty);
+        Assert.Equal (new Rectangle (0, 0, 3, 4), view.Viewport);
 
         view.LayoutSubviews ();
 
@@ -939,7 +939,7 @@ At 0,0
         Assert.Equal (3, view.Width);
         Assert.Equal (4, view.Height);
         Assert.False (view.Frame.IsEmpty);
-        Assert.False (view.Bounds.IsEmpty);
+        Assert.False (view.Viewport.IsEmpty);
         super.Dispose ();
 
 #if DEBUG_IDISPOSABLE
@@ -953,7 +953,7 @@ At 0,0
         Assert.Equal (0, view.Width);
         Assert.Equal (0, view.Height);
         Assert.True (view.Frame.IsEmpty);
-        Assert.True (view.Bounds.IsEmpty);
+        Assert.True (view.Viewport.IsEmpty);
         view.Dispose ();
 
         // Object Initializer
@@ -963,7 +963,7 @@ At 0,0
         Assert.Equal (0, view.Width);
         Assert.Equal (0, view.Height);
         Assert.False (view.Frame.IsEmpty);
-        Assert.True (view.Bounds.IsEmpty);
+        Assert.True (view.Viewport.IsEmpty);
         view.Dispose ();
 
         // Default Constructor and post assignment equivalent to Object Initializer
@@ -983,8 +983,8 @@ At 0,0
         Assert.Equal (4, view.Height);
         Assert.False (view.Frame.IsEmpty);
         Assert.Equal (new Rectangle (1, 2, 3, 4), view.Frame);
-        Assert.False (view.Bounds.IsEmpty);
-        Assert.Equal (new Rectangle (0, 0, 3, 4), view.Bounds);
+        Assert.False (view.Viewport.IsEmpty);
+        Assert.Equal (new Rectangle (0, 0, 3, 4), view.Viewport);
         super.Dispose ();
     }
 

+ 6 - 6
UnitTests/Views/ButtonTests.cs

@@ -432,14 +432,14 @@ public class ButtonTests
         Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
         Assert.Equal ('_', btn.HotKeySpecifier.Value);
         Assert.True (btn.CanFocus);
-        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Viewport);
         Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Frame);
         Assert.Equal ($"{CM.Glyphs.LeftBracket}  {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
         Assert.False (btn.IsDefault);
         Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
         Assert.Equal ('_', btn.HotKeySpecifier.Value);
         Assert.True (btn.CanFocus);
-        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Viewport);
         Assert.Equal (new Rectangle (0, 0, 4, 1), btn.Frame);
 
         Assert.Equal (string.Empty, btn.Title);
@@ -478,7 +478,7 @@ public class ButtonTests
         Assert.True (btn.IsDefault);
         Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
         Assert.True (btn.CanFocus);
-        Assert.Equal (new Rectangle (0, 0, 10, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 1), btn.Viewport);
         Assert.Equal (new Rectangle (0, 0, 10, 1), btn.Frame);
         Assert.Equal (KeyCode.T, btn.HotKey);
 
@@ -521,7 +521,7 @@ public class ButtonTests
 ";
         TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
 
-        Assert.Equal (new Rectangle (0, 0, 9, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 9, 1), btn.Viewport);
         Assert.Equal (new Rectangle (1, 2, 9, 1), btn.Frame);
     }
 
@@ -762,7 +762,7 @@ public class ButtonTests
         Assert.True (btn.IsInitialized);
         Assert.Equal ("Say Hello 你", btn.Text);
         Assert.Equal ($"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
-        Assert.Equal (new Rectangle (0, 0, 16, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 16, 1), btn.Viewport);
         var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}";
 
         var expected = @$"
@@ -799,7 +799,7 @@ public class ButtonTests
         Assert.True (btn.IsInitialized);
         Assert.Equal ("Say Hello 你", btn.Text);
         Assert.Equal ($"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
-        Assert.Equal (new Rectangle (0, 0, 16, 1), btn.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 16, 1), btn.Viewport);
         var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}";
 
         var expected = @$"

+ 18 - 18
UnitTests/Views/ComboBoxTests.cs

@@ -144,7 +144,7 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -200,7 +200,7 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -236,7 +236,7 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -292,7 +292,7 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -337,7 +337,7 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
 
@@ -354,7 +354,7 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("Three", selected);
@@ -392,14 +392,14 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
 
         Assert.True (
                      cb.Subviews [1]
                        .OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -423,7 +423,7 @@ public class ComboBoxTests
         Assert.True (
                      cb.Subviews [1]
                        .OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -447,7 +447,7 @@ public class ComboBoxTests
         Assert.True (
                      cb.Subviews [1]
                        .OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -471,7 +471,7 @@ public class ComboBoxTests
         Assert.True (
                      cb.Subviews [1]
                        .OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Clicked }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -509,7 +509,7 @@ public class ComboBoxTests
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -665,7 +665,7 @@ Three ",
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -677,7 +677,7 @@ Three ",
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -687,7 +687,7 @@ Three ",
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -699,7 +699,7 @@ Three ",
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -726,7 +726,7 @@ Three ",
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);
@@ -782,7 +782,7 @@ Three ",
 
         Assert.True (
                      cb.OnMouseEvent (
-                                    new MouseEvent { X = cb.Bounds.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
+                                    new MouseEvent { X = cb.Viewport.Right - 1, Y = 0, Flags = MouseFlags.Button1Pressed }
                                    )
                     );
         Assert.Equal ("", selected);

+ 23 - 23
UnitTests/Views/GraphViewTests.cs

@@ -61,7 +61,7 @@ public class GraphViewTests
         gv.EndInit ();
 
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rectangle (0, 0, 50, 30);
+        gv.Viewport = new Rectangle (0, 0, 50, 30);
         gv.Series.Add (new ScatterSeries { Points = new List<PointF> { new (1, 1) } });
         gv.CellSize = new PointF (0, 5);
         var ex = Assert.Throws<Exception> (() => gv.Draw ());
@@ -85,7 +85,7 @@ public class GraphViewTests
         gv.ColorScheme = new ColorScheme ();
         gv.MarginBottom = 1;
         gv.MarginLeft = 1;
-        gv.Bounds = new Rectangle (0, 0, 10, 5);
+        gv.Viewport = new Rectangle (0, 0, 10, 5);
 
         return gv;
     }
@@ -128,7 +128,7 @@ public class GraphViewTests
         var gv = new GraphView ();
         gv.BeginInit ();
         gv.EndInit ();
-        gv.Bounds = new Rectangle (0, 0, 50, 30);
+        gv.Viewport = new Rectangle (0, 0, 50, 30);
 
         // How much graph space each cell of the console depicts
         gv.CellSize = new PointF (0.1f, 0.25f);
@@ -141,9 +141,9 @@ public class GraphViewTests
         // Start the graph at 80
         gv.ScrollOffset = new PointF (0, 80);
 
-        for (var x = 0; x < gv.Bounds.Width; x++)
+        for (var x = 0; x < gv.Viewport.Width; x++)
         {
-            for (var y = 0; y < gv.Bounds.Height; y++)
+            for (var y = 0; y < gv.Viewport.Height; y++)
             {
                 RectangleF graphSpace = gv.ScreenToGraphSpace (x, y);
 
@@ -199,7 +199,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         RectangleF botLeft = gv.ScreenToGraphSpace (0, 9);
@@ -221,7 +221,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         RectangleF botLeft = gv.ScreenToGraphSpace (0, 9);
@@ -261,7 +261,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         // Each cell of screen measures 5 units in graph data model vertically and 1/4 horizontally
         gv.CellSize = new PointF (0.25f, 5);
@@ -293,7 +293,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         Point botLeft = gv.GraphSpaceToScreen (new PointF (0, 0));
@@ -313,7 +313,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         // origin should be bottom left
         Point botLeft = gv.GraphSpaceToScreen (new PointF (0, 0));
@@ -343,7 +343,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         //graph is scrolled to present chart space -5 to 5 in both axes
         gv.ScrollOffset = new PointF (-5, -5);
@@ -366,7 +366,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         // Each cell of screen is responsible for rendering 5 units in graph data model
         // vertically and 1/4 horizontally
@@ -407,7 +407,7 @@ public class GraphViewTests
         gv.BeginInit ();
         gv.EndInit ();
 
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
 
         // Each cell of screen is responsible for rendering 5 units in graph data model
         // vertically and 1/4 horizontally
@@ -449,7 +449,7 @@ public class SeriesTests
         gv.BeginInit ();
         gv.EndInit ();
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rectangle (0, 0, 50, 30);
+        gv.Viewport = new Rectangle (0, 0, 50, 30);
 
         var fullGraphBounds = RectangleF.Empty;
         var graphScreenBounds = Rectangle.Empty;
@@ -501,7 +501,7 @@ public class SeriesTests
         gv.BeginInit ();
         gv.EndInit ();
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rectangle (0, 0, 50, 30);
+        gv.Viewport = new Rectangle (0, 0, 50, 30);
 
         // the larger the cell size the more condensed (smaller) the graph space is
         gv.CellSize = new PointF (2, 5);
@@ -641,7 +641,7 @@ public class MultiBarSeriesTests
 
         // y axis goes from 0.1 to 1 across 10 console rows
         // x axis goes from 0 to 20 across 20 console columns
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
         gv.CellSize = new PointF (1f, 0.1f);
         gv.MarginBottom = 1;
         gv.MarginLeft = 1;
@@ -873,7 +873,7 @@ public class BarSeriesTests
 
         // y axis goes from 0.1 to 1 across 10 console rows
         // x axis goes from 0 to 10 across 20 console columns
-        gv.Bounds = new Rectangle (0, 0, 20, 10);
+        gv.Viewport = new Rectangle (0, 0, 20, 10);
         gv.CellSize = new PointF (0.5f, 0.1f);
 
         gv.Series.Add (series = new FakeBarSeries ());
@@ -914,7 +914,7 @@ public class AxisTests
 
         var gv = new GraphView ();
         gv.ColorScheme = new ColorScheme ();
-        gv.Bounds = new Rectangle (0, 0, 50, 30);
+        gv.Viewport = new Rectangle (0, 0, 50, 30);
 
         // graph can't be completely empty or it won't draw
         gv.Series.Add (new ScatterSeries ());
@@ -1298,19 +1298,19 @@ public class LegendTests
     public void Constructors_Defaults ()
     {
         var legend = new LegendAnnotation ();
-        Assert.Equal (Rectangle.Empty, legend.Bounds);
+        Assert.Equal (Rectangle.Empty, legend.Viewport);
         Assert.Equal (Rectangle.Empty, legend.Frame);
         Assert.Equal (LineStyle.Single, legend.BorderStyle);
         Assert.False (legend.BeforeSeries);
 
         var bounds = new Rectangle (1, 2, 10, 3);
         legend = new LegendAnnotation (bounds);
-        Assert.Equal (new Rectangle (0, 0, 8, 1), legend.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 8, 1), legend.Viewport);
         Assert.Equal (bounds, legend.Frame);
         Assert.Equal (LineStyle.Single, legend.BorderStyle);
         Assert.False (legend.BeforeSeries);
         legend.BorderStyle = LineStyle.None;
-        Assert.Equal (new Rectangle (0, 0, 10, 3), legend.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 3), legend.Viewport);
         Assert.Equal (bounds, legend.Frame);
     }
 
@@ -1549,7 +1549,7 @@ public class PathAnnotationTests
     public void XAxisLabels_With_MarginLeft ()
     {
         GraphViewTests.InitFakeDriver ();
-        var gv = new GraphView { ColorScheme = new ColorScheme (), Bounds = new Rectangle (0, 0, 10, 7) };
+        var gv = new GraphView { ColorScheme = new ColorScheme (), Viewport = new Rectangle (0, 0, 10, 7) };
 
         gv.CellSize = new PointF (1, 0.5f);
         gv.AxisY.Increment = 1;
@@ -1591,7 +1591,7 @@ public class PathAnnotationTests
     public void YAxisLabels_With_MarginBottom ()
     {
         GraphViewTests.InitFakeDriver ();
-        var gv = new GraphView { ColorScheme = new ColorScheme (), Bounds = new Rectangle (0, 0, 10, 7) };
+        var gv = new GraphView { ColorScheme = new ColorScheme (), Viewport = new Rectangle (0, 0, 10, 7) };
 
         gv.CellSize = new PointF (1, 0.5f);
         gv.AxisY.Increment = 1;

+ 5 - 5
UnitTests/Views/LabelTests.cs

@@ -458,7 +458,7 @@ e
         Assert.True (label.IsInitialized);
         Assert.Equal ("Say Hello 你", label.Text);
         Assert.Equal ("Say Hello 你", label.TextFormatter.Text);
-        Assert.Equal (new Rectangle (0, 0, 12, 1), label.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), label.Viewport);
 
         var expected = @"
 ┌────────────────────────────┐
@@ -488,7 +488,7 @@ e
         Assert.True (label.IsInitialized);
         Assert.Equal ("Say Hello 你", label.Text);
         Assert.Equal ("Say Hello 你", label.TextFormatter.Text);
-        Assert.Equal (new Rectangle (0, 0, 12, 1), label.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 12, 1), label.Viewport);
 
         var expected = @"
 ┌────────────────────────────┐
@@ -512,7 +512,7 @@ e
         Application.Begin (Application.Top);
 
         Assert.Equal (new (0, 0, 6, 3), label.Frame);
-        Assert.Equal (new (0, 0, 4, 1), label.Bounds);
+        Assert.Equal (new (0, 0, 4, 1), label.Viewport);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
                                                       @"
@@ -534,7 +534,7 @@ e
         Application.Begin (Application.Top);
 
         Assert.Equal (new (0, 0, 6, 3), label.Frame);
-        Assert.Equal (new (0, 0, 4, 1), label.Bounds);
+        Assert.Equal (new (0, 0, 4, 1), label.Viewport);
         Application.Begin (Application.Top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (
@@ -555,7 +555,7 @@ e
         Application.Begin (Application.Top);
 
         Assert.Equal (new (0, 0, 6, 2), label.Frame);
-        Assert.Equal (new (0, 0, 4, 1), label.Bounds);
+        Assert.Equal (new (0, 0, 4, 1), label.Viewport);
         Application.Begin (Application.Top);
 
         TestHelpers.AssertDriverContentsWithFrameAre (

+ 28 - 28
UnitTests/Views/ScrollBarViewTests.cs

@@ -23,13 +23,13 @@ public class ScrollBarViewTests
         Assert.True (_scrollBar.ShowScrollIndicator);
         Assert.True (_scrollBar.Visible);
         Assert.Equal ("Absolute(1)", _scrollBar.Width.ToString ());
-        Assert.Equal (1, _scrollBar.Bounds.Width);
+        Assert.Equal (1, _scrollBar.Viewport.Width);
 
         Assert.Equal (
                       $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
-        Assert.Equal (24, _scrollBar.Bounds.Height);
+        Assert.Equal (24, _scrollBar.Viewport.Height);
         Assert.True (_scrollBar.OtherScrollBarView.ShowScrollIndicator);
         Assert.True (_scrollBar.OtherScrollBarView.Visible);
 
@@ -37,22 +37,22 @@ public class ScrollBarViewTests
                       $"Combine(View(Width,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
-        Assert.Equal (79, _scrollBar.OtherScrollBarView.Bounds.Width);
+        Assert.Equal (79, _scrollBar.OtherScrollBarView.Viewport.Width);
         Assert.Equal ("Absolute(1)", _scrollBar.OtherScrollBarView.Height.ToString ());
-        Assert.Equal (1, _scrollBar.OtherScrollBarView.Bounds.Height);
+        Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height);
 
         _hostView.Lines = 10;
         _hostView.Draw ();
         Assert.False (_scrollBar.ShowScrollIndicator);
         Assert.False (_scrollBar.Visible);
         Assert.Equal ("Absolute(1)", _scrollBar.Width.ToString ());
-        Assert.Equal (1, _scrollBar.Bounds.Width);
+        Assert.Equal (1, _scrollBar.Viewport.Width);
 
         Assert.Equal (
                       $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
-        Assert.Equal (24, _scrollBar.Bounds.Height);
+        Assert.Equal (24, _scrollBar.Viewport.Height);
         Assert.True (_scrollBar.OtherScrollBarView.ShowScrollIndicator);
         Assert.True (_scrollBar.OtherScrollBarView.Visible);
 
@@ -60,22 +60,22 @@ public class ScrollBarViewTests
                       $"View(Width,HostView(){_hostView.Frame})",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
-        Assert.Equal (80, _scrollBar.OtherScrollBarView.Bounds.Width);
+        Assert.Equal (80, _scrollBar.OtherScrollBarView.Viewport.Width);
         Assert.Equal ("Absolute(1)", _scrollBar.OtherScrollBarView.Height.ToString ());
-        Assert.Equal (1, _scrollBar.OtherScrollBarView.Bounds.Height);
+        Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height);
 
         _hostView.Cols = 60;
         _hostView.Draw ();
         Assert.False (_scrollBar.ShowScrollIndicator);
         Assert.False (_scrollBar.Visible);
         Assert.Equal ("Absolute(1)", _scrollBar.Width.ToString ());
-        Assert.Equal (1, _scrollBar.Bounds.Width);
+        Assert.Equal (1, _scrollBar.Viewport.Width);
 
         Assert.Equal (
                       $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
-        Assert.Equal (24, _scrollBar.Bounds.Height);
+        Assert.Equal (24, _scrollBar.Viewport.Height);
         Assert.False (_scrollBar.OtherScrollBarView.ShowScrollIndicator);
         Assert.False (_scrollBar.OtherScrollBarView.Visible);
 
@@ -83,22 +83,22 @@ public class ScrollBarViewTests
                       $"View(Width,HostView(){_hostView.Frame})",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
-        Assert.Equal (80, _scrollBar.OtherScrollBarView.Bounds.Width);
+        Assert.Equal (80, _scrollBar.OtherScrollBarView.Viewport.Width);
         Assert.Equal ("Absolute(1)", _scrollBar.OtherScrollBarView.Height.ToString ());
-        Assert.Equal (1, _scrollBar.OtherScrollBarView.Bounds.Height);
+        Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height);
 
         _hostView.Lines = 40;
         _hostView.Draw ();
         Assert.True (_scrollBar.ShowScrollIndicator);
         Assert.True (_scrollBar.Visible);
         Assert.Equal ("Absolute(1)", _scrollBar.Width.ToString ());
-        Assert.Equal (1, _scrollBar.Bounds.Width);
+        Assert.Equal (1, _scrollBar.Viewport.Width);
 
         Assert.Equal (
                       $"View(Height,HostView(){_hostView.Frame})",
                       _scrollBar.Height.ToString ()
                      );
-        Assert.Equal (25, _scrollBar.Bounds.Height);
+        Assert.Equal (25, _scrollBar.Viewport.Height);
         Assert.False (_scrollBar.OtherScrollBarView.ShowScrollIndicator);
         Assert.False (_scrollBar.OtherScrollBarView.Visible);
 
@@ -106,22 +106,22 @@ public class ScrollBarViewTests
                       $"View(Width,HostView(){_hostView.Frame})",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
-        Assert.Equal (80, _scrollBar.OtherScrollBarView.Bounds.Width);
+        Assert.Equal (80, _scrollBar.OtherScrollBarView.Viewport.Width);
         Assert.Equal ("Absolute(1)", _scrollBar.OtherScrollBarView.Height.ToString ());
-        Assert.Equal (1, _scrollBar.OtherScrollBarView.Bounds.Height);
+        Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height);
 
         _hostView.Cols = 120;
         _hostView.Draw ();
         Assert.True (_scrollBar.ShowScrollIndicator);
         Assert.True (_scrollBar.Visible);
         Assert.Equal ("Absolute(1)", _scrollBar.Width.ToString ());
-        Assert.Equal (1, _scrollBar.Bounds.Width);
+        Assert.Equal (1, _scrollBar.Viewport.Width);
 
         Assert.Equal (
                       $"Combine(View(Height,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.Height.ToString ()
                      );
-        Assert.Equal (24, _scrollBar.Bounds.Height);
+        Assert.Equal (24, _scrollBar.Viewport.Height);
         Assert.True (_scrollBar.OtherScrollBarView.ShowScrollIndicator);
         Assert.True (_scrollBar.OtherScrollBarView.Visible);
 
@@ -129,9 +129,9 @@ public class ScrollBarViewTests
                       $"Combine(View(Width,HostView(){_hostView.Frame})-Absolute(1))",
                       _scrollBar.OtherScrollBarView.Width.ToString ()
                      );
-        Assert.Equal (79, _scrollBar.OtherScrollBarView.Bounds.Width);
+        Assert.Equal (79, _scrollBar.OtherScrollBarView.Viewport.Width);
         Assert.Equal ("Absolute(1)", _scrollBar.OtherScrollBarView.Height.ToString ());
-        Assert.Equal (1, _scrollBar.OtherScrollBarView.Bounds.Height);
+        Assert.Equal (1, _scrollBar.OtherScrollBarView.Viewport.Height);
     }
 
     [Fact]
@@ -499,7 +499,7 @@ This is a tes
                                                                                    newScrollBarView.Position,
                                                                                    newScrollBarView.Size
                                                                                    - listView.TopItem
-                                                                                   + (listView.TopItem - listView.Bounds.Height)
+                                                                                   + (listView.TopItem - listView.Viewport.Height)
                                                                                   );
                                                                      Assert.Equal (newScrollBarView.Position, listView.TopItem);
                                                                      Assert.Equal (27, newScrollBarView.Position);
@@ -960,7 +960,7 @@ This is a test
     public void Internal_Tests ()
     {
         Toplevel top = Application.Top;
-        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 80, 25), top.Viewport);
         var view = new View { Width = Dim.Fill (), Height = Dim.Fill () };
         top.Add (view);
         var sbv = new ScrollBarView (view, true);
@@ -1037,10 +1037,10 @@ This is a test
 
         AddHandlers ();
 
-        Assert.Equal (80, _hostView.Bounds.Width);
-        Assert.Equal (25, _hostView.Bounds.Height);
-        Assert.Equal (79, _scrollBar.OtherScrollBarView.Bounds.Width);
-        Assert.Equal (24, _scrollBar.Bounds.Height);
+        Assert.Equal (80, _hostView.Viewport.Width);
+        Assert.Equal (25, _hostView.Viewport.Height);
+        Assert.Equal (79, _scrollBar.OtherScrollBarView.Viewport.Width);
+        Assert.Equal (24, _scrollBar.Viewport.Height);
         Assert.Equal (30, _scrollBar.Size);
         Assert.Equal (100, _scrollBar.OtherScrollBarView.Size);
         Assert.True (_scrollBar.ShowScrollIndicator);
@@ -1049,7 +1049,7 @@ This is a test
         Assert.True (_scrollBar.OtherScrollBarView.Visible);
 
         _scrollBar.Position = 50;
-        Assert.Equal (_scrollBar.Position, _scrollBar.Size - _scrollBar.Bounds.Height);
+        Assert.Equal (_scrollBar.Position, _scrollBar.Size - _scrollBar.Viewport.Height);
         Assert.Equal (_scrollBar.Position, _hostView.Top);
         Assert.Equal (6, _scrollBar.Position);
         Assert.Equal (6, _hostView.Top);
@@ -1062,7 +1062,7 @@ This is a test
 
         Assert.Equal (
                       _scrollBar.OtherScrollBarView.Position,
-                      _scrollBar.OtherScrollBarView.Size - _scrollBar.OtherScrollBarView.Bounds.Width
+                      _scrollBar.OtherScrollBarView.Size - _scrollBar.OtherScrollBarView.Viewport.Width
                      );
         Assert.Equal (_scrollBar.OtherScrollBarView.Position, _hostView.Left);
         Assert.Equal (21, _scrollBar.OtherScrollBarView.Position);

+ 5 - 5
UnitTests/Views/ScrollViewTests.cs

@@ -34,7 +34,7 @@ public class ScrollViewTests
         Application.Top.Add (sv);
         Application.Begin (Application.Top);
 
-        Assert.Equal (new Rectangle (0, 0, 10, 10), sv.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), sv.Viewport);
 
         Assert.False (sv.AutoHideScrollBars);
         Assert.True (sv.ShowHorizontalScrollIndicator);
@@ -58,9 +58,9 @@ public class ScrollViewTests
                                             );
 
         sv.ShowHorizontalScrollIndicator = false;
-        Assert.Equal (new Rectangle (0, 0, 10, 10), sv.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), sv.Viewport);
         sv.ShowVerticalScrollIndicator = true;
-        Assert.Equal (new Rectangle (0, 0, 10, 10), sv.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 10, 10), sv.Viewport);
 
         Assert.False (sv.AutoHideScrollBars);
         Assert.False (sv.ShowHorizontalScrollIndicator);
@@ -1081,14 +1081,14 @@ public class ScrollViewTests
                                         {
                                             var fillText = new StringBuilder ();
 
-                                            for (var i = 0; i < labelFill.Bounds.Height; i++)
+                                            for (var i = 0; i < labelFill.Viewport.Height; i++)
                                             {
                                                 if (i > 0)
                                                 {
                                                     fillText.AppendLine ("");
                                                 }
 
-                                                for (var j = 0; j < labelFill.Bounds.Width; j++)
+                                                for (var j = 0; j < labelFill.Viewport.Width; j++)
                                                 {
                                                     fillText.Append (fill);
                                                 }

+ 2 - 2
UnitTests/Views/StatusBarTests.cs

@@ -99,7 +99,7 @@ public class StatusBarTests
                                );
         Application.Top.Add (sb);
 
-        sb.OnDrawContent (sb.Bounds);
+        sb.OnDrawContent (sb.Viewport);
 
         var expected = @$"
 ^O Open {
@@ -121,7 +121,7 @@ public class StatusBarTests
                                 }
                                );
         Application.Top.Add (sb);
-        sb.OnDrawContent (sb.Bounds);
+        sb.OnDrawContent (sb.Viewport);
 
         var expected = @$"
 CTRL-O Open {

+ 40 - 40
UnitTests/Views/TableViewTests.cs

@@ -125,7 +125,7 @@ public class TableViewTests
         // create a 4 by 4 table
         var tableView = new TableView
         {
-            Table = BuildTable (4, 4, out DataTable dt), MultiSelect = true, Bounds = new Rectangle (0, 0, 10, 5)
+            Table = BuildTable (4, 4, out DataTable dt), MultiSelect = true, Viewport = new Rectangle (0, 0, 10, 5)
         };
         tableView.BeginInit ();
         tableView.EndInit ();
@@ -152,7 +152,7 @@ public class TableViewTests
         // create a 4 by 4 table
         var tableView = new TableView
         {
-            Table = BuildTable (4, 4, out DataTable dt), MultiSelect = true, Bounds = new Rectangle (0, 0, 10, 5)
+            Table = BuildTable (4, 4, out DataTable dt), MultiSelect = true, Viewport = new Rectangle (0, 0, 10, 5)
         };
         tableView.BeginInit ();
         tableView.EndInit ();
@@ -180,7 +180,7 @@ public class TableViewTests
         var tableView = new TableView ();
         tableView.BeginInit ();
         tableView.EndInit ();
-        tableView.Bounds = new Rectangle (0, 0, 25, 10);
+        tableView.Viewport = new Rectangle (0, 0, 25, 10);
 
         Assert.Equal (0, tableView.RowOffset);
         Assert.Equal (0, tableView.ColumnOffset);
@@ -237,7 +237,7 @@ public class TableViewTests
     {
         var tableView = new TableView
         {
-            Table = BuildTable (3, 3), MultiSelect = multiSelect, Bounds = new Rectangle (0, 0, 10, 5)
+            Table = BuildTable (3, 3), MultiSelect = multiSelect, Viewport = new Rectangle (0, 0, 10, 5)
         };
         tableView.BeginInit ();
         tableView.EndInit ();
@@ -253,7 +253,7 @@ public class TableViewTests
     {
         var tableView = new TableView
         {
-            Table = BuildTable (3, 3), MultiSelect = true, FullRowSelect = true, Bounds = new Rectangle (0, 0, 10, 5)
+            Table = BuildTable (3, 3), MultiSelect = true, FullRowSelect = true, Viewport = new Rectangle (0, 0, 10, 5)
         };
         tableView.BeginInit ();
         tableView.EndInit ();
@@ -280,7 +280,7 @@ public class TableViewTests
     {
         var tableView = new TableView
         {
-            Table = BuildTable (3, 3), MultiSelect = true, Bounds = new Rectangle (0, 0, 10, 5)
+            Table = BuildTable (3, 3), MultiSelect = true, Viewport = new Rectangle (0, 0, 10, 5)
         };
         tableView.BeginInit ();
         tableView.EndInit ();
@@ -305,7 +305,7 @@ public class TableViewTests
     {
         var tableView = new TableView
         {
-            Table = BuildTable (20, 20), MultiSelect = true, Bounds = new Rectangle (0, 0, 10, 5)
+            Table = BuildTable (20, 20), MultiSelect = true, Viewport = new Rectangle (0, 0, 10, 5)
         };
         tableView.BeginInit ();
         tableView.EndInit ();
@@ -423,7 +423,7 @@ public class TableViewTests
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
 
         // 25 characters can be printed into table
-        tableView.Bounds = new Rectangle (0, 0, 25, 5);
+        tableView.Viewport = new Rectangle (0, 0, 25, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = true;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -524,7 +524,7 @@ public class TableViewTests
         var driver = (FakeDriver)Application.Driver;
         driver.ClearContents ();
 
-        tableView.Bounds = new Rectangle (0, 0, 9, 5);
+        tableView.Viewport = new Rectangle (0, 0, 9, 5);
         tableView.LayoutSubviews ();
         tableView.Draw ();
 
@@ -541,7 +541,7 @@ public class TableViewTests
         // setting width to 10 leaves just enough space for the column to
         // meet MinAcceptableWidth of 5.  Column width includes terminator line
         // symbol (e.g. ┤ or │)
-        tableView.Bounds = new Rectangle (0, 0, 10, 5);
+        tableView.Viewport = new Rectangle (0, 0, 10, 5);
         tableView.LayoutSubviews ();
         tableView.Draw ();
 
@@ -554,7 +554,7 @@ public class TableViewTests
 ";
         TestHelpers.AssertDriverContentsAre (expected, output);
 
-        tableView.Bounds = new Rectangle (0, 0, 25, 5);
+        tableView.Viewport = new Rectangle (0, 0, 25, 5);
 
         // revert style change
         style.MinAcceptableWidth = TableView.DefaultMinAcceptableWidth;
@@ -601,7 +601,7 @@ public class TableViewTests
     {
         var tableView = new TableView
         {
-            Table = BuildTable (25, 50), MultiSelect = true, Bounds = new Rectangle (0, 0, 10, 5)
+            Table = BuildTable (25, 50), MultiSelect = true, Viewport = new Rectangle (0, 0, 10, 5)
         };
 
         // Header should take up 2 lines
@@ -637,7 +637,7 @@ public class TableViewTests
     {
         var tableView = new TableView ();
         tableView.ColorScheme = new ColorScheme ();
-        tableView.Bounds = new Rectangle (0, 0, 25, 10);
+        tableView.Viewport = new Rectangle (0, 0, 25, 10);
 
         // Set a table with 1 column
         tableView.Table = BuildTable (1, 50, out DataTable dt);
@@ -659,7 +659,7 @@ public class TableViewTests
         tableView.Table = BuildTable (25, 50);
 
         // 1 header + 4 rows visible
-        tableView.Bounds = new Rectangle (0, 0, 25, 5);
+        tableView.Viewport = new Rectangle (0, 0, 25, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = false;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -686,7 +686,7 @@ public class TableViewTests
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
 
         // 3 columns are visibile
-        tableView.Bounds = new Rectangle (0, 0, 7, 5);
+        tableView.Viewport = new Rectangle (0, 0, 7, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = true;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -764,7 +764,7 @@ public class TableViewTests
         tableView.LayoutSubviews ();
 
         // 3 columns are visibile
-        tableView.Bounds = new Rectangle (0, 0, 7, 5);
+        tableView.Viewport = new Rectangle (0, 0, 7, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = false;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -827,7 +827,7 @@ public class TableViewTests
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
 
         // 3 columns are visibile
-        tableView.Bounds = new Rectangle (0, 0, 7, 5);
+        tableView.Viewport = new Rectangle (0, 0, 7, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = false;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -944,7 +944,7 @@ public class TableViewTests
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
 
         // 3 columns are visibile
-        tableView.Bounds = new Rectangle (0, 0, 7, 5);
+        tableView.Viewport = new Rectangle (0, 0, 7, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = true;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -975,7 +975,7 @@ public class TableViewTests
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
 
         // 3 columns are visibile
-        tableView.Bounds = new Rectangle (0, 0, 7, 5);
+        tableView.Viewport = new Rectangle (0, 0, 7, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = true;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -1044,7 +1044,7 @@ public class TableViewTests
         tv.LayoutSubviews ();
 
         // width exactly matches the max col widths
-        tv.Bounds = new Rectangle (0, 0, 5, 4);
+        tv.Viewport = new Rectangle (0, 0, 5, 4);
 
         // Create a style for column B
         ColumnStyle bStyle = tv.Style.GetOrCreateColumnStyle (1);
@@ -1141,7 +1141,7 @@ public class TableViewTests
         tv.LayoutSubviews ();
 
         // width exactly matches the max col widths
-        tv.Bounds = new Rectangle (0, 0, 5, 4);
+        tv.Viewport = new Rectangle (0, 0, 5, 4);
 
         var rowHighlight = new ColorScheme
         {
@@ -1235,7 +1235,7 @@ public class TableViewTests
         tv.LayoutSubviews ();
 
         // width exactly matches the max col widths
-        tv.Bounds = new Rectangle (0, 0, 5, 4);
+        tv.Viewport = new Rectangle (0, 0, 5, 4);
 
         // private method for forcing the view to be focused/not focused
         MethodInfo setFocusMethod =
@@ -1282,7 +1282,7 @@ public class TableViewTests
         tv.LayoutSubviews ();
 
         // width exactly matches the max col widths
-        tv.Bounds = new Rectangle (0, 0, 5, 4);
+        tv.Viewport = new Rectangle (0, 0, 5, 4);
 
         // private method for forcing the view to be focused/not focused
         MethodInfo setFocusMethod =
@@ -1354,7 +1354,7 @@ public class TableViewTests
         tv.Style.ExpandLastColumn = false;
 
         // width exactly matches the max col widths
-        tv.Bounds = new Rectangle (0, 0, 5, 4);
+        tv.Viewport = new Rectangle (0, 0, 5, 4);
 
         tv.Draw ();
 
@@ -1398,7 +1398,7 @@ public class TableViewTests
     public void TableView_ShowHeadersFalse_AllLines ()
     {
         TableView tv = GetABCDEFTableView (out _);
-        tv.Bounds = new Rectangle (0, 0, 5, 5);
+        tv.Viewport = new Rectangle (0, 0, 5, 5);
 
         tv.Style.ShowHeaders = false;
         tv.Style.ShowHorizontalHeaderOverline = true;
@@ -1422,7 +1422,7 @@ public class TableViewTests
     public void TableView_ShowHeadersFalse_AndNoHeaderLines ()
     {
         TableView tv = GetABCDEFTableView (out _);
-        tv.Bounds = new Rectangle (0, 0, 5, 5);
+        tv.Viewport = new Rectangle (0, 0, 5, 5);
 
         tv.Style.ShowHeaders = false;
         tv.Style.ShowHorizontalHeaderOverline = false;
@@ -1441,7 +1441,7 @@ public class TableViewTests
     public void TableView_ShowHeadersFalse_OverlineTrue ()
     {
         TableView tv = GetABCDEFTableView (out _);
-        tv.Bounds = new Rectangle (0, 0, 5, 5);
+        tv.Viewport = new Rectangle (0, 0, 5, 5);
 
         tv.Style.ShowHeaders = false;
         tv.Style.ShowHorizontalHeaderOverline = true;
@@ -1461,7 +1461,7 @@ public class TableViewTests
     public void TableView_ShowHeadersFalse_UnderlineTrue ()
     {
         TableView tv = GetABCDEFTableView (out _);
-        tv.Bounds = new Rectangle (0, 0, 5, 5);
+        tv.Viewport = new Rectangle (0, 0, 5, 5);
 
         tv.Style.ShowHeaders = false;
         tv.Style.ShowHorizontalHeaderOverline = false;
@@ -1588,7 +1588,7 @@ public class TableViewTests
     {
         var tv = new TableView ();
         tv.ColorScheme = Colors.ColorSchemes ["TopLevel"];
-        tv.Bounds = new Rectangle (0, 0, 50, 7);
+        tv.Viewport = new Rectangle (0, 0, 50, 7);
 
         tv.Table = new EnumerableTableSource<string> (
                                                       new [] { "fish", "troll", "trap", "zoo" },
@@ -2219,7 +2219,7 @@ public class TableViewTests
     {
         var tv = new TableView ();
         tv.ColorScheme = Colors.ColorSchemes ["TopLevel"];
-        tv.Bounds = new Rectangle (0, 0, 50, 6);
+        tv.Viewport = new Rectangle (0, 0, 50, 6);
 
         tv.Table = new EnumerableTableSource<Type> (
                                                     new [] { typeof (string), typeof (int), typeof (float) },
@@ -2253,7 +2253,7 @@ public class TableViewTests
         TableView tv = GetTwoRowSixColumnTable (out DataTable dt);
         dt.Rows.Add (1, 2, 3, 4, 5, 6);
 
-        tv.Bounds = new Rectangle (0, 0, 7, 6);
+        tv.Viewport = new Rectangle (0, 0, 7, 6);
         tv.Frame = new Rectangle (0, 0, 7, 6);
         tv.LayoutSubviews ();
 
@@ -2269,7 +2269,7 @@ public class TableViewTests
         // should select that row
         Assert.Equal (2, tv.SelectedRow);
 
-        tv.OnDrawContent (tv.Bounds);
+        tv.OnDrawContent (tv.Viewport);
 
         var expected =
             @"
@@ -2310,7 +2310,7 @@ public class TableViewTests
         dt.Rows.Add (1, 2, 3, 4, 5, 6);
         tv.LayoutSubviews ();
 
-        tv.Bounds = new Rectangle (0, 0, 7, 6);
+        tv.Viewport = new Rectangle (0, 0, 7, 6);
 
         tv.FullRowSelect = true;
         tv.Style.ShowVerticalCellLines = false;
@@ -2362,7 +2362,7 @@ A B C
         TableView tv = GetTwoRowSixColumnTable (out DataTable dt);
         dt.Rows.Add (1, 2, 3, 4, 5, 6);
 
-        tv.Bounds = new Rectangle (0, 0, 7, 6);
+        tv.Viewport = new Rectangle (0, 0, 7, 6);
         tv.Frame = new Rectangle (0, 0, 7, 6);
         tv.LayoutSubviews ();
 
@@ -2377,7 +2377,7 @@ A B C
         // should select that row
         Assert.Equal (2, tv.SelectedRow);
 
-        tv.OnDrawContent (tv.Bounds);
+        tv.OnDrawContent (tv.Viewport);
 
         var expected =
             @"
@@ -2425,7 +2425,7 @@ A B C
 
         //tv.BeginInit (); tv.EndInit ();
         tv.ColorScheme = Colors.ColorSchemes ["TopLevel"];
-        tv.Bounds = new Rectangle (0, 0, 25, 4);
+        tv.Viewport = new Rectangle (0, 0, 25, 4);
 
         tv.Style = new TableStyle
         {
@@ -3194,7 +3194,7 @@ A B C
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
 
         // 3 columns are visible
-        tableView.Bounds = new Rectangle (0, 0, 7, 5);
+        tableView.Viewport = new Rectangle (0, 0, 7, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = false;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -3218,7 +3218,7 @@ A B C
     {
         var tv = new TableView ();
         tv.ColorScheme = Colors.ColorSchemes ["TopLevel"];
-        tv.Bounds = new Rectangle (0, 0, 25, 6);
+        tv.Viewport = new Rectangle (0, 0, 25, 6);
 
         List<PickablePet> pets = new ()
         {
@@ -3248,7 +3248,7 @@ A B C
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
 
         // 3 columns are visible
-        tableView.Bounds = new Rectangle (0, 0, 7, 5);
+        tableView.Viewport = new Rectangle (0, 0, 7, 5);
         tableView.Style.ShowHorizontalHeaderUnderline = true;
         tableView.Style.ShowHorizontalHeaderOverline = false;
         tableView.Style.AlwaysShowHeaders = true;
@@ -3277,7 +3277,7 @@ A B C
         var tv = new TableView ();
         tv.BeginInit ();
         tv.EndInit ();
-        tv.Bounds = new Rectangle (0, 0, 10, 4);
+        tv.Viewport = new Rectangle (0, 0, 10, 4);
 
         dt = new DataTable ();
         dt.Columns.Add ("A");

+ 1 - 1
UnitTests/Views/TextValidateFieldTests.cs

@@ -71,7 +71,7 @@ public class TextValidateField_NET_Provider_Tests
         // A-Alphanumeric, required. a-Alphanumeric, optional.
         var field = new TextValidateField { Provider = new NetMaskedTextProvider ("999 000 LLL >LLL |AAA aaa") };
 
-        Assert.Equal (field.Bounds.Width, field.Provider.DisplayText.Length);
+        Assert.Equal (field.Viewport.Width, field.Provider.DisplayText.Length);
         Assert.NotEqual (field.Provider.DisplayText.Length, field.Provider.Text.Length);
         Assert.Equal (new string (' ', field.Text.Length), field.Provider.Text);
     }

+ 6 - 6
UnitTests/Views/TextViewTests.cs

@@ -63,7 +63,7 @@ public class TextViewTests
 
         Application.Iteration += (s, a) =>
                                  {
-                                     int width = _textView.Bounds.Width - 1;
+                                     int width = _textView.Viewport.Width - 1;
                                      Assert.Equal (30, width + 1);
                                      Assert.Equal (10, _textView.Height);
                                      _textView.Text = "";
@@ -7111,7 +7111,7 @@ This is the second line.
 
         Application.Iteration += (s, a) =>
                                  {
-                                     int width = _textView.Bounds.Width - 1;
+                                     int width = _textView.Viewport.Width - 1;
                                      Assert.Equal (30, width + 1);
                                      Assert.Equal (10, _textView.Height);
                                      _textView.Text = "";
@@ -7152,7 +7152,7 @@ This is the second line.
 
         Application.Iteration += (s, a) =>
                                  {
-                                     int width = _textView.Bounds.Width - 1;
+                                     int width = _textView.Viewport.Width - 1;
                                      Assert.Equal (30, width + 1);
                                      Assert.Equal (10, _textView.Height);
                                      var col = 0;
@@ -7193,7 +7193,7 @@ This is the second line.
 
         Application.Iteration += (s, a) =>
                                  {
-                                     int width = _textView.Bounds.Width - 1;
+                                     int width = _textView.Viewport.Width - 1;
                                      Assert.Equal (30, width + 1);
                                      Assert.Equal (10, _textView.Height);
                                      _textView.Text = "";
@@ -7243,7 +7243,7 @@ This is the second line.
 
         Application.Iteration += (s, a) =>
                                  {
-                                     int width = _textView.Bounds.Width - 1;
+                                     int width = _textView.Viewport.Width - 1;
                                      Assert.Equal (30, width + 1);
                                      Assert.Equal (10, _textView.Height);
                                      Assert.Equal ("TAB to jump between text fields.", _textView.Text);
@@ -7295,7 +7295,7 @@ This is the second line.
 
         Application.Iteration += (s, a) =>
                                  {
-                                     int width = _textView.Bounds.Width - 1;
+                                     int width = _textView.Viewport.Width - 1;
                                      Assert.Equal (30, width + 1);
                                      Assert.Equal (10, _textView.Height);
                                      var col = 0;

+ 1 - 1
UnitTests/Views/ToplevelTests.cs

@@ -1360,7 +1360,7 @@ public class ToplevelTests
         Assert.Equal (new (1, 3, 10, 5), view.Frame);
         Assert.Equal (new (0, 0, 10, 5), view._needsDisplayRect);
 
-        view.OnDrawContent (view.Bounds);
+        view.OnDrawContent (view.Viewport);
         view.Frame = new (1, 3, 10, 5);
         Assert.Equal (new (1, 3, 10, 5), view.Frame);
         Assert.Equal (new (0, 0, 10, 5), view._needsDisplayRect);

+ 1 - 1
UnitTests/Views/TreeTableSourceTests.cs

@@ -227,7 +227,7 @@ public class TreeTableSourceTests : IDisposable
         var tableView = new TableView ();
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
         tableView.ColorScheme = Colors.ColorSchemes ["TopLevel"];
-        tableView.Bounds = new Rectangle (0, 0, 40, 6);
+        tableView.Viewport = new Rectangle (0, 0, 40, 6);
 
         tableView.Style.ShowHorizontalHeaderUnderline = true;
         tableView.Style.ShowHorizontalHeaderOverline = false;

+ 3 - 3
UnitTests/Views/TreeViewTests.cs

@@ -30,7 +30,7 @@ public class TreeViewTests
         tree.BeginInit ();
         tree.EndInit ();
 
-        tree.Bounds = new Rectangle (0, 0, 10, 10);
+        tree.Viewport = new Rectangle (0, 0, 10, 10);
 
         InitFakeDriver ();
 
@@ -60,7 +60,7 @@ public class TreeViewTests
         tree.EndInit ();
 
         // control only allows 1 row to be viewed at once
-        tree.Bounds = new Rectangle (0, 0, 20, 1);
+        tree.Viewport = new Rectangle (0, 0, 20, 1);
 
         InitFakeDriver ();
 
@@ -234,7 +234,7 @@ public class TreeViewTests
         tree.EndInit ();
 
         // Make tree bounds 1 in height so that EnsureVisible always requires updating scroll offset
-        tree.Bounds = new Rectangle (0, 0, 50, 1);
+        tree.Viewport = new Rectangle (0, 0, 50, 1);
 
         Assert.Null (tree.SelectedObject);
         Assert.Equal (0, tree.ScrollOffsetVertical);

+ 3 - 3
UnitTests/Views/WindowTests.cs

@@ -135,7 +135,7 @@ public class WindowTests
         Assert.Equal ($"Window(){defaultWindow.Frame}", defaultWindow.ToString ());
         Assert.True (defaultWindow.CanFocus);
         Assert.False (defaultWindow.HasFocus);
-        Assert.Equal (new Rectangle (0, 0, 2147483645, 2147483645), defaultWindow.Bounds);
+        Assert.Equal (new Rectangle (0, 0, 2147483645, 2147483645), defaultWindow.Viewport);
         Assert.Equal (new Rectangle (0, 0, 2147483647, 2147483647), defaultWindow.Frame);
         Assert.Null (defaultWindow.Focused);
         Assert.NotNull (defaultWindow.ColorScheme);
@@ -168,7 +168,7 @@ public class WindowTests
     #endif
         Assert.True (windowWithFrameRectEmpty.CanFocus);
         Assert.False (windowWithFrameRectEmpty.HasFocus);
-        Assert.Equal (Rectangle.Empty, windowWithFrameRectEmpty.Bounds);
+        Assert.Equal (Rectangle.Empty, windowWithFrameRectEmpty.Viewport);
         Assert.Equal (Rectangle.Empty, windowWithFrameRectEmpty.Frame);
         Assert.Null (windowWithFrameRectEmpty.Focused);
         Assert.NotNull (windowWithFrameRectEmpty.ColorScheme);
@@ -201,7 +201,7 @@ public class WindowTests
     #endif
         Assert.True (windowWithFrame1234.CanFocus);
         Assert.False (windowWithFrame1234.HasFocus);
-        Assert.Equal (new (0, 0, 1, 2), windowWithFrame1234.Bounds);
+        Assert.Equal (new (0, 0, 1, 2), windowWithFrame1234.Viewport);
         Assert.Equal (new (1, 2, 3, 4), windowWithFrame1234.Frame);
         Assert.Null (windowWithFrame1234.Focused);
         Assert.NotNull (windowWithFrame1234.ColorScheme);