WIP -> Getting rid of old TextAlignment enums

This commit is contained in:
Tig
2024-05-10 08:52:47 -06:00
parent 831eecbd28
commit c84dade64d
47 changed files with 704 additions and 744 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -339,7 +339,7 @@ public class DrawTests (ITestOutputHelper _output)
Text = "Test",
Width = 6,
Height = 1,
TextAlignment = TextAlignment.Right,
Justification = Justification.Right,
ColorScheme = Colors.ColorSchemes ["Base"]
};
@@ -350,7 +350,7 @@ public class DrawTests (ITestOutputHelper _output)
Y = 1,
Width = 1,
Height = 6,
VerticalTextAlignment = VerticalTextAlignment.Bottom,
VerticalJustification = Justification.Bottom,
ColorScheme = Colors.ColorSchemes ["Base"]
};
Toplevel top = new ();

View File

@@ -681,11 +681,11 @@ public class DimAutoTests (ITestOutputHelper output)
Assert.False (view.TextFormatter.AutoSize);
Assert.Equal (Size.Empty, view.Frame.Size);
view.TextFormatter.Alignment = TextAlignment.Justified;
view.TextFormatter.Alignment = Justification.Justified;
Assert.False (view.TextFormatter.AutoSize);
Assert.Equal (Size.Empty, view.Frame.Size);
view.TextFormatter.VerticalAlignment = VerticalTextAlignment.Middle;
view.TextFormatter.VerticalAlignment = Justification.Centered;
Assert.False (view.TextFormatter.AutoSize);
Assert.Equal (Size.Empty, view.Frame.Size);
@@ -709,11 +709,11 @@ public class DimAutoTests (ITestOutputHelper output)
Assert.False (view.TextFormatter.AutoSize);
Assert.Equal (Size.Empty, view.Frame.Size);
view.TextAlignment = TextAlignment.Justified;
view.Justification = Justification.Justified;
Assert.False (view.TextFormatter.AutoSize);
Assert.Equal (Size.Empty, view.Frame.Size);
view.VerticalTextAlignment = VerticalTextAlignment.Middle;
view.VerticalJustification = Justification.Centered;
Assert.False (view.TextFormatter.AutoSize);
Assert.Equal (Size.Empty, view.Frame.Size);
@@ -738,7 +738,7 @@ public class DimAutoTests (ITestOutputHelper output)
Assert.True (view.TextFormatter.AutoSize);
Assert.NotEqual (Size.Empty, view.Frame.Size);
view.TextAlignment = TextAlignment.Justified;
view.Justification = Justification.Justified;
Assert.True (view.TextFormatter.AutoSize);
Assert.NotEqual (Size.Empty, view.Frame.Size);
@@ -747,7 +747,7 @@ public class DimAutoTests (ITestOutputHelper output)
Text = "_1234",
Width = Dim.Auto ()
};
view.VerticalTextAlignment = VerticalTextAlignment.Middle;
view.VerticalJustification = Justification.Centered;
Assert.True (view.TextFormatter.AutoSize);
Assert.NotEqual (Size.Empty, view.Frame.Size);

View File

