WIP - currently broken after merge

This commit is contained in:
Tig Kindel
2023-02-25 11:41:28 -07:00
parent d7b1192ca5
commit 5826321b89
7 changed files with 529 additions and 463 deletions

View File

@@ -333,9 +333,10 @@ namespace Unix.Terminal {
static public int set_escdelay (int size) => methods.set_escdelay (size);
}
#pragma warning disable RCS1102 // Make class static.
#pragma warning disable RCS1102 // Make class static.'
internal class Delegates {
#pragma warning restore RCS1102 // Make class static.
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
public delegate IntPtr initscr ();
public delegate int endwin ();
public delegate bool isendwin ();
@@ -560,4 +561,6 @@ namespace Unix.Terminal {
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
}

View File

@@ -207,6 +207,7 @@ namespace Terminal.Gui {
/// </summary>
public static Thickness Empty => new Thickness (0);
/// <inheritdoc/>
public override bool Equals (object obj)
{
//Check for null and compare run-time types.
@@ -225,6 +226,7 @@ namespace Terminal.Gui {
}
// IEquitable
/// <inheritdoc/>
public bool Equals (Thickness other)
{
return other is not null &&
@@ -233,7 +235,8 @@ namespace Terminal.Gui {
Top == other.Top &&
Bottom == other.Bottom;
}
/// <inheritdoc/>
public override int GetHashCode ()
{
int hashCode = 1380952125;
@@ -244,11 +247,13 @@ namespace Terminal.Gui {
return hashCode;
}
/// <inheritdoc/>
public static bool operator == (Thickness left, Thickness right)
{
return EqualityComparer<Thickness>.Default.Equals (left, right);
}
/// <inheritdoc/>
public static bool operator != (Thickness left, Thickness right)
{
return !(left == right);
@@ -495,7 +500,6 @@ namespace Terminal.Gui {
//}
/// <summary>
/// Invoked when any property of Border changes (except <see cref="Child"/>).
/// </summary>
public event Action<Border> BorderChanged;
@@ -527,7 +531,6 @@ namespace Terminal.Gui {
}
/// <summary>
/// Gets or sets if a margin frame is drawn around the <see cref="Child"/> regardless the <see cref="BorderStyle"/>
/// </summary>
[JsonInclude]
public bool DrawMarginFrame {
@@ -545,7 +548,6 @@ namespace Terminal.Gui {
}
/// <summary>
/// Gets or sets the relative <see cref="Thickness"/> of a <see cref="Border"/>.
/// </summary>
[JsonInclude]
public Thickness BorderThickness {

View File

@@ -7,10 +7,14 @@ using Terminal.Gui.Graphs;
namespace Terminal.Gui {
/// <summary>
/// Frames are a special form of <see cref="View"/> that act as adornments; they appear outside of the <see cref="View.Bounds"/>
/// eanbling borders, menus, etc...
/// </summary>
public class Frame : View {
/// <summary>
/// Frames are a special form of <see cref="View"/> that act as adornments; they appear outside of the <see cref="View>Bounds"/>
/// Frames are a special form of <see cref="View"/> that act as adornments; they appear outside of the <see cref="View.Bounds"/>
/// eanbling borders, menus, etc...
/// </summary>
public Frame ()
@@ -52,6 +56,10 @@ namespace Terminal.Gui {
}
/// <summary>
///
/// </summary>
/// <param name="clipRect"></param>
public virtual void OnDrawSubViews (Rect clipRect)
{
// if (Subviews == null) {
@@ -74,7 +82,8 @@ namespace Terminal.Gui {
// }
}
/// <inheritdoc/>
public override void OnDrawContent (Rect viewport)
{
if (!ustring.IsNullOrEmpty (TextFormatter.Text)) {
@@ -133,8 +142,14 @@ namespace Terminal.Gui {
// TODO: v2 = This is teporary; need to also enable (or not) simple way of setting
// other border properties
// TOOD: v2 - Missing 3D effect
/// <summary>
///
/// </summary>
public BorderStyle BorderStyle { get; set; } = BorderStyle.None;
/// <summary>
///
/// </summary>
public Thickness Thickness { get; set; }
// TODO: v2 - This is confusing. It is a read-only property and actually only returns a size, so
@@ -143,10 +158,10 @@ namespace Terminal.Gui {
/// <summary>
/// Gets the rectangle that describes the inner area of the frame. The Location is always 0, 0.
/// </summary>
public Rect Bounds {
public override Rect Bounds {
get {
if (Thickness != null) {
new Rect (Point.Empty, Frame.Size);
if (Thickness == null) {
return new Rect (Point.Empty, Frame.Size);
}
// Return the frame-relative bounds
return Thickness.GetInnerRect (new Rect (Point.Empty, Frame.Size));

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using NStack;
@@ -454,15 +455,62 @@ namespace Terminal.Gui {
}
}
///// <summary>
///// Gets an enumerator that enumerates the subviews in this view.
///// </summary>
///// <returns>The enumerator.</returns>
//public IEnumerator GetEnumerator ()
//{
// foreach (var v in InternalSubviews)
// yield return v;
//}
public Frame Margin { get; set; }
public Frame BorderFrame { get; set; }
public Frame Padding { get; set; }
/// <summary>
/// Temporary API to support the new v2 API
/// </summary>
public void EnableFrames ()
{
IgnoreBorderPropertyOnRedraw = true;
Margin?.Dispose ();
Margin = new Frame () {
X = 0,
Y = 0,
Thickness = new Thickness (0),
ColorScheme = SuperView?.ColorScheme ?? ColorScheme,
// TODO: Create View.AddAdornment
Parent = this
};
//Margin.DiagnosticsLabel.Text = "Margin";
BorderFrame?.Dispose ();
BorderFrame = new Frame () {
X = 0,
Y = 0,
BorderStyle = BorderStyle.Single,
Thickness = new Thickness (0),
ColorScheme = ColorScheme,
// TODO: Create View.AddAdornment
Parent = this
};
Padding?.Dispose ();
Padding = new Frame () {
X = 0,
Y = 0,
Thickness = new Thickness (0),
ColorScheme = ColorScheme,
// TODO: Create View.AddAdornment
Parent = this
};
}
ustring title;
/// <summary>
/// The title to be displayed for this <see cref="View2"/>.
/// </summary>
/// <value>The title.</value>
public ustring Title {
get => title;
set {
title = value;
SetNeedsDisplay ();
}
}
LayoutStyle layoutStyle;
@@ -498,7 +546,7 @@ namespace Terminal.Gui {
/// control for tasks such as drawing on the surface of the control.
/// </para>
/// </remarks>
public Rect Bounds {
public virtual Rect Bounds {
get => new Rect (Point.Empty, Frame.Size);
set => Frame = new Rect (frame.Location, value.Size);
}
@@ -670,7 +718,14 @@ namespace Terminal.Gui {
/// Returns the container for this view, or null if this view has not been added to a container.
/// </summary>
/// <value>The super view.</value>
public View SuperView => container;
public virtual View SuperView {
get {
return container;
}
set {
throw new NotImplementedException ();
}
}
/// <summary>
/// Initializes a new instance of a <see cref="Terminal.Gui.LayoutStyle.Absolute"/> <see cref="View"/> class with the absolute
@@ -773,9 +828,6 @@ namespace Terminal.Gui {
TextFormatter.HotKeyChanged += TextFormatter_HotKeyChanged;
TextDirection = direction;
Border = border;
if (Border != null) {
Border.Child = this;
}
shortcutHelper = new ShortcutHelper ();
CanFocus = false;
TabIndex = -1;
@@ -1150,16 +1202,16 @@ namespace Terminal.Gui {
/// <param name="rcol">Absolute column; screen-relative.</param>
/// <param name="rrow">Absolute row; screen-relative.</param>
/// <param name="clipped">Whether to clip the result of the ViewToScreen method, if set to <see langword="true"/>, the rcol, rrow values are clamped to the screen (terminal) dimensions (0..TerminalDim-1).</param>
public void ViewToScreen (int col, int row, out int rcol, out int rrow, bool clipped = true)
public virtual void ViewToScreen (int col, int row, out int rcol, out int rrow, bool clipped = true)
{
// Computes the real row, col relative to the screen.
rrow = row + frame.Y;
rcol = col + frame.X;
rrow = row + Frame.Y;
rcol = col + Frame.X;
var curContainer = container;
while (curContainer != null) {
rrow += curContainer.frame.Y;
rcol += curContainer.frame.X;
rrow += curContainer.Frame.Y;
rcol += curContainer.Frame.X;
curContainer = curContainer.container;
}
@@ -1588,7 +1640,7 @@ namespace Terminal.Gui {
return rect;
}
Rect GetContainerBounds ()
internal Rect GetContainerBounds ()
{
var containerBounds = SuperView == null ? default : SuperView.ViewToScreen (SuperView.Bounds);
var driverClip = Driver == null ? Rect.Empty : Driver.Clip;
@@ -2703,11 +2755,6 @@ namespace Terminal.Gui {
}
/// <summary>
/// Get or sets whether the view will use <see cref="Terminal.Gui.Border"/> (if <see cref="Border"/> is set) to draw
/// a border. If <see langword="false"/> (the default),
/// <see cref="View.Redraw(Rect)"/> will call <see cref="Border.DrawContent(View, bool)"/>
/// to draw the view's border. If <see langword="true"/> no border is drawn (and the view is expected to draw the border
/// itself).
/// </summary>
public virtual bool IgnoreBorderPropertyOnRedraw { get; set; }
@@ -2842,8 +2889,9 @@ namespace Terminal.Gui {
/// <returns>The text formatter size more the <see cref="Terminal.Gui.TextFormatter.HotKeySpecifier"/> length.</returns>
public Size GetBoundsTextFormatterSize ()
{
if (ustring.IsNullOrEmpty (TextFormatter.Text))
if (ustring.IsNullOrEmpty (TextFormatter.Text)) {
return Bounds.Size;
}
return new Size (frame.Size.Width + GetHotKeySpecifierLength (),
frame.Size.Height + GetHotKeySpecifierLength (false));

View File

@@ -17,8 +17,9 @@ using Terminal.Gui.Configuration;
using static Terminal.Gui.Configuration.ConfigurationManager;
namespace Terminal.Gui {
/// <summary>
/// A <see cref="Toplevel"/> <see cref="View"/> that draws a border around its <see cref="View.Frame"/> with a <see cref="Title"/> at the top.
/// A <see cref="Toplevel"/> <see cref="View"/> that draws a border around its <see cref="View.Frame"/> with a Title at the top.
/// </summary>
/// <remarks>
/// The 'client area' of a <see cref="Window"/> is a rectangle deflated by one or more rows/columns from <see cref="View.Bounds"/>. A this time there is no

View File

@@ -32,10 +32,7 @@ namespace UICatalog.Scenarios {
X = Pos.Center (),
Y = Pos.Center (),
};
Win.Add (horizontalView, verticalView);
verticalView.Text = $"最初の行{Environment.NewLine}二行目";
//Application.Top.Redraw (Application.Top.Bounds);
Win.Add (button);
}
}
}

View File

@@ -40,505 +40,505 @@ namespace Terminal.Gui.CoreTests {
Assert.False (b.DrawMarginFrame);
}
[Fact]
[AutoInitShutdown]
public void ActualWidth_ActualHeight ()
{
var v = new View (new Rect (5, 10, 60, 20), "", new Border ());
//[Fact]
//[AutoInitShutdown]
//public void ActualWidth_ActualHeight ()
//{
// var v = new View (new Rect (5, 10, 60, 20), "", new Border ());
Assert.Equal (60, v.Border.ActualWidth);
Assert.Equal (20, v.Border.ActualHeight);
}
// Assert.Equal (60, v.Border.ActualWidth);
// Assert.Equal (20, v.Border.ActualHeight);
//}
[Fact]
public void ToplevelContainer_LayoutStyle_Computed_Constuctor_ ()
{
var tc = new Border.ToplevelContainer (new Border ());
//[Fact]
//public void ToplevelContainer_LayoutStyle_Computed_Constuctor_ ()
//{
// var tc = new Border.ToplevelContainer (new Border ());
Assert.Equal (LayoutStyle.Computed, tc.LayoutStyle);
}
// Assert.Equal (LayoutStyle.Computed, tc.LayoutStyle);
//}
[Fact]
public void ToplevelContainer_LayoutStyle_Absolute_Constuctor_ ()
{
var tc = new Border.ToplevelContainer (new Rect (1, 2, 3, 4), new Border ());
//[Fact]
//public void ToplevelContainer_LayoutStyle_Absolute_Constuctor_ ()
//{
// var tc = new Border.ToplevelContainer (new Rect (1, 2, 3, 4), new Border ());
Assert.Equal (LayoutStyle.Absolute, tc.LayoutStyle);
}
// Assert.Equal (LayoutStyle.Absolute, tc.LayoutStyle);
//}
[Fact]
public void GetSumThickness_Test ()
{
var b = new Border () {
BorderThickness = new Thickness (1, 2, 3, 4),
Padding = new Thickness (4, 3, 2, 1)
};
Assert.Equal (new Thickness (5, 5, 5, 5), b.GetSumThickness ());
}
//[Fact]
//public void GetSumThickness_Test ()
//{
// var b = new Border () {
// BorderThickness = new Thickness (1, 2, 3, 4),
// Padding = new Thickness (4, 3, 2, 1)
// };
// Assert.Equal (new Thickness (5, 5, 5, 5), b.GetSumThickness ());
//}
[Fact]
[AutoInitShutdown]
public void DrawContent_With_Child_Border ()
{
var top = Application.Top;
var driver = (FakeDriver)Application.Driver;
//[Fact]
//[AutoInitShutdown]
//public void DrawContent_With_Child_Border ()
//{
// var top = Application.Top;
// var driver = (FakeDriver)Application.Driver;
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"
};
label.Border.Child = label;
top.Add (label);
// 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"
// };
// label.Border.Child = label;
// top.Add (label);
top.LayoutSubviews ();
label.Redraw (label.Bounds);
// top.LayoutSubviews ();
// label.Redraw (label.Bounds);
var frame = label.Frame;
var drawMarginFrame = label.Border.DrawMarginFrame ? 1 : 0;
var sumThickness = label.Border.GetSumThickness ();
var padding = label.Border.Padding;
var effect3DOffset = label.Border.Effect3DOffset;
var borderStyle = label.Border.BorderStyle;
// var frame = label.Frame;
// var drawMarginFrame = label.Border.DrawMarginFrame ? 1 : 0;
// var sumThickness = label.Border.GetSumThickness ();
// var padding = label.Border.Padding;
// var effect3DOffset = label.Border.Effect3DOffset;
// var borderStyle = label.Border.BorderStyle;
// Check the upper BorderThickness
for (int r = frame.Y - drawMarginFrame - sumThickness.Top;
r < frame.Y - drawMarginFrame - padding.Top; r++) {
for (int c = frame.X - drawMarginFrame - sumThickness.Left;
c < frame.Right + drawMarginFrame + sumThickness.Right; c++) {
// // Check the upper BorderThickness
// for (int r = frame.Y - drawMarginFrame - sumThickness.Top;
// r < frame.Y - drawMarginFrame - padding.Top; r++) {
// for (int c = frame.X - drawMarginFrame - sumThickness.Left;
// c < frame.Right + drawMarginFrame + sumThickness.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
// Check the left BorderThickness
for (int r = frame.Y - drawMarginFrame - padding.Top;
r < frame.Bottom + drawMarginFrame + padding.Bottom; r++) {
for (int c = frame.X - drawMarginFrame - sumThickness.Left;
c < frame.X - drawMarginFrame - padding.Left; c++) {
// // Check the left BorderThickness
// for (int r = frame.Y - drawMarginFrame - padding.Top;
// r < frame.Bottom + drawMarginFrame + padding.Bottom; r++) {
// for (int c = frame.X - drawMarginFrame - sumThickness.Left;
// c < frame.X - drawMarginFrame - padding.Left; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
// Check the right BorderThickness
for (int r = frame.Y - drawMarginFrame - padding.Top;
r < frame.Bottom + drawMarginFrame + padding.Bottom; r++) {
for (int c = frame.Right + drawMarginFrame + padding.Right;
c < frame.Right + drawMarginFrame - sumThickness.Right; c++) {
// // Check the right BorderThickness
// for (int r = frame.Y - drawMarginFrame - padding.Top;
// r < frame.Bottom + drawMarginFrame + padding.Bottom; r++) {
// for (int c = frame.Right + drawMarginFrame + padding.Right;
// c < frame.Right + drawMarginFrame - sumThickness.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
// Check the lower BorderThickness
for (int r = frame.Bottom + drawMarginFrame + padding.Bottom;
r < frame.Bottom + drawMarginFrame + sumThickness.Bottom; r++) {
for (int c = frame.X - drawMarginFrame - sumThickness.Left;
c < frame.Right + drawMarginFrame + sumThickness.Right; c++) {
// // Check the lower BorderThickness
// for (int r = frame.Bottom + drawMarginFrame + padding.Bottom;
// r < frame.Bottom + drawMarginFrame + sumThickness.Bottom; r++) {
// for (int c = frame.X - drawMarginFrame - sumThickness.Left;
// c < frame.Right + drawMarginFrame + sumThickness.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
// Check the upper Padding
for (int r = frame.Y - drawMarginFrame - padding.Top;
r < frame.Y - drawMarginFrame; r++) {
for (int c = frame.X - drawMarginFrame - padding.Left;
c < frame.Right + drawMarginFrame + padding.Right; c++) {
// // Check the upper Padding
// for (int r = frame.Y - drawMarginFrame - padding.Top;
// r < frame.Y - drawMarginFrame; r++) {
// for (int c = frame.X - drawMarginFrame - padding.Left;
// c < frame.Right + drawMarginFrame + padding.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.BrightGreen, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
// }
// Check the left Padding
for (int r = frame.Y - drawMarginFrame;
r < frame.Bottom + drawMarginFrame; r++) {
for (int c = frame.X - drawMarginFrame - padding.Left;
c < frame.X - drawMarginFrame; c++) {
// // Check the left Padding
// for (int r = frame.Y - drawMarginFrame;
// r < frame.Bottom + drawMarginFrame; r++) {
// for (int c = frame.X - drawMarginFrame - padding.Left;
// c < frame.X - drawMarginFrame; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.BrightGreen, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
// }
// Check the right Padding
for (int r = frame.Y - drawMarginFrame;
r < frame.Bottom + drawMarginFrame; r++) {
for (int c = frame.Right + drawMarginFrame;
c < frame.Right + drawMarginFrame - padding.Right; c++) {
// // Check the right Padding
// for (int r = frame.Y - drawMarginFrame;
// r < frame.Bottom + drawMarginFrame; r++) {
// for (int c = frame.Right + drawMarginFrame;
// c < frame.Right + drawMarginFrame - padding.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.BrightGreen, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
// }
// Check the lower Padding
for (int r = frame.Bottom + drawMarginFrame;
r < frame.Bottom + drawMarginFrame + padding.Bottom; r++) {
for (int c = frame.X - drawMarginFrame - padding.Left;
c < frame.Right + drawMarginFrame + padding.Right; c++) {
// // Check the lower Padding
// for (int r = frame.Bottom + drawMarginFrame;
// r < frame.Bottom + drawMarginFrame + padding.Bottom; r++) {
// for (int c = frame.X - drawMarginFrame - padding.Left;
// c < frame.Right + drawMarginFrame + padding.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.BrightGreen, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
// }
Rune hLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.HLine : (borderStyle == BorderStyle.Double ? driver.HDLine : ' ')) : ' ';
Rune vLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.VLine : (borderStyle == BorderStyle.Double ? driver.VDLine : ' ')) : ' ';
Rune uRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.URCorner : (borderStyle == BorderStyle.Double ? driver.URDCorner : ' ')) : ' ';
Rune uLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.ULCorner : (borderStyle == BorderStyle.Double ? driver.ULDCorner : ' ')) : ' ';
Rune lLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.LLCorner : (borderStyle == BorderStyle.Double ? driver.LLDCorner : ' ')) : ' ';
Rune lRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.LRCorner : (borderStyle == BorderStyle.Double ? driver.LRDCorner : ' ')) : ' ';
// Rune hLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.HLine : (borderStyle == BorderStyle.Double ? driver.HDLine : ' ')) : ' ';
// Rune vLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.VLine : (borderStyle == BorderStyle.Double ? driver.VDLine : ' ')) : ' ';
// Rune uRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.URCorner : (borderStyle == BorderStyle.Double ? driver.URDCorner : ' ')) : ' ';
// Rune uLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.ULCorner : (borderStyle == BorderStyle.Double ? driver.ULDCorner : ' ')) : ' ';
// Rune lLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.LLCorner : (borderStyle == BorderStyle.Double ? driver.LLDCorner : ' ')) : ' ';
// Rune lRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.LRCorner : (borderStyle == BorderStyle.Double ? driver.LRDCorner : ' ')) : ' ';
var text = "";
// Check the MarginFrame
for (int r = frame.Y - drawMarginFrame;
r < frame.Bottom + drawMarginFrame; r++) {
for (int c = frame.X - drawMarginFrame;
c <= frame.Right + drawMarginFrame - 1; c++) {
// var text = "";
// // Check the MarginFrame
// for (int r = frame.Y - drawMarginFrame;
// r < frame.Bottom + drawMarginFrame; r++) {
// for (int c = frame.X - drawMarginFrame;
// c <= frame.Right + drawMarginFrame - 1; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
var rune = (Rune)driver.Contents [r, c, 0];
Assert.Equal (Color.Black, color.Background);
if (c == frame.X - drawMarginFrame && r == frame.Y - drawMarginFrame) {
Assert.Equal (uLCorner, rune);
} else if (c == frame.Right && r == frame.Y - drawMarginFrame) {
Assert.Equal (uRCorner, rune);
} else if (c == frame.X - drawMarginFrame && r == frame.Bottom) {
Assert.Equal (lLCorner, rune);
} else if (c == frame.Right && r == frame.Bottom) {
Assert.Equal (lRCorner, rune);
} else if (c >= frame.X && (r == frame.Y - drawMarginFrame
|| r == frame.Bottom)) {
Assert.Equal (hLine, rune);
} else if ((c == frame.X - drawMarginFrame || c == frame.Right)
&& r >= frame.Y && r <= frame.Bottom - drawMarginFrame) {
Assert.Equal (vLine, rune);
} else {
text += rune.ToString ();
}
}
}
Assert.Equal ("This is a test", text.Trim ());
// var color = (Attribute)driver.Contents [r, c, 1];
// var rune = (Rune)driver.Contents [r, c, 0];
// Assert.Equal (Color.Black, color.Background);
// if (c == frame.X - drawMarginFrame && r == frame.Y - drawMarginFrame) {
// Assert.Equal (uLCorner, rune);
// } else if (c == frame.Right && r == frame.Y - drawMarginFrame) {
// Assert.Equal (uRCorner, rune);
// } else if (c == frame.X - drawMarginFrame && r == frame.Bottom) {
// Assert.Equal (lLCorner, rune);
// } else if (c == frame.Right && r == frame.Bottom) {
// Assert.Equal (lRCorner, rune);
// } else if (c >= frame.X && (r == frame.Y - drawMarginFrame
// || r == frame.Bottom)) {
// Assert.Equal (hLine, rune);
// } else if ((c == frame.X - drawMarginFrame || c == frame.Right)
// && r >= frame.Y && r <= frame.Bottom - drawMarginFrame) {
// Assert.Equal (vLine, rune);
// } else {
// text += rune.ToString ();
// }
// }
// }
// Assert.Equal ("This is a test", text.Trim ());
// Check the upper Effect3D
for (int r = frame.Y - drawMarginFrame - sumThickness.Top + effect3DOffset.Y;
r < frame.Y - drawMarginFrame - sumThickness.Top; r++) {
for (int c = frame.X - drawMarginFrame - sumThickness.Left + effect3DOffset.X;
c < frame.Right + drawMarginFrame + sumThickness.Right + effect3DOffset.X; c++) {
// // Check the upper Effect3D
// for (int r = frame.Y - drawMarginFrame - sumThickness.Top + effect3DOffset.Y;
// r < frame.Y - drawMarginFrame - sumThickness.Top; r++) {
// for (int c = frame.X - drawMarginFrame - sumThickness.Left + effect3DOffset.X;
// c < frame.Right + drawMarginFrame + sumThickness.Right + effect3DOffset.X; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.DarkGray, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
// }
// Check the left Effect3D
for (int r = frame.Y - drawMarginFrame - sumThickness.Top + effect3DOffset.Y;
r < frame.Bottom + drawMarginFrame + sumThickness.Bottom + effect3DOffset.Y; r++) {
for (int c = frame.X - drawMarginFrame - sumThickness.Left + effect3DOffset.X;
c < frame.X - drawMarginFrame - sumThickness.Left; c++) {
// // Check the left Effect3D
// for (int r = frame.Y - drawMarginFrame - sumThickness.Top + effect3DOffset.Y;
// r < frame.Bottom + drawMarginFrame + sumThickness.Bottom + effect3DOffset.Y; r++) {
// for (int c = frame.X - drawMarginFrame - sumThickness.Left + effect3DOffset.X;
// c < frame.X - drawMarginFrame - sumThickness.Left; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.DarkGray, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
// }
// Check the right Effect3D
for (int r = frame.Y - drawMarginFrame - sumThickness.Top + effect3DOffset.Y;
r < frame.Bottom + drawMarginFrame + sumThickness.Bottom + effect3DOffset.Y; r++) {
for (int c = frame.Right + drawMarginFrame + sumThickness.Right;
c < frame.Right + drawMarginFrame + sumThickness.Right + effect3DOffset.X; c++) {
// // Check the right Effect3D
// for (int r = frame.Y - drawMarginFrame - sumThickness.Top + effect3DOffset.Y;
// r < frame.Bottom + drawMarginFrame + sumThickness.Bottom + effect3DOffset.Y; r++) {
// for (int c = frame.Right + drawMarginFrame + sumThickness.Right;
// c < frame.Right + drawMarginFrame + sumThickness.Right + effect3DOffset.X; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.DarkGray, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
// }
// Check the lower Effect3D
for (int r = frame.Bottom + drawMarginFrame + sumThickness.Bottom;
r < frame.Bottom + drawMarginFrame + sumThickness.Bottom + effect3DOffset.Y; r++) {
for (int c = frame.X - drawMarginFrame - sumThickness.Left + effect3DOffset.X;
c < frame.Right + drawMarginFrame + sumThickness.Right + effect3DOffset.X; c++) {
// // Check the lower Effect3D
// for (int r = frame.Bottom + drawMarginFrame + sumThickness.Bottom;
// r < frame.Bottom + drawMarginFrame + sumThickness.Bottom + effect3DOffset.Y; r++) {
// for (int c = frame.X - drawMarginFrame - sumThickness.Left + effect3DOffset.X;
// c < frame.Right + drawMarginFrame + sumThickness.Right + effect3DOffset.X; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.DarkGray, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
// }
// Check the Child frame
for (int r = frame.Y; r < frame.Y + frame.Height; r++) {
for (int c = frame.X; c < frame.X + frame.Width; c++) {
// // Check the Child frame
// for (int r = frame.Y; r < frame.Y + frame.Height; r++) {
// for (int c = frame.X; c < frame.X + frame.Width; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.BrightGreen, color.Foreground);
Assert.Equal (Color.Black, color.Background);
}
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Foreground);
// Assert.Equal (Color.Black, color.Background);
// }
// }
//}
[Fact]
[AutoInitShutdown]
public void DrawContent_With_Parent_Border ()
{
var top = Application.Top;
var driver = (FakeDriver)Application.Driver;
//[Fact]
//[AutoInitShutdown]
//public void DrawContent_With_Parent_Border ()
//{
// var top = Application.Top;
// var driver = (FakeDriver)Application.Driver;
var frameView = new FrameView () {
X = Pos.Center (),
Y = Pos.Center (),
Width = 24,
Height = 13,
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)
}
};
frameView.Add (new Label () {
ColorScheme = Colors.TopLevel,
Text = "This is a test"
});
//frameView.Border.Child = frameView;
top.Add (frameView);
// var frameView = new FrameView () {
// X = Pos.Center (),
// Y = Pos.Center (),
// Width = 24,
// Height = 13,
// 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)
// }
// };
// frameView.Add (new Label () {
// ColorScheme = Colors.TopLevel,
// Text = "This is a test"
// });
// //frameView.Border.Child = frameView;
// top.Add (frameView);
top.LayoutSubviews ();
frameView.Redraw (frameView.Bounds);
// top.LayoutSubviews ();
// frameView.Redraw (frameView.Bounds);
var frame = frameView.Frame;
var drawMarginFrame = frameView.Border.DrawMarginFrame ? 1 : 0;
var borderThickness = frameView.Border.BorderThickness;
var padding = frameView.Border.Padding;
// var frame = frameView.Frame;
// var drawMarginFrame = frameView.Border.DrawMarginFrame ? 1 : 0;
// var borderThickness = frameView.Border.BorderThickness;
// var padding = frameView.Border.Padding;
var effect3DOffset = frameView.Border.Effect3DOffset;
var borderStyle = frameView.Border.BorderStyle;
// var effect3DOffset = frameView.Border.Effect3DOffset;
// var borderStyle = frameView.Border.BorderStyle;
// Check the upper BorderThickness
for (int r = frame.Y;
r < Math.Min (frame.Y + borderThickness.Top, frame.Bottom); r++) {
for (int c = frame.X;
c < frame.Right; c++) {
// // Check the upper BorderThickness
// for (int r = frame.Y;
// r < Math.Min (frame.Y + borderThickness.Top, frame.Bottom); r++) {
// for (int c = frame.X;
// c < frame.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
// Check the left BorderThickness
for (int r = Math.Min (frame.Y + borderThickness.Top, frame.Bottom);
r < frame.Bottom - borderThickness.Bottom; r++) {
for (int c = frame.X;
c < Math.Min (frame.X + borderThickness.Left, frame.Right); c++) {
// // Check the left BorderThickness
// for (int r = Math.Min (frame.Y + borderThickness.Top, frame.Bottom);
// r < frame.Bottom - borderThickness.Bottom; r++) {
// for (int c = frame.X;
// c < Math.Min (frame.X + borderThickness.Left, frame.Right); c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
// Check the right BorderThickness
for (int r = Math.Min (frame.Y + borderThickness.Top, frame.Bottom);
r < frame.Bottom - borderThickness.Bottom; r++) {
for (int c = Math.Max (frame.Right - borderThickness.Right, frame.X);
c < frame.Right; c++) {
// // Check the right BorderThickness
// for (int r = Math.Min (frame.Y + borderThickness.Top, frame.Bottom);
// r < frame.Bottom - borderThickness.Bottom; r++) {
// for (int c = Math.Max (frame.Right - borderThickness.Right, frame.X);
// c < frame.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
// Check the lower BorderThickness
for (int r = Math.Max (frame.Bottom - borderThickness.Bottom, frame.Y);
r < frame.Bottom; r++) {
for (int c = frame.X;
c < frame.Right; c++) {
// // Check the lower BorderThickness
// for (int r = Math.Max (frame.Bottom - borderThickness.Bottom, frame.Y);
// r < frame.Bottom; r++) {
// for (int c = frame.X;
// c < frame.Right; c++) {
var color = (Attribute)driver.Contents [r, c, 1];
Assert.Equal (Color.Red, color.Background);
}
}
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.Red, color.Background);
// }
// }
//TODO: Re-do padding tests
// //TODO: Re-do padding tests
//// Check the upper Padding
//for (int r = frame.Y + borderThickness.Top;
// r < Math.Min (frame.Y + sumThickness.Top, frame.Bottom - borderThickness.Bottom); r++) {
// for (int c = frame.X + borderThickness.Left;
// c < frame.Right - borderThickness.Right; c++) {
// //// Check the upper Padding
// //for (int r = frame.Y + borderThickness.Top;
// // r < Math.Min (frame.Y + sumThickness.Top, frame.Bottom - borderThickness.Bottom); r++) {
// // for (int c = frame.X + borderThickness.Left;
// // c < frame.Right - borderThickness.Right; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
//}
//// Check the left Padding
//for (int r = frame.Y + sumThickness.Top;
// r < frame.Bottom - sumThickness.Bottom; r++) {
// for (int c = frame.X + borderThickness.Left;
// c < Math.Min (frame.X + sumThickness.Left, frame.Right - borderThickness.Right); c++) {
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.BrightGreen, color.Background);
// // }
// //}
// //// Check the left Padding
// //for (int r = frame.Y + sumThickness.Top;
// // r < frame.Bottom - sumThickness.Bottom; r++) {
// // for (int c = frame.X + borderThickness.Left;
// // c < Math.Min (frame.X + sumThickness.Left, frame.Right - borderThickness.Right); c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
//}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.BrightGreen, color.Background);
// // }
// //}
//// Check the right Padding
//// Draw the right Padding
//for (int r = frame.Y + sumThickness.Top;
// r < frame.Bottom - sumThickness.Bottom; 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++) {
// //// Check the right Padding
// //// Draw the right Padding
// //for (int r = frame.Y + sumThickness.Top;
// // r < frame.Bottom - sumThickness.Bottom; 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++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
//}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.BrightGreen, color.Background);
// // }
// //}
//// Check the lower Padding
//for (int r = Math.Max (frame.Bottom - sumThickness.Bottom, frame.Y + borderThickness.Top);
// r < frame.Bottom - borderThickness.Bottom; r++) {
// for (int c = frame.X + borderThickness.Left;
// c < frame.Right - borderThickness.Right; c++) {
// //// Check the lower Padding
// //for (int r = Math.Max (frame.Bottom - sumThickness.Bottom, frame.Y + borderThickness.Top);
// // r < frame.Bottom - borderThickness.Bottom; r++) {
// // for (int c = frame.X + borderThickness.Left;
// // c < frame.Right - borderThickness.Right; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Background);
// }
//}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.BrightGreen, color.Background);
// // }
// //}
Rune hLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.HLine : (borderStyle == BorderStyle.Double ? driver.HDLine : ' ')) : ' ';
Rune vLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.VLine : (borderStyle == BorderStyle.Double ? driver.VDLine : ' ')) : ' ';
Rune uRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.URCorner : (borderStyle == BorderStyle.Double ? driver.URDCorner : ' ')) : ' ';
Rune uLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.ULCorner : (borderStyle == BorderStyle.Double ? driver.ULDCorner : ' ')) : ' ';
Rune lLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.LLCorner : (borderStyle == BorderStyle.Double ? driver.LLDCorner : ' ')) : ' ';
Rune lRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
? driver.LRCorner : (borderStyle == BorderStyle.Double ? driver.LRDCorner : ' ')) : ' ';
// Rune hLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.HLine : (borderStyle == BorderStyle.Double ? driver.HDLine : ' ')) : ' ';
// Rune vLine = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.VLine : (borderStyle == BorderStyle.Double ? driver.VDLine : ' ')) : ' ';
// Rune uRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.URCorner : (borderStyle == BorderStyle.Double ? driver.URDCorner : ' ')) : ' ';
// Rune uLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.ULCorner : (borderStyle == BorderStyle.Double ? driver.ULDCorner : ' ')) : ' ';
// Rune lLCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.LLCorner : (borderStyle == BorderStyle.Double ? driver.LLDCorner : ' ')) : ' ';
// Rune lRCorner = drawMarginFrame > 0 ? (borderStyle == BorderStyle.Single
// ? driver.LRCorner : (borderStyle == BorderStyle.Double ? driver.LRDCorner : ' ')) : ' ';
// TODO: redo margin tests
// // TODO: redo margin tests
//var text = "";
//// Check the MarginFrame
//for (int r = frame.Y + sumThickness.Top;
// r < frame.Bottom - sumThickness.Bottom; r++) {
// for (int c = frame.X + sumThickness.Left;
// c <= frame.Right - sumThickness.Right - 1; c++) {
// //var text = "";
// //// Check the MarginFrame
// //for (int r = frame.Y + sumThickness.Top;
// // r < frame.Bottom - sumThickness.Bottom; r++) {
// // for (int c = frame.X + sumThickness.Left;
// // c <= frame.Right - sumThickness.Right - 1; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// var rune = (Rune)driver.Contents [r, c, 0];
// Assert.Equal (Color.Black, color.Background);
// if (c == frame.X + sumThickness.Left && r == frame.Y + sumThickness.Top) {
// Assert.Equal (uLCorner, rune);
// } else if (c == frame.Right - drawMarginFrame - sumThickness.Right
// && r == frame.Y + sumThickness.Top) {
// Assert.Equal (uRCorner, rune);
// } else if (c == frame.X + sumThickness.Left
// && r == frame.Bottom - drawMarginFrame - sumThickness.Bottom) {
// Assert.Equal (lLCorner, rune);
// } else if (c == frame.Right - drawMarginFrame - sumThickness.Right
// && r == frame.Bottom - drawMarginFrame - sumThickness.Bottom) {
// Assert.Equal (lRCorner, rune);
// } else if (c > frame.X + sumThickness.Left
// && (r == frame.Y + sumThickness.Top
// || r == frame.Bottom - drawMarginFrame - sumThickness.Bottom)) {
// Assert.Equal (hLine, rune);
// } else if ((c == frame.X + sumThickness.Left
// || c == frame.Right - drawMarginFrame - sumThickness.Right)
// && r >= frame.Y + drawMarginFrame + sumThickness.Top) {
// Assert.Equal (vLine, rune);
// } else {
// text += rune.ToString ();
// }
// }
//}
//Assert.Equal ("This is a test", text.Trim ());
// // var color = (Attribute)driver.Contents [r, c, 1];
// // var rune = (Rune)driver.Contents [r, c, 0];
// // Assert.Equal (Color.Black, color.Background);
// // if (c == frame.X + sumThickness.Left && r == frame.Y + sumThickness.Top) {
// // Assert.Equal (uLCorner, rune);
// // } else if (c == frame.Right - drawMarginFrame - sumThickness.Right
// // && r == frame.Y + sumThickness.Top) {
// // Assert.Equal (uRCorner, rune);
// // } else if (c == frame.X + sumThickness.Left
// // && r == frame.Bottom - drawMarginFrame - sumThickness.Bottom) {
// // Assert.Equal (lLCorner, rune);
// // } else if (c == frame.Right - drawMarginFrame - sumThickness.Right
// // && r == frame.Bottom - drawMarginFrame - sumThickness.Bottom) {
// // Assert.Equal (lRCorner, rune);
// // } else if (c > frame.X + sumThickness.Left
// // && (r == frame.Y + sumThickness.Top
// // || r == frame.Bottom - drawMarginFrame - sumThickness.Bottom)) {
// // Assert.Equal (hLine, rune);
// // } else if ((c == frame.X + sumThickness.Left
// // || c == frame.Right - drawMarginFrame - sumThickness.Right)
// // && r >= frame.Y + drawMarginFrame + sumThickness.Top) {
// // Assert.Equal (vLine, rune);
// // } else {
// // text += rune.ToString ();
// // }
// // }
// //}
// //Assert.Equal ("This is a test", text.Trim ());
// TODO: Re-enable 3deffect
// // TODO: Re-enable 3deffect
//// Check the upper Effect3D
//for (int r = frame.Y + effect3DOffset.Y;
// r < frame.Y; r++) {
// for (int c = frame.X + effect3DOffset.X;
// c < frame.Right + effect3DOffset.X; c++) {
// //// Check the upper Effect3D
// //for (int r = frame.Y + effect3DOffset.Y;
// // r < frame.Y; r++) {
// // for (int c = frame.X + effect3DOffset.X;
// // c < frame.Right + effect3DOffset.X; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
//}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.DarkGray, color.Background);
// // }
// //}
//// Check the left Effect3D
//for (int r = frame.Y + effect3DOffset.Y;
// r < frame.Bottom + effect3DOffset.Y; r++) {
// for (int c = frame.X + effect3DOffset.X;
// c < frame.X; c++) {
// //// Check the left Effect3D
// //for (int r = frame.Y + effect3DOffset.Y;
// // r < frame.Bottom + effect3DOffset.Y; r++) {
// // for (int c = frame.X + effect3DOffset.X;
// // c < frame.X; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
//}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.DarkGray, color.Background);
// // }
// //}
//// Check the right Effect3D
//for (int r = frame.Y + effect3DOffset.Y;
// r < frame.Bottom + effect3DOffset.Y; r++) {
// for (int c = frame.Right;
// c < frame.Right + effect3DOffset.X; c++) {
// //// Check the right Effect3D
// //for (int r = frame.Y + effect3DOffset.Y;
// // r < frame.Bottom + effect3DOffset.Y; r++) {
// // for (int c = frame.Right;
// // c < frame.Right + effect3DOffset.X; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
//}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.DarkGray, color.Background);
// // }
// //}
//// Check the lower Effect3D
//for (int r = frame.Bottom;
// r < frame.Bottom + effect3DOffset.Y; r++) {
// for (int c = frame.X + effect3DOffset.X;
// c < frame.Right + effect3DOffset.X; c++) {
// //// Check the lower Effect3D
// //for (int r = frame.Bottom;
// // r < frame.Bottom + effect3DOffset.Y; r++) {
// // for (int c = frame.X + effect3DOffset.X;
// // c < frame.Right + effect3DOffset.X; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.DarkGray, color.Background);
// }
//}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.DarkGray, color.Background);
// // }
// //}
//// Check the Child frame
//for (int r = frame.Y + drawMarginFrame + sumThickness.Top;
// r < frame.Bottom - drawMarginFrame - sumThickness.Bottom; r++) {
// for (int c = frame.X + drawMarginFrame + sumThickness.Left;
// c < frame.Right - drawMarginFrame - sumThickness.Right; c++) {
// //// Check the Child frame
// //for (int r = frame.Y + drawMarginFrame + sumThickness.Top;
// // r < frame.Bottom - drawMarginFrame - sumThickness.Bottom; r++) {
// // for (int c = frame.X + drawMarginFrame + sumThickness.Left;
// // c < frame.Right - drawMarginFrame - sumThickness.Right; c++) {
// var color = (Attribute)driver.Contents [r, c, 1];
// Assert.Equal (Color.BrightGreen, color.Foreground);
// Assert.Equal (Color.Black, color.Background);
// }
//}
}
// // var color = (Attribute)driver.Contents [r, c, 1];
// // Assert.Equal (Color.BrightGreen, color.Foreground);
// // Assert.Equal (Color.Black, color.Background);
// // }
// //}
//}
[Fact]
[AutoInitShutdown]