Skip to content

Commit

Permalink
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
tig committed Mar 1, 2024
2 parents 6e18bc4 + 0b8ffb4 commit 260b2e7
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 137 deletions.
46 changes: 22 additions & 24 deletions Terminal.Gui/Terminal.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@
<LangVersion>12</LangVersion>
<RootNamespace>Terminal.Gui</RootNamespace>
<AssemblyName>Terminal.Gui</AssemblyName>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineTrace>True</DefineTrace>
<DebugType>portable</DebugType>
<DefineConstants>$(DefineConstants);JETBRAINS_ANNOTATIONS;CONTRACTS_FULL</DefineConstants>
<ImplicitUsings>enable</ImplicitUsings>
<NoLogo>True</NoLogo>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineDebug>True</DefineDebug>
<DefineConstants>$(DefineConstants);DEBUG_IDISPOSABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
<Optimize>True</Optimize>
<VersionSuffix></VersionSuffix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
<DebugType>portable</DebugType>
</PropertyGroup>
<!-- =================================================================== -->
<!-- Configuration Manager -->
<!-- =================================================================== -->
Expand All @@ -40,24 +45,27 @@
<!-- =================================================================== -->
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<!-- Enable Nuget Source Link for github -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.IO.Abstractions" Version="20.0.15" />
<PackageReference Include="System.Text.Json" Version="8.0.2" />
<PackageReference Include="Wcwidth" Version="2.0.0" />
</ItemGroup>
<!-- =================================================================== -->
<!-- Global Usings and Type Aliases -->
<!-- =================================================================== -->
<ItemGroup>
<Using Include="JetBrains.Annotations" />
<Using Include="System.Diagnostics.Contracts.PureAttribute" Alias="PureAttribute" />
<Using Include="System.Drawing" />
<Using Include="System.Text" />
</ItemGroup>
<!-- =================================================================== -->
<!-- Namespaces for which internal items are visible -->
<!-- =================================================================== -->
<ItemGroup>
<InternalsVisibleTo Include="UnitTests" />
</ItemGroup>
<PropertyGroup>
<!-- Uncomment the RestoreSources element to have dotnet restore pull NStack from a local dir for testing -->
<!-- See https://stackoverflow.com/a/44463578/297526 -->
<!--<RestoreSources>$(RestoreSources);..\..\NStack\NStack\bin\Debug;https://api.nuget.org/v3/index.json</RestoreSources>-->
</PropertyGroup>
<!-- =================================================================== -->
<!-- API Documentation -->
<!-- =================================================================== -->
Expand Down Expand Up @@ -87,13 +95,6 @@
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Using Include="JetBrains.Annotations" />
<Using Include="System.Diagnostics.Contracts.PureAttribute" Alias="PureAttribute" />
<Using Include="System.Drawing" />
<Using Include="System.Text" />
<Using Include="JetBrains.Annotations" />
</ItemGroup>
<!-- =================================================================== -->
<!-- Nuget -->
<!-- =================================================================== -->
Expand All @@ -111,7 +112,7 @@
<PackageReleaseNotes>
See: https://github.com/gui-cs/Terminal.Gui/releases
</PackageReleaseNotes>
<DocumentationFile>bin\Release\Terminal.Gui.xml</DocumentationFile>
<DocumentationFile>bin\$(Configuration)\Terminal.Gui.xml</DocumentationFile>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Debug' ">true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/gui-cs/Terminal.Gui.git</RepositoryUrl>
Expand All @@ -124,9 +125,6 @@
<GitRepositoryRemoteName>upstream</GitRepositoryRemoteName>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<EnableSourceLink>true</EnableSourceLink>
<!--<DebugType>Embedded</DebugType>-->
<Authors>Miguel de Icaza, Tig Kindel (@tig), @BDisp</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
</Project>
20 changes: 20 additions & 0 deletions Terminal.Gui/Text/TextAlignment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Terminal.Gui;

/// <summary>Text alignment enumeration, controls how text is displayed.</summary>
public enum TextAlignment
{
/// <summary>The text will be left-aligned.</summary>
Left,

/// <summary>The text will be right-aligned.</summary>
Right,

/// <summary>The text will be centered horizontally.</summary>
Centered,

/// <summary>
/// The text will be justified (spaces will be added to existing spaces such that the text fills the container
/// horizontally).
/// </summary>
Justified
}
61 changes: 61 additions & 0 deletions Terminal.Gui/Text/TextDirection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
namespace Terminal.Gui;