@@ -1811,7 +1811,7 @@ Y
Y = 1,
Width = width,
Height = 1,
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
};
if (autoSize)
@@ -1826,7 +1826,7 @@ Y
Y = 2,
Width = width,
Height = 1,
TextAlignment = TextAlignment.Right,
Justification = Justification.Right,
};
if (autoSize)
{
@@ -1840,7 +1840,7 @@ Y
Y = 3,
Width = width,
Height = 1,
TextAlignment = TextAlignment.Justified,
Justification = Justification.Justified,
};
if (autoSize)
{
@@ -1937,7 +1937,7 @@ Y
Width = 1,
Height = height,
TextDirection = TextDirection.TopBottom_LeftRight,
VerticalTextAlignment = VerticalTextAlignment.Middle
Justification = Justification.Centered
};
if (autoSize)
{
@@ -1952,7 +1952,7 @@ Y
Width = 1,
Height = height,
TextDirection = TextDirection.TopBottom_LeftRight,
VerticalTextAlignment = VerticalTextAlignment.Bottom
VerticalJustification = Justification.Bottom
};
if (autoSize)
{
@@ -1967,7 +1967,7 @@ Y
Width = 1,
Height = height,
TextDirection = TextDirection.TopBottom_LeftRight,
VerticalTextAlignment = VerticalTextAlignment.Justified
VerticalJustification = Justification.Justified
};
if (autoSize)
{

View File

@@ -155,14 +155,14 @@ public class ButtonTests (ITestOutputHelper output)
Assert.Equal ($"{CM.Glyphs.LeftBracket} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
Assert.False (btn.IsDefault);
Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
Assert.Equal (Justification.Centered, btn.Justification);
Assert.Equal ('_', btn.HotKeySpecifier.Value);
Assert.True (btn.CanFocus);
Assert.Equal (new (0, 0, 4, 1), btn.Viewport);
Assert.Equal (new (0, 0, 4, 1), btn.Frame);
Assert.Equal ($"{CM.Glyphs.LeftBracket} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text);
Assert.False (btn.IsDefault);
Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
Assert.Equal (Justification.Centered, btn.Justification);
Assert.Equal ('_', btn.HotKeySpecifier.Value);
Assert.True (btn.CanFocus);
Assert.Equal (new (0, 0, 4, 1), btn.Viewport);
@@ -195,7 +195,7 @@ public class ButtonTests (ITestOutputHelper output)
btn.TextFormatter.Format ()
);
Assert.True (btn.IsDefault);
Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
Assert.Equal (Justification.Centered, btn.Justification);
Assert.True (btn.CanFocus);
btn.SetRelativeLayout (new (100, 100));
@@ -222,7 +222,7 @@ public class ButtonTests (ITestOutputHelper output)
btn.TextFormatter.Format ()
);
Assert.True (btn.IsDefault);
Assert.Equal (TextAlignment.Centered, btn.TextAlignment);
Assert.Equal (Justification.Centered, btn.Justification);
Assert.Equal ('_', btn.HotKeySpecifier.Value);
Assert.True (btn.CanFocus);

View File

@@ -251,7 +251,7 @@ public class CheckBoxTests
X = 1,
Y = Pos.Center (),
Text = "Check this out 你",
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 25
};
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
@@ -262,7 +262,7 @@ public class CheckBoxTests
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
Assert.Equal (TextAlignment.Centered, checkBox.TextAlignment);
Assert.Equal (Justification.Centered, checkBox.Justification);
Assert.Equal (new (1, 1, 25, 1), checkBox.Frame);
Assert.Equal (_size25x1, checkBox.TextFormatter.Size);
@@ -301,7 +301,7 @@ public class CheckBoxTests
X = 1,
Y = Pos.Center (),
Text = "Check first out 你",
TextAlignment = TextAlignment.Justified,
Justification = Justification.Justified,
Width = 25
};
@@ -310,7 +310,7 @@ public class CheckBoxTests
X = 1,
Y = Pos.Bottom (checkBox1),
Text = "Check second out 你",
TextAlignment = TextAlignment.Justified,
Justification = Justification.Justified,
Width = 25
};
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
@@ -321,9 +321,9 @@ public class CheckBoxTests
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (30, 6);
Assert.Equal (TextAlignment.Justified, checkBox1.TextAlignment);
Assert.Equal (Justification.Justified, checkBox1.Justification);
Assert.Equal (new (1, 1, 25, 1), checkBox1.Frame);
Assert.Equal (TextAlignment.Justified, checkBox2.TextAlignment);
Assert.Equal (Justification.Justified, checkBox2.Justification);
Assert.Equal (new (1, 2, 25, 1), checkBox2.Frame);
var expected = @$"
@@ -378,7 +378,7 @@ public class CheckBoxTests
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
Assert.Equal (TextAlignment.Left, checkBox.TextAlignment);
Assert.Equal (Justification.Left, checkBox.Justification);
Assert.Equal (new (1, 1, 25, 1), checkBox.Frame);
Assert.Equal (_size25x1, checkBox.TextFormatter.Size);
@@ -417,7 +417,7 @@ public class CheckBoxTests
X = 1,
Y = Pos.Center (),
Text = "Check this out 你",
TextAlignment = TextAlignment.Right,
Justification = Justification.Right,
Width = 25
};
var win = new Window { Width = Dim.Fill (), Height = Dim.Fill (), Title = "Test Demo 你" };
@@ -428,7 +428,7 @@ public class CheckBoxTests
Application.Begin (top);
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
Assert.Equal (TextAlignment.Right, checkBox.TextAlignment);
Assert.Equal (Justification.Right, checkBox.Justification);
Assert.Equal (new (1, 1, 25, 1), checkBox.Frame);
Assert.Equal (_size25x1, checkBox.TextFormatter.Size);

