diff --git a/docs/assets/img/jpg/elements_options/ascii.jpg b/docs/assets/img/jpg/elements_options/ascii.jpg
new file mode 100644
index 00000000..6c1dc3bd
Binary files /dev/null and b/docs/assets/img/jpg/elements_options/ascii.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/bold.jpg b/docs/assets/img/jpg/elements_options/bold.jpg
new file mode 100644
index 00000000..d874c8b0
Binary files /dev/null and b/docs/assets/img/jpg/elements_options/bold.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/bottomcenter.jpg b/docs/assets/img/jpg/elements_options/bottomcenter.jpg
index c2d7ebbf..6b819ec3 100644
Binary files a/docs/assets/img/jpg/elements_options/bottomcenter.jpg and b/docs/assets/img/jpg/elements_options/bottomcenter.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/double.jpg b/docs/assets/img/jpg/elements_options/double.jpg
new file mode 100644
index 00000000..42c68cbc
Binary files /dev/null and b/docs/assets/img/jpg/elements_options/double.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/round.jpg b/docs/assets/img/jpg/elements_options/round.jpg
new file mode 100644
index 00000000..f9a13077
Binary files /dev/null and b/docs/assets/img/jpg/elements_options/round.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/straight.jpg b/docs/assets/img/jpg/elements_options/straight.jpg
new file mode 100644
index 00000000..c8e7e4f5
Binary files /dev/null and b/docs/assets/img/jpg/elements_options/straight.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/topcenter.jpg b/docs/assets/img/jpg/elements_options/topcenter.jpg
index 6671c03f..6e2eb4dd 100644
Binary files a/docs/assets/img/jpg/elements_options/topcenter.jpg and b/docs/assets/img/jpg/elements_options/topcenter.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/topleft.jpg b/docs/assets/img/jpg/elements_options/topleft.jpg
index 77fec2b0..00f76c70 100644
Binary files a/docs/assets/img/jpg/elements_options/topleft.jpg and b/docs/assets/img/jpg/elements_options/topleft.jpg differ
diff --git a/docs/assets/img/jpg/elements_options/topright.jpg b/docs/assets/img/jpg/elements_options/topright.jpg
index cd7dc3d8..948bc324 100644
Binary files a/docs/assets/img/jpg/elements_options/topright.jpg and b/docs/assets/img/jpg/elements_options/topright.jpg differ
diff --git a/docs/introduction/elements_options.md b/docs/introduction/elements_options.md
index 8c5071aa..8697ae43 100644
--- a/docs/introduction/elements_options.md
+++ b/docs/introduction/elements_options.md
@@ -5,7 +5,7 @@ In this section, you will learn:
- How to deactivate/ remove elements
- How to use the `ElementsDashboard` inspector element
- How to use the `HeightSpacer` element
-- Discover `Placement` and `TextAlignment` enumerations
+- Discover `Placement`, `TextAlignment` and `BordersType` enumerations
- How to use the full potential of the element options
## Setup
@@ -146,7 +146,7 @@ Window.Close();
In all the tutorials and the [example project](https://github.com/MorganKryze/ConsoleAppVisuals/blob/main/example/) the elements definitions are simplified and do not declare all the arguments available. To see all the arguments available for each element, you can consult the [references documentation](https://morgankryze.github.io/ConsoleAppVisuals/references/index.html).
-Most of them are specific with generic type (`string`, `int`, `bool`...) and are used to customize the element. But some of them are common to all elements and are used to place the element on the window. These are the `Placement` and `TextAlignment` enumerations.
+Most of them are specific with generic type (`string`, `int`, `bool`, `List`, ...) and are used to customize the element. But some of them are common to all elements and are used to place the element on the window. These are the `Placement` and `TextAlignment` enumerations.
### `Placement`
@@ -158,7 +158,7 @@ The available values are:
![TopLeft](../assets/img/jpg/elements_options/topleft.jpg)
-- `TopCenter`: x(line) = 0, y(char) = windowWidth / 2
+- `TopCenter`: (Default) x(line) = 0, y(char) = windowWidth / 2
![TopCenter](../assets/img/jpg/elements_options/topcenter.jpg)
@@ -178,7 +178,7 @@ The available values are:
> To choose the placement of an element, you can either set it from the constructor or use the `UpdatePlacement()` method after creating the element.
>
> ```csharp
-> Prompt prompt = new Prompt("Enter your name", "Name", Placement.TopCenter);
+> Prompt prompt = new Prompt("Enter your name:", "John", Placement.TopCenter);
> // or
> prompt.UpdatePlacement(Placement.TopCenter);
> ```
@@ -191,7 +191,7 @@ The `TextAlignment` enumeration is used to align the text in a string. It is use
![Left](../assets/img/jpg/elements_options/left.jpg)
-- `Center`: Align the text to the center
+- `Center`: (Default) Align the text to the center
![Center](../assets/img/jpg/elements_options/center.jpg)
@@ -208,6 +208,45 @@ The `TextAlignment` enumeration is used to align the text in a string. It is use
> embedText.UpdateTextAlignment(TextAlignment.Center);
> ```
+### `BordersType`
+
+The `BordersType` enumeration is used to set the borders of an element. It is used by the table and embed elements from the library. Here are the available values:
+
+- `SingleStraight`: (Default) Single lines with straight corners
+
+![SingleStraight](../assets/img/jpg/elements_options/straight.jpg)
+
+- `SingleRound`: Single lines with round corners
+
+![SingleRound](../assets/img/jpg/elements_options/round.jpg)
+
+- `SingleBold`: Single bold lines with straight corners
+
+![SingleBold](../assets/img/jpg/elements_options/bold.jpg)
+
+- `DoubleStraight`: Double lines with straight corners
+
+![DoubleStraight](../assets/img/jpg/elements_options/double.jpg)
+
+- `ASCII`: ASCII basic characters for the borders (`+`, `-`, `|` only)
+
+![ASCII](../assets/img/jpg/elements_options/ascii.jpg)
+
+> [!WARNING]
+> The following types are not available for Visual Studio or Windows Command Prompt:
+>
+> - `SingleRound`
+> - `SingleBold`
+
+> [!NOTE]
+> To choose the border type of an element, you can either set it from the constructor or use the `UpdateBordersType()` method after creating the element (some elements may not have this method if the border type is not used in it so refer to the references documentation to get that specific information).
+>
+> ```csharp
+> ElementsDashboard dashboard = new ElementsDashboard(Placement.TopCenter, BordersType.SingleStraight);
+> // or
+> dashboard.UpdateBordersType(BordersType.SingleStraight);
+> ```
+
## Conclusion
In this section, you learned how to deactivate and remove elements from the window. You also discovered the `Placement` and `TextAlignment` enumerations and how to use the full potential of the element options by knowing all the arguments available. You may now be able to use more complex elements and place them at your desired location.
diff --git a/src/ConsoleAppVisuals/enums/BordersType.cs b/src/ConsoleAppVisuals/enums/BordersType.cs
index 36d224c1..a6c20512 100644
--- a/src/ConsoleAppVisuals/enums/BordersType.cs
+++ b/src/ConsoleAppVisuals/enums/BordersType.cs
@@ -30,7 +30,7 @@ public enum BordersType
///
/// Not supported on PowerShell (Windows).
///
- SingleRounded,
+ SingleRound,
///
/// Single line borders with bold lines (┏┓┗┛━┃┳┻┣┫╋)
diff --git a/src/ConsoleAppVisuals/models/Borders.cs b/src/ConsoleAppVisuals/models/Borders.cs
index ae280b20..38f35e57 100644
--- a/src/ConsoleAppVisuals/models/Borders.cs
+++ b/src/ConsoleAppVisuals/models/Borders.cs
@@ -112,7 +112,7 @@ private static BordersType CheckType(BordersType type)
if (
type
is BordersType.SingleStraight
- or BordersType.SingleRounded
+ or BordersType.SingleRound
or BordersType.SingleBold
or BordersType.DoubleStraight
or BordersType.ASCII
@@ -150,7 +150,7 @@ public char GetBorderChar(int index)
string border = _type switch
{
BordersType.SingleStraight => SINGLE_STRAIGHT,
- BordersType.SingleRounded => SINGLE_ROUNDED,
+ BordersType.SingleRound => SINGLE_ROUNDED,
BordersType.SingleBold => SINGLE_BOLD,
BordersType.DoubleStraight => DOUBLE_STRAIGHT,
BordersType.ASCII => ASCII,
diff --git a/testing/elements/interactive/Prompt.Tests.cs b/testing/elements/interactive/Prompt.Tests.cs
index 82f7778b..dfb83ab1 100644
--- a/testing/elements/interactive/Prompt.Tests.cs
+++ b/testing/elements/interactive/Prompt.Tests.cs
@@ -311,9 +311,9 @@ public void UpdateBorderType()
var prompt = new Prompt("What is your name?", "John Doe");
// Act
- prompt.UpdateBordersType(BordersType.SingleRounded);
+ prompt.UpdateBordersType(BordersType.SingleRound);
var actual = prompt.BordersType;
- var expected = BordersType.SingleRounded;
+ var expected = BordersType.SingleRound;
// Assert
Assert.AreEqual(expected, actual);
diff --git a/testing/elements/passive/TableView.Tests.cs b/testing/elements/passive/TableView.Tests.cs
index 7d565488..bcdf0798 100644
--- a/testing/elements/passive/TableView.Tests.cs
+++ b/testing/elements/passive/TableView.Tests.cs
@@ -478,10 +478,10 @@ public void UpdateBorderType_UpdatesBorderTypeCorrectly()
);
// Act
- table.UpdateBordersType(BordersType.SingleRounded);
+ table.UpdateBordersType(BordersType.SingleRound);
// Assert
- Assert.AreEqual(BordersType.SingleRounded, table.BordersType);
+ Assert.AreEqual(BordersType.SingleRound, table.BordersType);
}
[TestMethod]
diff --git a/testing/models/Borders.Tests.cs b/testing/models/Borders.Tests.cs
index d32f5a50..31344668 100644
--- a/testing/models/Borders.Tests.cs
+++ b/testing/models/Borders.Tests.cs
@@ -51,7 +51,7 @@ public void Borders_Constructor_InvalidType()
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '┌')]
- [DataRow(BordersType.SingleRounded, '╭')]
+ [DataRow(BordersType.SingleRound, '╭')]
[DataRow(BordersType.SingleBold, '┏')]
[DataRow(BordersType.DoubleStraight, '╔')]
[DataRow(BordersType.ASCII, '+')]
@@ -70,7 +70,7 @@ public void Borders_TopLeft(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '┐')]
- [DataRow(BordersType.SingleRounded, '╮')]
+ [DataRow(BordersType.SingleRound, '╮')]
[DataRow(BordersType.SingleBold, '┓')]
[DataRow(BordersType.DoubleStraight, '╗')]
[DataRow(BordersType.ASCII, '+')]
@@ -89,7 +89,7 @@ public void Borders_TopRight(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '└')]
- [DataRow(BordersType.SingleRounded, '╰')]
+ [DataRow(BordersType.SingleRound, '╰')]
[DataRow(BordersType.SingleBold, '┗')]
[DataRow(BordersType.DoubleStraight, '╚')]
[DataRow(BordersType.ASCII, '+')]
@@ -108,7 +108,7 @@ public void Borders_BottomLeft(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '┘')]
- [DataRow(BordersType.SingleRounded, '╯')]
+ [DataRow(BordersType.SingleRound, '╯')]
[DataRow(BordersType.SingleBold, '┛')]
[DataRow(BordersType.DoubleStraight, '╝')]
[DataRow(BordersType.ASCII, '+')]
@@ -127,7 +127,7 @@ public void Borders_BottomRight(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '─')]
- [DataRow(BordersType.SingleRounded, '─')]
+ [DataRow(BordersType.SingleRound, '─')]
[DataRow(BordersType.SingleBold, '━')]
[DataRow(BordersType.DoubleStraight, '═')]
[DataRow(BordersType.ASCII, '-')]
@@ -146,7 +146,7 @@ public void Borders_Horizontal(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '│')]
- [DataRow(BordersType.SingleRounded, '│')]
+ [DataRow(BordersType.SingleRound, '│')]
[DataRow(BordersType.SingleBold, '┃')]
[DataRow(BordersType.DoubleStraight, '║')]
[DataRow(BordersType.ASCII, '|')]
@@ -165,7 +165,7 @@ public void Borders_Vertical(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '┬')]
- [DataRow(BordersType.SingleRounded, '┬')]
+ [DataRow(BordersType.SingleRound, '┬')]
[DataRow(BordersType.SingleBold, '┳')]
[DataRow(BordersType.DoubleStraight, '╦')]
[DataRow(BordersType.ASCII, '+')]
@@ -184,7 +184,7 @@ public void Borders_Top(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '┴')]
- [DataRow(BordersType.SingleRounded, '┴')]
+ [DataRow(BordersType.SingleRound, '┴')]
[DataRow(BordersType.SingleBold, '┻')]
public void Borders_Bottom(BordersType type, char expected)
{
@@ -201,7 +201,7 @@ public void Borders_Bottom(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '├')]
- [DataRow(BordersType.SingleRounded, '├')]
+ [DataRow(BordersType.SingleRound, '├')]
public void Borders_Left(BordersType type, char expected)
{
// Arrange
@@ -217,7 +217,7 @@ public void Borders_Left(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '┤')]
- [DataRow(BordersType.SingleRounded, '┤')]
+ [DataRow(BordersType.SingleRound, '┤')]
public void Borders_Right(BordersType type, char expected)
{
// Arrange
@@ -233,7 +233,7 @@ public void Borders_Right(BordersType type, char expected)
[TestMethod]
[TestCategory("Borders")]
[DataRow(BordersType.SingleStraight, '┼')]
- [DataRow(BordersType.SingleRounded, '┼')]
+ [DataRow(BordersType.SingleRound, '┼')]
public void Borders_Cross(BordersType type, char expected)
{
// Arrange
@@ -272,11 +272,11 @@ public void Borders_UpdateBorderType_SingleRounded()
Borders borders = new Borders();
// Act
- borders.UpdateBordersType(BordersType.SingleRounded);
+ borders.UpdateBordersType(BordersType.SingleRound);
BordersType actual = borders.Type;
// Assert
- Assert.AreEqual(BordersType.SingleRounded, actual);
+ Assert.AreEqual(BordersType.SingleRound, actual);
}
#endregion
}