/// <summary>Text direction enumeration, controls how text is displayed.</summary>
/// <remarks>
/// <para>TextDirection [H] = Horizontal [V] = Vertical</para>
/// <table>
/// <tr>
/// <th>TextDirection</th> <th>Description</th>
/// </tr>
/// <tr>
/// <td>LeftRight_TopBottom [H]</td> <td>Normal</td>
/// </tr>
/// <tr>
/// <td>TopBottom_LeftRight [V]</td> <td>Normal</td>
/// </tr>
/// <tr>
/// <td>RightLeft_TopBottom [H]</td> <td>Invert Text</td>
/// </tr>
/// <tr>
/// <td>TopBottom_RightLeft [V]</td> <td>Invert Lines</td>
/// </tr>
/// <tr>
/// <td>LeftRight_BottomTop [H]</td> <td>Invert Lines</td>
/// </tr>
/// <tr>
/// <td>BottomTop_LeftRight [V]</td> <td>Invert Text</td>
/// </tr>
/// <tr>
/// <td>RightLeft_BottomTop [H]</td> <td>Invert Text + Invert Lines</td>
/// </tr>
/// <tr>
/// <td>BottomTop_RightLeft [V]</td> <td>Invert Text + Invert Lines</td>
/// </tr>
/// </table>
/// </remarks>
public enum TextDirection
{
/// <summary>Normal horizontal direction. <code>HELLO<br/>WORLD</code></summary>
LeftRight_TopBottom,

/// <summary>Normal vertical direction. <code>H W<br/>E O<br/>L R<br/>L L<br/>O D</code></summary>
TopBottom_LeftRight,

/// <summary>This is a horizontal direction. <br/> RTL <code>OLLEH<br/>DLROW</code></summary>
RightLeft_TopBottom,

/// <summary>This is a vertical direction. <code>W H<br/>O E<br/>R L<br/>L L<br/>D O</code></summary>
TopBottom_RightLeft,

/// <summary>This is a horizontal direction. <code>WORLD<br/>HELLO</code></summary>
LeftRight_BottomTop,

/// <summary>This is a vertical direction. <code>O D<br/>L L<br/>L R<br/>E O<br/>H W</code></summary>
BottomTop_LeftRight,

/// <summary>This is a horizontal direction. <code>DLROW<br/>OLLEH</code></summary>
RightLeft_BottomTop,

/// <summary>This is a vertical direction. <code>D O<br/>L L<br/>R L<br/>O E<br/>W H</code></summary>
BottomTop_RightLeft
}
98 changes: 0 additions & 98 deletions Terminal.Gui/Text/TextFormatter.cs
Original file line number Diff line number Diff line change
@@ -1,103 +1,5 @@
namespace Terminal.Gui;

/// <summary>Text alignment enumeration, controls how text is displayed.</summary>
public enum TextAlignment
{
/// <summary>The text will be left-aligned.</summary>
Left,

/// <summary>The text will be right-aligned.</summary>
Right,

/// <summary>The text will be centered horizontally.</summary>
Centered,

/// <summary>
/// The text will be justified (spaces will be added to existing spaces such that the text fills the container
/// horizontally).
/// </summary>
Justified
}

/// <summary>Vertical text alignment enumeration, controls how text is displayed.</summary>
public enum VerticalTextAlignment
{
/// <summary>The text will be top-aligned.</summary>
Top,

/// <summary>The text will be bottom-aligned.</summary>
Bottom,

/// <summary>The text will centered vertically.</summary>
Middle,

/// <summary>
/// The text will be justified (spaces will be added to existing spaces such that the text fills the container
/// vertically).
/// </summary>
Justified
}

/// <summary>Text direction enumeration, controls how text is displayed.</summary>
/// <remarks>
/// <para>TextDirection [H] = Horizontal [V] = Vertical</para>
/// <table>
/// <tr>
/// <th>TextDirection</th> <th>Description</th>
/// </tr>
/// <tr>
/// <td>LeftRight_TopBottom [H]</td> <td>Normal</td>
/// </tr>
/// <tr>
/// <td>TopBottom_LeftRight [V]</td> <td>Normal</td>
/// </tr>
/// <tr>
/// <td>RightLeft_TopBottom [H]</td> <td>Invert Text</td>
/// </tr>
/// <tr>
/// <td>TopBottom_RightLeft [V]</td> <td>Invert Lines</td>
/// </tr>
/// <tr>
/// <td>LeftRight_BottomTop [H]</td> <td>Invert Lines</td>
/// </tr>
/// <tr>
/// <td>BottomTop_LeftRight [V]</td> <td>Invert Text</td>
/// </tr>
/// <tr>
/// <td>RightLeft_BottomTop [H]</td> <td>Invert Text + Invert Lines</td>
/// </tr>
/// <tr>
/// <td>BottomTop_RightLeft [V]</td> <td>Invert Text + Invert Lines</td>
/// </tr>
/// </table>
/// </remarks>
public enum TextDirection
{
/// <summary>Normal horizontal direction. <code>HELLO<br/>WORLD</code></summary>
LeftRight_TopBottom,

/// <summary>Normal vertical direction. <code>H W<br/>E O<br/>L R<br/>L L<br/>O D</code></summary>
TopBottom_LeftRight,

/// <summary>This is a horizontal direction. <br/> RTL <code>OLLEH<br/>DLROW</code></summary>
RightLeft_TopBottom,

/// <summary>This is a vertical direction. <code>W H<br/>O E<br/>R L<br/>L L<br/>D O</code></summary>
TopBottom_RightLeft,

/// <summary>This is a horizontal direction. <code>WORLD<br/>HELLO</code></summary>
LeftRight_BottomTop,

/// <summary>This is a vertical direction. <code>O D<br/>L L<br/>L R<br/>E O<br/>H W</code></summary>
BottomTop_LeftRight,

/// <summary>This is a horizontal direction. <code>DLROW<br/>OLLEH</code></summary>
RightLeft_BottomTop,

/// <summary>This is a vertical direction. <code>D O<br/>L L<br/>R L<br/>O E<br/>W H</code></summary>
BottomTop_RightLeft
}

/// <summary>
/// Provides text formatting. Supports <see cref="View.HotKey"/>s, horizontal alignment, vertical alignment,
/// multiple lines, and word-based line wrap.
Expand Down
20 changes: 20 additions & 0 deletions Terminal.Gui/Text/VerticalTextAlignment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Terminal.Gui;

/// <summary>Vertical text alignment enumeration, controls how text is displayed.</summary>
public enum VerticalTextAlignment
{
/// <summary>The text will be top-aligned.</summary>
Top,

/// <summary>The text will be bottom-aligned.</summary>
Bottom,

/// <summary>The text will centered vertically.</summary>
Middle,

/// <summary>
/// The text will be justified (spaces will be added to existing spaces such that the text fills the container
/// vertically).
/// </summary>
Justified
}
Loading

0 comments on commit 260b2e7

Please sign in to comment.