View File

@@ -206,7 +206,7 @@ public class LabelTests
{
var label = new Label ();
Assert.Equal (string.Empty, label.Text);
Assert.Equal (TextAlignment.Left, label.TextAlignment);
Assert.Equal (Justification.Left, label.Justification);
Assert.False (label.CanFocus);
Assert.Equal (new Rectangle (0, 0, 0, 0), label.Frame);
Assert.Equal (KeyCode.Null, label.HotKey);

View File

@@ -10,7 +10,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// ****
@@ -44,7 +44,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Left,
Justification = Justification.Left,
Width = 30,
// ****
@@ -81,7 +81,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// ****
@@ -115,7 +115,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// *
@@ -137,7 +137,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// *
@@ -161,7 +161,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// ****
@@ -179,7 +179,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// ****
@@ -196,7 +196,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// ****
@@ -214,7 +214,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// *
@@ -233,7 +233,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// *
@@ -253,7 +253,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// ** **
@@ -283,7 +283,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// *
@@ -308,7 +308,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Left,
Justification = Justification.Left,
Width = 30,
// ****
@@ -338,7 +338,7 @@ public class TextValidateField_NET_Provider_Tests
var field = new TextValidateField
{
TextAlignment = TextAlignment.Left, Width = 30, Provider = new NetMaskedTextProvider ("--(0000)--")
Justification = Justification.Left, Width = 30, Provider = new NetMaskedTextProvider ("--(0000)--")
};
field.Provider.TextChanged += (sender, e) => wasTextChanged = true;
@@ -356,7 +356,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// *
@@ -381,7 +381,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Left,
Justification = Justification.Left,
Width = 30,
// ****
@@ -400,7 +400,7 @@ public class TextValidateField_NET_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
// ****
@@ -540,7 +540,7 @@ public class TextValidateField_Regex_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
Provider = new TextRegexProvider ("^[0-9][0-9][0-9]$") { ValidateOnInput = false }
};
@@ -596,7 +596,7 @@ public class TextValidateField_Regex_Provider_Tests
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
Provider = new TextRegexProvider ("^[0-9][0-9][0-9]$") { ValidateOnInput = false }
};
@@ -616,7 +616,7 @@ public class TextValidateField_Regex_Provider_Tests
{
var field = new TextValidateField
{
TextAlignment = TextAlignment.Centered,
Justification = Justification.Centered,
Width = 20,
Provider = new TextRegexProvider ("^[0-9][0-9][0-9]$") { ValidateOnInput = false }
};

View File

@@ -1482,8 +1482,8 @@ public class ToplevelTests
Y = Pos.Center (),
Width = Dim.Fill (),
Height = Dim.Fill (),
TextAlignment = TextAlignment.Centered,
VerticalTextAlignment = VerticalTextAlignment.Middle,
Justification = Justification.Centered,
VerticalJustification = Justification.Centered,
Text = "Test"
}
);