Browse Source

fixing bugs caused by Pos.Combine bugfix

Tig Kindel 2 years ago
parent
commit
93b8dfdad1

+ 40 - 40
Terminal.Gui/Core/Border.cs

@@ -665,9 +665,9 @@ namespace Terminal.Gui {
 
 			// Draw the upper BorderThickness
 			for (int r = frame.Y - drawMarginFrame - sumThickness.Top;
-				r < frame.Y - drawMarginFrame - padding.Top; r++) {
+				r > 0 && r < frame.Y - drawMarginFrame - padding.Top; r++) {
 				for (int c = frame.X - drawMarginFrame - sumThickness.Left;
-					c < Math.Min (frame.Right + drawMarginFrame + sumThickness.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right + drawMarginFrame + sumThickness.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -675,9 +675,9 @@ namespace Terminal.Gui {
 
 			// Draw the left BorderThickness
 			for (int r = frame.Y - drawMarginFrame - padding.Top;
-				r < Math.Min (frame.Bottom + drawMarginFrame + padding.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom + drawMarginFrame + padding.Bottom, driver.Rows); r++) {
 				for (int c = frame.X - drawMarginFrame - sumThickness.Left;
-					c < frame.X - drawMarginFrame - padding.Left; c++) {
+					c > 0 && c < frame.X - drawMarginFrame - padding.Left; c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -685,9 +685,9 @@ namespace Terminal.Gui {
 
 			// Draw the right BorderThickness
 			for (int r = frame.Y - drawMarginFrame - padding.Top;
-				r < Math.Min (frame.Bottom + drawMarginFrame + padding.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom + drawMarginFrame + padding.Bottom, driver.Rows); r++) {
 				for (int c = frame.Right + drawMarginFrame + padding.Right;
-					c < Math.Min (frame.Right + drawMarginFrame + sumThickness.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right + drawMarginFrame + sumThickness.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -695,9 +695,9 @@ namespace Terminal.Gui {
 
 			// Draw the lower BorderThickness
 			for (int r = frame.Bottom + drawMarginFrame + padding.Bottom;
-				r < Math.Min (frame.Bottom + drawMarginFrame + sumThickness.Bottom, driver.Rows); r++) {
+				r > 0 && r > 0 && r < Math.Min (frame.Bottom + drawMarginFrame + sumThickness.Bottom, driver.Rows); r++) {
 				for (int c = frame.X - drawMarginFrame - sumThickness.Left;
-					c < Math.Min (frame.Right + drawMarginFrame + sumThickness.Right, driver.Cols); c++) {
+					c > 0 && c > 0 && c < Math.Min (frame.Right + drawMarginFrame + sumThickness.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -707,9 +707,9 @@ namespace Terminal.Gui {
 
 			// Draw the upper Padding
 			for (int r = frame.Y - drawMarginFrame - padding.Top;
-				r < frame.Y - drawMarginFrame; r++) {
+				r > 0 && r < frame.Y - drawMarginFrame; r++) {
 				for (int c = frame.X - drawMarginFrame - padding.Left;
-					c < Math.Min (frame.Right + drawMarginFrame + padding.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right + drawMarginFrame + padding.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -717,9 +717,9 @@ namespace Terminal.Gui {
 
 			// Draw the left Padding
 			for (int r = frame.Y - drawMarginFrame;
-				r < Math.Min (frame.Bottom + drawMarginFrame, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom + drawMarginFrame, driver.Rows); r++) {
 				for (int c = frame.X - drawMarginFrame - padding.Left;
-					c < frame.X - drawMarginFrame; c++) {
+					c > 0 && c < frame.X - drawMarginFrame; c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -727,9 +727,9 @@ namespace Terminal.Gui {
 
 			// Draw the right Padding
 			for (int r = frame.Y - drawMarginFrame;
-				r < Math.Min (frame.Bottom + drawMarginFrame, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom + drawMarginFrame, driver.Rows); r++) {
 				for (int c = frame.Right + drawMarginFrame;
-					c < Math.Min (frame.Right + drawMarginFrame + padding.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right + drawMarginFrame + padding.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -737,9 +737,9 @@ namespace Terminal.Gui {
 
 			// Draw the lower Padding
 			for (int r = frame.Bottom + drawMarginFrame;
-				r < Math.Min (frame.Bottom + drawMarginFrame + padding.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom + drawMarginFrame + padding.Bottom, driver.Rows); r++) {
 				for (int c = frame.X - drawMarginFrame - padding.Left;
-					c < Math.Min (frame.Right + drawMarginFrame + padding.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right + drawMarginFrame + padding.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -820,9 +820,9 @@ namespace Terminal.Gui {
 
 			// Draw the upper BorderThickness
 			for (int r = frame.Y;
-				r < Math.Min (frame.Y + borderThickness.Top, frame.Bottom); r++) {
+				r > 0 && r < Math.Min (frame.Y + borderThickness.Top, frame.Bottom); r++) {
 				for (int c = frame.X;
-					c < Math.Min (frame.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -830,9 +830,9 @@ namespace Terminal.Gui {
 
 			// Draw the left BorderThickness
 			for (int r = Math.Min (frame.Y + borderThickness.Top, frame.Bottom);
-				r < Math.Min (frame.Bottom - borderThickness.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom - borderThickness.Bottom, driver.Rows); r++) {
 				for (int c = frame.X;
-					c < Math.Min (frame.X + borderThickness.Left, frame.Right); c++) {
+					c > 0 && c < Math.Min (frame.X + borderThickness.Left, frame.Right); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -840,9 +840,9 @@ namespace Terminal.Gui {
 
 			// Draw the right BorderThickness
 			for (int r = Math.Min (frame.Y + borderThickness.Top, frame.Bottom);
-				r < Math.Min (frame.Bottom - borderThickness.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom - borderThickness.Bottom, driver.Rows); r++) {
 				for (int c = Math.Max (frame.Right - borderThickness.Right, frame.X);
-					c < Math.Min (frame.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -850,9 +850,9 @@ namespace Terminal.Gui {
 
 			// Draw the lower BorderThickness
 			for (int r = Math.Max (frame.Bottom - borderThickness.Bottom, frame.Y);
-				r < Math.Min (frame.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom, driver.Rows); r++) {
 				for (int c = frame.X;
-					c < Math.Min (frame.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -862,9 +862,9 @@ namespace Terminal.Gui {
 
 			// Draw the upper Padding
 			for (int r = frame.Y + borderThickness.Top;
-				r < Math.Min (frame.Y + sumThickness.Top, frame.Bottom - borderThickness.Bottom); r++) {
+				r > 0 && r < Math.Min (frame.Y + sumThickness.Top, frame.Bottom - borderThickness.Bottom); r++) {
 				for (int c = frame.X + borderThickness.Left;
-					c < Math.Min (frame.Right - borderThickness.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right - borderThickness.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -872,9 +872,9 @@ namespace Terminal.Gui {
 
 			// Draw the left Padding
 			for (int r = frame.Y + sumThickness.Top;
-				r < Math.Min (frame.Bottom - sumThickness.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom - sumThickness.Bottom, driver.Rows); r++) {
 				for (int c = frame.X + borderThickness.Left;
-					c < Math.Min (frame.X + sumThickness.Left, frame.Right - borderThickness.Right); c++) {
+					c > 0 && c < Math.Min (frame.X + sumThickness.Left, frame.Right - borderThickness.Right); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -882,9 +882,9 @@ namespace Terminal.Gui {
 
 			// Draw the right Padding
 			for (int r = frame.Y + sumThickness.Top;
-				r < Math.Min (frame.Bottom - sumThickness.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom - sumThickness.Bottom, driver.Rows); r++) {
 				for (int c = Math.Max (frame.Right - sumThickness.Right, frame.X + sumThickness.Left);
-					c < Math.Max (frame.Right - borderThickness.Right, frame.X + sumThickness.Left); c++) {
+					c > 0 && c < Math.Max (frame.Right - borderThickness.Right, frame.X + sumThickness.Left); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -892,9 +892,9 @@ namespace Terminal.Gui {
 
 			// Draw the lower Padding
 			for (int r = Math.Max (frame.Bottom - sumThickness.Bottom, frame.Y + borderThickness.Top);
-				r < Math.Min (frame.Bottom - borderThickness.Bottom, driver.Rows); r++) {
+				r > 0 && r < Math.Min (frame.Bottom - borderThickness.Bottom, driver.Rows); r++) {
 				for (int c = frame.X + borderThickness.Left;
-					c < Math.Min (frame.Right - borderThickness.Right, driver.Cols); c++) {
+					c > 0 && c < Math.Min (frame.Right - borderThickness.Right, driver.Cols); c++) {
 
 					AddRuneAt (driver, c, r, ' ');
 				}
@@ -921,9 +921,9 @@ namespace Terminal.Gui {
 
 				// Draw the upper Effect3D
 				for (int r = Math.Max (frame.Y + effect3DOffset.Y, 0);
-					r < frame.Y; r++) {
+					r > 0 && r < frame.Y; r++) {
 					for (int c = Math.Max (frame.X + effect3DOffset.X, 0);
-						c < Math.Min (frame.Right + effect3DOffset.X, driver.Cols); c++) {
+						c > 0 && c < Math.Min (frame.Right + effect3DOffset.X, driver.Cols); c++) {
 
 						AddRuneAt (driver, c, r, (Rune)driver.Contents [r, c, 0]);
 					}
@@ -931,9 +931,9 @@ namespace Terminal.Gui {
 
 				// Draw the left Effect3D
 				for (int r = Math.Max (frame.Y + effect3DOffset.Y, 0);
-					r < Math.Min (frame.Bottom + effect3DOffset.Y, driver.Rows); r++) {
+					r > 0 && r < Math.Min (frame.Bottom + effect3DOffset.Y, driver.Rows); r++) {
 					for (int c = Math.Max (frame.X + effect3DOffset.X, 0);
-						c < frame.X; c++) {
+						c > 0 && c < frame.X; c++) {
 
 						AddRuneAt (driver, c, r, (Rune)driver.Contents [r, c, 0]);
 					}
@@ -941,9 +941,9 @@ namespace Terminal.Gui {
 
 				// Draw the right Effect3D
 				for (int r = Math.Max (frame.Y + effect3DOffset.Y, 0);
-					r < Math.Min (frame.Bottom + effect3DOffset.Y, driver.Rows); r++) {
+					r > 0 && r < Math.Min (frame.Bottom + effect3DOffset.Y, driver.Rows); r++) {
 					for (int c = frame.Right;
-						c < Math.Min (frame.Right + effect3DOffset.X, driver.Cols); c++) {
+						c > 0 && c < Math.Min (frame.Right + effect3DOffset.X, driver.Cols); c++) {
 
 						AddRuneAt (driver, c, r, (Rune)driver.Contents [r, c, 0]);
 					}
@@ -951,9 +951,9 @@ namespace Terminal.Gui {
 
 				// Draw the lower Effect3D
 				for (int r = frame.Bottom;
-					r < Math.Min (frame.Bottom + effect3DOffset.Y, driver.Rows); r++) {
+					r > 0 && r < Math.Min (frame.Bottom + effect3DOffset.Y, driver.Rows); r++) {
 					for (int c = Math.Max (frame.X + effect3DOffset.X, 0);
-						c < Math.Min (frame.Right + effect3DOffset.X, driver.Cols); c++) {
+						c > 0 && c < Math.Min (frame.Right + effect3DOffset.X, driver.Cols); c++) {
 
 						AddRuneAt (driver, c, r, (Rune)driver.Contents [r, c, 0]);
 					}

+ 63 - 63
UICatalog/Scenarios/Borders.cs

@@ -19,8 +19,6 @@ namespace UICatalog.Scenarios {
 			var effect3D = true;
 
 			var smartPanel = new PanelView () {
-				X = Pos.Center () - 38,
-				Y = Pos.Center () - 3,
 				Width = 24,
 				Height = 13,
 				Border = new Border () {
@@ -71,9 +69,7 @@ namespace UICatalog.Scenarios {
 			//	Height = 13
 			//};
 
-			var smartView = new Label () {
-				X = Pos.Center () + 10,
-				Y = Pos.Center () + 2,
+			var smartLabel = new Label () {
 				Border = new Border () {
 					BorderStyle = borderStyle,
 					DrawMarginFrame = drawMarginFrame,
@@ -88,7 +84,7 @@ namespace UICatalog.Scenarios {
 				Text = "This is a test\nwithout a \nPanelView",
 				TextAlignment = TextAlignment.Centered
 			};
-			smartView.Border.Child = smartView;
+			smartLabel.Border.Child = smartLabel;
 
 			Win.Add (new Label ("Padding:") {
 				X = Pos.Center () - 23,
@@ -105,16 +101,16 @@ namespace UICatalog.Scenarios {
 						int.Parse (e.NewText.ToString ()), smartPanel.Child.Border.Padding.Right,
 						smartPanel.Child.Border.Padding.Bottom);
 
-					smartView.Border.Padding = new Thickness (smartView.Border.Padding.Left,
-						int.Parse (e.NewText.ToString ()), smartView.Border.Padding.Right,
-						smartView.Border.Padding.Bottom);
+					smartLabel.Border.Padding = new Thickness (smartLabel.Border.Padding.Left,
+						int.Parse (e.NewText.ToString ()), smartLabel.Border.Padding.Right,
+						smartLabel.Border.Padding.Bottom);
 				} catch {
 					if (!e.NewText.IsEmpty) {
 						e.Cancel = true;
 					}
 				}
 			};
-			paddingTopEdit.Text = $"{smartView.Border.Padding.Top}";
+			paddingTopEdit.Text = $"{smartLabel.Border.Padding.Top}";
 
 			Win.Add (paddingTopEdit);
 
@@ -129,16 +125,16 @@ namespace UICatalog.Scenarios {
 						smartPanel.Child.Border.Padding.Top, smartPanel.Child.Border.Padding.Right,
 						smartPanel.Child.Border.Padding.Bottom);
 
-					smartView.Border.Padding = new Thickness (int.Parse (e.NewText.ToString ()),
-						smartView.Border.Padding.Top, smartView.Border.Padding.Right,
-						smartView.Border.Padding.Bottom);
+					smartLabel.Border.Padding = new Thickness (int.Parse (e.NewText.ToString ()),
+						smartLabel.Border.Padding.Top, smartLabel.Border.Padding.Right,
+						smartLabel.Border.Padding.Bottom);
 				} catch {
 					if (!e.NewText.IsEmpty) {
 						e.Cancel = true;
 					}
 				}
 			};
-			paddingLeftEdit.Text = $"{smartView.Border.Padding.Left}";
+			paddingLeftEdit.Text = $"{smartLabel.Border.Padding.Left}";
 			Win.Add (paddingLeftEdit);
 
 			var paddingRightEdit = new TextField ("") {
@@ -152,16 +148,16 @@ namespace UICatalog.Scenarios {
 						smartPanel.Child.Border.Padding.Top, int.Parse (e.NewText.ToString ()),
 						smartPanel.Child.Border.Padding.Bottom);
 
-					smartView.Border.Padding = new Thickness (smartView.Border.Padding.Left,
-						smartView.Border.Padding.Top, int.Parse (e.NewText.ToString ()),
-						smartView.Border.Padding.Bottom);
+					smartLabel.Border.Padding = new Thickness (smartLabel.Border.Padding.Left,
+						smartLabel.Border.Padding.Top, int.Parse (e.NewText.ToString ()),
+						smartLabel.Border.Padding.Bottom);
 				} catch {
 					if (!e.NewText.IsEmpty) {
 						e.Cancel = true;
 					}
 				}
 			};
-			paddingRightEdit.Text = $"{smartView.Border.Padding.Right}";
+			paddingRightEdit.Text = $"{smartLabel.Border.Padding.Right}";
 			Win.Add (paddingRightEdit);
 
 			var paddingBottomEdit = new TextField ("") {
@@ -175,8 +171,8 @@ namespace UICatalog.Scenarios {
 						smartPanel.Child.Border.Padding.Top, smartPanel.Child.Border.Padding.Right,
 						int.Parse (e.NewText.ToString ()));
 
-					smartView.Border.Padding = new Thickness (smartView.Border.Padding.Left,
-						smartView.Border.Padding.Top, smartView.Border.Padding.Right,
+					smartLabel.Border.Padding = new Thickness (smartLabel.Border.Padding.Left,
+						smartLabel.Border.Padding.Top, smartLabel.Border.Padding.Right,
 						int.Parse (e.NewText.ToString ()));
 				} catch {
 					if (!e.NewText.IsEmpty) {
@@ -184,16 +180,16 @@ namespace UICatalog.Scenarios {
 					}
 				}
 			};
-			paddingBottomEdit.Text = $"{smartView.Border.Padding.Bottom}";
+			paddingBottomEdit.Text = $"{smartLabel.Border.Padding.Bottom}";
 			Win.Add (paddingBottomEdit);
 
 			var replacePadding = new Button ("Replace all based on top") {
-				X = Pos.Center () - 35,
+				X = Pos.Left(paddingLeftEdit),
 				Y = 5
 			};
 			replacePadding.Clicked += () => {
 				smartPanel.Child.Border.Padding = new Thickness (smartPanel.Child.Border.Padding.Top);
-				smartView.Border.Padding = new Thickness (smartView.Border.Padding.Top);
+				smartLabel.Border.Padding = new Thickness (smartLabel.Border.Padding.Top);
 				if (paddingTopEdit.Text.IsEmpty) {
 					paddingTopEdit.Text = "0";
 				}
@@ -203,7 +199,7 @@ namespace UICatalog.Scenarios {
 
 			var cbUseUsePanelFrame = new CheckBox ("UsePanelFrame") {
 				X = Pos.X (replacePadding),
-				Y = Pos.Y (replacePadding) + 3,
+				Y = Pos.Y (replacePadding) + 1,
 				Checked = smartPanel.UsePanelFrame
 			};
 			cbUseUsePanelFrame.Toggled += (e) => smartPanel.UsePanelFrame = !e;
@@ -224,16 +220,16 @@ namespace UICatalog.Scenarios {
 						int.Parse (e.NewText.ToString ()), smartPanel.Child.Border.BorderThickness.Right,
 						smartPanel.Child.Border.BorderThickness.Bottom);
 
-					smartView.Border.BorderThickness = new Thickness (smartView.Border.BorderThickness.Left,
-						int.Parse (e.NewText.ToString ()), smartView.Border.BorderThickness.Right,
-						smartView.Border.BorderThickness.Bottom);
+					smartLabel.Border.BorderThickness = new Thickness (smartLabel.Border.BorderThickness.Left,
+						int.Parse (e.NewText.ToString ()), smartLabel.Border.BorderThickness.Right,
+						smartLabel.Border.BorderThickness.Bottom);
 				} catch {
 					if (!e.NewText.IsEmpty) {
 						e.Cancel = true;
 					}
 				}
 			};
-			borderTopEdit.Text = $"{smartView.Border.BorderThickness.Top}";
+			borderTopEdit.Text = $"{smartLabel.Border.BorderThickness.Top}";
 
 			Win.Add (borderTopEdit);
 
@@ -248,16 +244,16 @@ namespace UICatalog.Scenarios {
 						smartPanel.Child.Border.BorderThickness.Top, smartPanel.Child.Border.BorderThickness.Right,
 						smartPanel.Child.Border.BorderThickness.Bottom);
 
-					smartView.Border.BorderThickness = new Thickness (int.Parse (e.NewText.ToString ()),
-						smartView.Border.BorderThickness.Top, smartView.Border.BorderThickness.Right,
-						smartView.Border.BorderThickness.Bottom);
+					smartLabel.Border.BorderThickness = new Thickness (int.Parse (e.NewText.ToString ()),
+						smartLabel.Border.BorderThickness.Top, smartLabel.Border.BorderThickness.Right,
+						smartLabel.Border.BorderThickness.Bottom);
 				} catch {
 					if (!e.NewText.IsEmpty) {
 						e.Cancel = true;
 					}
 				}
 			};
-			borderLeftEdit.Text = $"{smartView.Border.BorderThickness.Left}";
+			borderLeftEdit.Text = $"{smartLabel.Border.BorderThickness.Left}";
 			Win.Add (borderLeftEdit);
 
 			var borderRightEdit = new TextField ("") {
@@ -271,16 +267,16 @@ namespace UICatalog.Scenarios {
 						smartPanel.Child.Border.BorderThickness.Top, int.Parse (e.NewText.ToString ()),
 						smartPanel.Child.Border.BorderThickness.Bottom);
 
-					smartView.Border.BorderThickness = new Thickness (smartView.Border.BorderThickness.Left,
-						smartView.Border.BorderThickness.Top, int.Parse (e.NewText.ToString ()),
-						smartView.Border.BorderThickness.Bottom);
+					smartLabel.Border.BorderThickness = new Thickness (smartLabel.Border.BorderThickness.Left,
+						smartLabel.Border.BorderThickness.Top, int.Parse (e.NewText.ToString ()),
+						smartLabel.Border.BorderThickness.Bottom);
 				} catch {
 					if (!e.NewText.IsEmpty) {
 						e.Cancel = true;
 					}
 				}
 			};
-			borderRightEdit.Text = $"{smartView.Border.BorderThickness.Right}";
+			borderRightEdit.Text = $"{smartLabel.Border.BorderThickness.Right}";
 			Win.Add (borderRightEdit);
 
 			var borderBottomEdit = new TextField ("") {
@@ -294,8 +290,8 @@ namespace UICatalog.Scenarios {
 						smartPanel.Child.Border.BorderThickness.Top, smartPanel.Child.Border.BorderThickness.Right,
 						int.Parse (e.NewText.ToString ()));
 
-					smartView.Border.BorderThickness = new Thickness (smartView.Border.BorderThickness.Left,
-						smartView.Border.BorderThickness.Top, smartView.Border.BorderThickness.Right,
+					smartLabel.Border.BorderThickness = new Thickness (smartLabel.Border.BorderThickness.Left,
+						smartLabel.Border.BorderThickness.Top, smartLabel.Border.BorderThickness.Right,
 						int.Parse (e.NewText.ToString ()));
 				} catch {
 					if (!e.NewText.IsEmpty) {
@@ -303,16 +299,16 @@ namespace UICatalog.Scenarios {
 					}
 				}
 			};
-			borderBottomEdit.Text = $"{smartView.Border.BorderThickness.Bottom}";
+			borderBottomEdit.Text = $"{smartLabel.Border.BorderThickness.Bottom}";
 			Win.Add (borderBottomEdit);
 
 			var replaceBorder = new Button ("Replace all based on top") {
-				X = Pos.Center () + 1,
+				X = Pos.Left(borderLeftEdit),
 				Y = 5
 			};
 			replaceBorder.Clicked += () => {
 				smartPanel.Child.Border.BorderThickness = new Thickness (smartPanel.Child.Border.BorderThickness.Top);
-				smartView.Border.BorderThickness = new Thickness (smartView.Border.BorderThickness.Top);
+				smartLabel.Border.BorderThickness = new Thickness (smartLabel.Border.BorderThickness.Top);
 				if (borderTopEdit.Text.IsEmpty) {
 					borderTopEdit.Text = "0";
 				}
@@ -328,11 +324,11 @@ namespace UICatalog.Scenarios {
 
 				X = 2,
 				Y = 1,
-				SelectedItem = (int)smartView.Border.BorderStyle
+				SelectedItem = (int)smartLabel.Border.BorderStyle
 			};
 			Win.Add (rbBorderStyle);
 
-			var cbDrawMarginFrame = new CheckBox ("Draw Margin Frame", smartView.Border.DrawMarginFrame) {
+			var cbDrawMarginFrame = new CheckBox ("Draw Margin Frame", smartLabel.Border.DrawMarginFrame) {
 				X = Pos.AnchorEnd (20),
 				Y = 0,
 				Width = 5
@@ -340,9 +336,9 @@ namespace UICatalog.Scenarios {
 			cbDrawMarginFrame.Toggled += (e) => {
 				try {
 					smartPanel.Child.Border.DrawMarginFrame = cbDrawMarginFrame.Checked;
-					smartView.Border.DrawMarginFrame = cbDrawMarginFrame.Checked;
-					if (cbDrawMarginFrame.Checked != smartView.Border.DrawMarginFrame) {
-						cbDrawMarginFrame.Checked = smartView.Border.DrawMarginFrame;
+					smartLabel.Border.DrawMarginFrame = cbDrawMarginFrame.Checked;
+					if (cbDrawMarginFrame.Checked != smartLabel.Border.DrawMarginFrame) {
+						cbDrawMarginFrame.Checked = smartLabel.Border.DrawMarginFrame;
 					}
 				} catch { }
 			};
@@ -350,14 +346,14 @@ namespace UICatalog.Scenarios {
 
 			rbBorderStyle.SelectedItemChanged += (e) => {
 				smartPanel.Child.Border.BorderStyle = (BorderStyle)e.SelectedItem;
-				smartView.Border.BorderStyle = (BorderStyle)e.SelectedItem;
-				smartView.SetNeedsDisplay ();
-				if (cbDrawMarginFrame.Checked != smartView.Border.DrawMarginFrame) {
-					cbDrawMarginFrame.Checked = smartView.Border.DrawMarginFrame;
+				smartLabel.Border.BorderStyle = (BorderStyle)e.SelectedItem;
+				smartLabel.SetNeedsDisplay ();
+				if (cbDrawMarginFrame.Checked != smartLabel.Border.DrawMarginFrame) {
+					cbDrawMarginFrame.Checked = smartLabel.Border.DrawMarginFrame;
 				}
 			};
 
-			var cbEffect3D = new CheckBox ("Draw 3D effects", smartView.Border.Effect3D) {
+			var cbEffect3D = new CheckBox ("Draw 3D effects", smartLabel.Border.Effect3D) {
 				X = Pos.AnchorEnd (20),
 				Y = 1,
 				Width = 5
@@ -383,15 +379,15 @@ namespace UICatalog.Scenarios {
 					smartPanel.Child.Border.Effect3DOffset = new Point (int.Parse (e.NewText.ToString ()),
 						smartPanel.Child.Border.Effect3DOffset.Y);
 
-					smartView.Border.Effect3DOffset = new Point (int.Parse (e.NewText.ToString ()),
-						smartView.Border.Effect3DOffset.Y);
+					smartLabel.Border.Effect3DOffset = new Point (int.Parse (e.NewText.ToString ()),
+						smartLabel.Border.Effect3DOffset.Y);
 				} catch {
 					if (!e.NewText.IsEmpty && e.NewText != CultureInfo.CurrentCulture.NumberFormat.NegativeSign) {
 						e.Cancel = true;
 					}
 				}
 			};
-			effect3DOffsetX.Text = $"{smartView.Border.Effect3DOffset.X}";
+			effect3DOffsetX.Text = $"{smartLabel.Border.Effect3DOffset.X}";
 			Win.Add (effect3DOffsetX);
 
 			Win.Add (new Label ("Y:") {
@@ -409,7 +405,7 @@ namespace UICatalog.Scenarios {
 					smartPanel.Child.Border.Effect3DOffset = new Point (smartPanel.Child.Border.Effect3DOffset.X,
 						int.Parse (e.NewText.ToString ()));
 
-					smartView.Border.Effect3DOffset = new Point (smartView.Border.Effect3DOffset.X,
+					smartLabel.Border.Effect3DOffset = new Point (smartLabel.Border.Effect3DOffset.X,
 						int.Parse (e.NewText.ToString ()));
 				} catch {
 					if (!e.NewText.IsEmpty && e.NewText != CultureInfo.CurrentCulture.NumberFormat.NegativeSign) {
@@ -417,12 +413,12 @@ namespace UICatalog.Scenarios {
 					}
 				}
 			};
-			effect3DOffsetY.Text = $"{smartView.Border.Effect3DOffset.Y}";
+			effect3DOffsetY.Text = $"{smartLabel.Border.Effect3DOffset.Y}";
 			Win.Add (effect3DOffsetY);
 
 			cbEffect3D.Toggled += (e) => {
 				try {
-					smartPanel.Child.Border.Effect3D = smartView.Border.Effect3D = effect3DOffsetX.Enabled =
+					smartPanel.Child.Border.Effect3D = smartLabel.Border.Effect3D = effect3DOffsetX.Enabled =
 						effect3DOffsetY.Enabled = cbEffect3D.Checked;
 				} catch { }
 			};
@@ -437,10 +433,10 @@ namespace UICatalog.Scenarios {
 
 				X = 2,
 				Y = 6,
-				SelectedItem = (int)smartView.Border.Background
+				SelectedItem = (int)smartLabel.Border.Background
 			};
 			rbBackground.SelectedItemChanged += (e) => {
-				smartPanel.Child.Border.Background = smartView.Border.Background = (Color)e.SelectedItem;
+				smartPanel.Child.Border.Background = smartLabel.Border.Background = (Color)e.SelectedItem;
 			};
 			Win.Add (rbBackground);
 
@@ -454,17 +450,21 @@ namespace UICatalog.Scenarios {
 
 				X = Pos.AnchorEnd (18),
 				Y = 6,
-				SelectedItem = (int)smartView.Border.BorderBrush
+				SelectedItem = (int)smartLabel.Border.BorderBrush
 			};
 			rbBorderBrush.SelectedItemChanged += (e) => {
-				smartPanel.Child.Border.BorderBrush = smartView.Border.BorderBrush = (Color)e.SelectedItem;
+				smartPanel.Child.Border.BorderBrush = smartLabel.Border.BorderBrush = (Color)e.SelectedItem;
 			};
 			Win.Add (rbBorderBrush);
 
+			smartPanel.X = Pos.Left (paddingLeftEdit);
+			smartPanel.Y = Pos.Top (smartLabel);
 			Win.Add (smartPanel);
-			Win.Add (smartView);
-
+			smartLabel.X = Pos.Left (borderLeftEdit);
+			smartLabel.Y = Pos.Bottom (cbUseUsePanelFrame) + 5;
+			Win.Add (smartLabel);
 			Win.BringSubviewToFront (smartPanel);
+
 		}
 	}
 }

+ 5 - 3
UICatalog/Scenarios/BordersOnFrameView.cs

@@ -20,7 +20,7 @@ namespace UICatalog.Scenarios {
 
 			var smartView = new FrameView () {
 				X = Pos.Center (),
-				Y = Pos.Center () - 7,
+				Y = 0, // Y is set below 
 				Width = 40,
 				Height = 20,
 				Border = new Border () {
@@ -142,7 +142,7 @@ namespace UICatalog.Scenarios {
 			Win.Add (paddingBottomEdit);
 
 			var replacePadding = new Button ("Replace all based on top") {
-				X = Pos.Center () - 35,
+				X = Pos.Left (paddingLeftEdit),
 				Y = 5
 			};
 			replacePadding.Clicked += () => {
@@ -236,7 +236,7 @@ namespace UICatalog.Scenarios {
 			Win.Add (borderBottomEdit);
 
 			var replaceBorder = new Button ("Replace all based on top") {
-				X = Pos.Center () + 1,
+				X = Pos.Left (borderLeftEdit),
 				Y = 5
 			};
 			replaceBorder.Clicked += () => {
@@ -248,6 +248,8 @@ namespace UICatalog.Scenarios {
 			};
 			Win.Add (replaceBorder);
 
+			smartView.Y = Pos.Bottom (replaceBorder) + 1;
+
 			Win.Add (new Label ("BorderStyle:"));
 
 			var borderStyleEnum = Enum.GetValues (typeof (BorderStyle)).Cast<BorderStyle> ().ToList ();

+ 5 - 3
UICatalog/Scenarios/BordersOnToplevel.cs

@@ -20,7 +20,7 @@ namespace UICatalog.Scenarios {
 
 			var smartView = new Border.ToplevelContainer () {
 				X = Pos.Center (),
-				Y = Pos.Center () - 7,
+				Y = 0, // Y is set below 
 				Width = 40,
 				Height = 20,
 				Border = new Border () {
@@ -142,7 +142,7 @@ namespace UICatalog.Scenarios {
 			Win.Add (paddingBottomEdit);
 
 			var replacePadding = new Button ("Replace all based on top") {
-				X = Pos.Center () - 35,
+				X = Pos.Left(paddingLeftEdit),
 				Y = 5
 			};
 			replacePadding.Clicked += () => {
@@ -236,7 +236,7 @@ namespace UICatalog.Scenarios {
 			Win.Add (borderBottomEdit);
 
 			var replaceBorder = new Button ("Replace all based on top") {
-				X = Pos.Center () + 1,
+				X = Pos.Left(borderLeftEdit),
 				Y = 5
 			};
 			replaceBorder.Clicked += () => {
@@ -248,6 +248,8 @@ namespace UICatalog.Scenarios {
 			};
 			Win.Add (replaceBorder);
 
+			smartView.Y = Pos.Bottom (replaceBorder) + 1;
+
 			Win.Add (new Label ("BorderStyle:"));
 
 			var borderStyleEnum = Enum.GetValues (typeof (BorderStyle)).Cast<BorderStyle> ().ToList ();

+ 4 - 3
UICatalog/Scenarios/BordersOnWindow.cs

@@ -20,7 +20,6 @@ namespace UICatalog.Scenarios {
 
 			var smartView = new Window () {
 				X = Pos.Center (),
-				Y = Pos.Center () - 7,
 				Width = 40,
 				Height = 20,
 				Border = new Border () {
@@ -142,7 +141,7 @@ namespace UICatalog.Scenarios {
 			Win.Add (paddingBottomEdit);
 
 			var replacePadding = new Button ("Replace all based on top") {
-				X = Pos.Center () - 35,
+				X = Pos.Left (paddingLeftEdit),
 				Y = 5
 			};
 			replacePadding.Clicked += () => {
@@ -236,7 +235,7 @@ namespace UICatalog.Scenarios {
 			Win.Add (borderBottomEdit);
 
 			var replaceBorder = new Button ("Replace all based on top") {
-				X = Pos.Center () + 1,
+				X = Pos.Left (borderLeftEdit),
 				Y = 5
 			};
 			replaceBorder.Clicked += () => {
@@ -250,6 +249,8 @@ namespace UICatalog.Scenarios {
 
 			Win.Add (new Label ("BorderStyle:"));
 
+			smartView.Y = Pos.Bottom (replaceBorder) + 1;
+
 			var borderStyleEnum = Enum.GetValues (typeof (BorderStyle)).Cast<BorderStyle> ().ToList ();
 			var rbBorderStyle = new RadioGroup (borderStyleEnum.Select (
 				e => NStack.ustring.Make (e.ToString ())).ToArray ()) {

+ 30 - 4
UICatalog/Scenarios/Generic.cs

@@ -22,13 +22,39 @@ namespace UICatalog.Scenarios {
 
 		public override void Setup ()
 		{
-			// Put your scenario code here, e.g.
-			var button = new Button ("Press me!") {
+			// Put scenario code here (in a real app, this would be the code
+			// that would setup the app before `Application.Run` is called`).
+			// With a Scenario, after UI Catalog calls `Scenario.Setup` it calls
+			// `Scenario.Run` which calls `Application.Run`.
+			// Example:
+			//var button = new Button ("Press me!") {
+			//	AutoSize = false,
+			//	X = Pos.Center (),
+			//	Y = Pos.Center (),
+			//};
+			//button.Clicked += () => MessageBox.Query (20, 7, "Hi", "Neat?", "Yes", "No");
+			//Win.Add (button);
+
+			Win.Visible = false;
+
+			var label = new Label () {
 				X = Pos.Center (),
 				Y = Pos.Center (),
+				Border = new Border () {
+					BorderStyle = BorderStyle.Single,
+					Padding = new Thickness (2),
+					BorderThickness = new Thickness (2),
+					BorderBrush = Color.Red,
+					Background = Color.BrightGreen,
+					Effect3D = true,
+					Effect3DOffset = new Point (2, -3)
+				},
+				ColorScheme = Colors.TopLevel,
+				Text = "This is a test"
 			};
-			button.Clicked += () => MessageBox.Query (20, 7, "Hi", "Neat?", "Yes", "No");
-			Win.Add (button);
+			label.Border.Child = label;
+			Application.Top.Add (label);
+
 		}
 	}
 }

+ 2 - 2
UnitTests/Core/ViewTests.cs

@@ -1265,8 +1265,8 @@ namespace Terminal.Gui.CoreTests {
 			view.Y = Pos.Center () - 13;
 			view.SetRelativeLayout (top.Bounds);
 			view.ViewToScreen (0, 0, out rcol, out rrow);
-			Assert.Equal (-1, rcol);
-			Assert.Equal (-1, rrow);
+			Assert.Equal (-41, rcol);
+			Assert.Equal (-13, rrow);
 		}
 
 		[Fact]

+ 30 - 30
UnitTests/Types/PosTests.cs

@@ -411,140 +411,140 @@ namespace Terminal.Gui.TypeTests {
 			testInt = 0;
 			testRect = Rect.Empty;
 			pos = Pos.Left (new View ());
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			pos = Pos.Left (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testRect = new Rect (1, 2, 3, 4);
 			pos = Pos.Left (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.Left(win) + 0
 			pos = Pos.Left (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = 1;
 			// Pos.Left(win) +1
 			pos = Pos.Left (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = -1;
 			// Pos.Left(win) -1
 			pos = Pos.Left (new View (testRect)) - testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.X
 			side = "x";
 			testInt = 0;
 			testRect = Rect.Empty;
 			pos = Pos.X (new View ());
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			pos = Pos.X (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testRect = new Rect (1, 2, 3, 4);
 			pos = Pos.X (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.X(win) + 0
 			pos = Pos.X (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = 1;
 			// Pos.X(win) +1
 			pos = Pos.X (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = -1;
 			// Pos.X(win) -1
 			pos = Pos.X (new View (testRect)) - testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.Top
 			side = "y";
 			testInt = 0;
 			testRect = Rect.Empty;
 			pos = Pos.Top (new View ());
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			pos = Pos.Top (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testRect = new Rect (1, 2, 3, 4);
 			pos = Pos.Top (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.Top(win) + 0
 			pos = Pos.Top (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = 1;
 			// Pos.Top(win) +1
 			pos = Pos.Top (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = -1;
 			// Pos.Top(win) -1
 			pos = Pos.Top (new View (testRect)) - testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.Y
 			side = "y";
 			testInt = 0;
 			testRect = Rect.Empty;
 			pos = Pos.Y (new View ());
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			pos = Pos.Y (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testRect = new Rect (1, 2, 3, 4);
 			pos = Pos.Y (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.Y(win) + 0
 			pos = Pos.Y (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = 1;
 			// Pos.Y(win) +1
 			pos = Pos.Y (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = -1;
 			// Pos.Y(win) -1
 			pos = Pos.Y (new View (testRect)) - testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.Bottom
 			side = "bottom";
 			testRect = Rect.Empty;
 			testInt = 0;
 			pos = Pos.Bottom (new View ());
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			pos = Pos.Bottom (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testRect = new Rect (1, 2, 3, 4);
 			pos = Pos.Bottom (new View (testRect));
-			Assert.Equal ($"Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}})){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			// Pos.Bottom(win) + 0
 			pos = Pos.Bottom (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = 1;
 			// Pos.Bottom(win) +1
 			pos = Pos.Bottom (new View (testRect)) + testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 
 			testInt = -1;
 			// Pos.Bottom(win) -1
 			pos = Pos.Bottom (new View (testRect)) - testInt;
-			Assert.Equal ($"Combine(Pos.Combine(Pos.View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Pos.Absolute(0)){(testInt < 0 ? '-' : '+')}Pos.Absolute({testInt}))", pos.ToString ());
+			Assert.Equal ($"Combine(Combine(View({side},View()({{X={testRect.X},Y={testRect.Y},Width={testRect.Width},Height={testRect.Height}}}))+Absolute(0)){(testInt < 0 ? '-' : '+')}Absolute({testInt}))", pos.ToString ());
 		}
 
 		// See: https://github.com/gui-cs/Terminal.Gui/issues/504

+ 6 - 6
UnitTests/Views/TextViewTests.cs

@@ -1524,8 +1524,8 @@ namespace Terminal.Gui.ViewTests {
 			Assert.True (_textView.AllowsReturn);
 			Assert.Equal (4, _textView.TabWidth);
 			Assert.True (_textView.AllowsTab);
-			Assert.Equal ("Dim.Absolute(30)", _textView.Width.ToString ());
-			Assert.Equal ("Dim.Absolute(10)", _textView.Height.ToString ());
+			Assert.Equal ("Absolute(30)", _textView.Width.ToString ());
+			Assert.Equal ("Absolute(10)", _textView.Height.ToString ());
 			Assert.False (_textView.WordWrap);
 
 			_textView.WordWrap = true;
@@ -1535,8 +1535,8 @@ namespace Terminal.Gui.ViewTests {
 			Assert.False (_textView.AllowsReturn);
 			Assert.Equal (0, _textView.TabWidth);
 			Assert.False (_textView.AllowsTab);
-			Assert.Equal ("Dim.Absolute(30)", _textView.Width.ToString ());
-			Assert.Equal ("Dim.Absolute(1)", _textView.Height.ToString ());
+			Assert.Equal ("Absolute(30)", _textView.Width.ToString ());
+			Assert.Equal ("Absolute(1)", _textView.Height.ToString ());
 			Assert.False (_textView.WordWrap);
 
 			_textView.WordWrap = true;
@@ -1546,8 +1546,8 @@ namespace Terminal.Gui.ViewTests {
 			Assert.True (_textView.AllowsReturn);
 			Assert.Equal (4, _textView.TabWidth);
 			Assert.True (_textView.AllowsTab);
-			Assert.Equal ("Dim.Absolute(30)", _textView.Width.ToString ());
-			Assert.Equal ("Dim.Absolute(10)", _textView.Height.ToString ());
+			Assert.Equal ("Absolute(30)", _textView.Width.ToString ());
+			Assert.Equal ("Absolute(10)", _textView.Height.ToString ());
 			Assert.False (_textView.WordWrap);
 		}