Skip to content

Commit

Permalink
Merge pull request #49 from lastunicorn/bug/48-textmenu-title-color-i…
Browse files Browse the repository at this point in the history
…s-ignored

#48 - fix foreground and background usages for text menu
  • Loading branch information
lastunicorn authored Dec 14, 2021
2 parents d6b7263 + 9b7c4c1 commit 23dc91d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 4 additions & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ ConsoleTools

Note: For any bug or feature request please add a new issue on GitHub: https://github.com/lastunicorn/ConsoleTools/issues/new

ver 0.5.5
---------
- TextManu: [bugfix] Fixed the usage of ForegroundColor and BackgroundColor.

ver 0.5.4
---------
- DataGrid: [bugfix] Fixed the usage of ForegroundColor and BackgroundColor.
Expand Down
4 changes: 2 additions & 2 deletions nuget/ConsoleTools.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>ConsoleTools</id>
<version>0.5.4</version>
<version>0.5.5</version>
<authors>Dust in the Wind</authors>
<title>ConsoleTools</title>
<owners>Dust in the Wind</owners>
Expand All @@ -11,7 +11,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A set of tools and "controls" for the .net Console. It contains: List Input/Output Controls, Text Input/Output Controls, Progress Bar, Spinner, Data Table, Prompter, Menus, etc.</description>
<summary>A set of tools and "controls" for the .net Console.</summary>
<releaseNotes>Fixed the usage of ForegroundColor and BackgroundColor in the DataGrid.</releaseNotes>
<releaseNotes>Fixed the usage of ForegroundColor and BackgroundColor in the TextMenu.</releaseNotes>
<copyright>Copyright 2017-2018 Dust in the Wind</copyright>
<tags>console cli prompter menu progressbar spinner table read write textblock inlinetextblock blockcontrol, inlinecontrol</tags>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion release/build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off

set root_directory=..
set version=0.5.4
set version=0.5.5


rem ----------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion sources/ConsoleTools/AssemblyInfo.Shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.4.*")]
[assembly: AssemblyVersion("0.5.5.*")]
//[assembly: AssemblyFileVersion("1.0.0.*")]
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public MainMenu(GameApplication application)

TitleText = "Demo Application";
TitleForegroundColor = ConsoleColor.Cyan;
TitleBackgroundColor = ConsoleColor.DarkGreen;

IEnumerable<TextMenuItem> menuItems = CreateMenuItems(application);
AddItems(menuItems);
Expand Down
13 changes: 4 additions & 9 deletions sources/ConsoleTools/ConsoleTools/Menues/TextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ namespace DustInTheWind.ConsoleTools.Menues
public class TextMenu : ErasableControl, IRepeatableSupport
{
private bool closeWasRequested;

/// <summary>
/// Gets the list of items contained by the current instance.
/// </summary>
private readonly List<TextMenuItem> menuItems = new List<TextMenuItem>();

private TextMenuItem selectedItem;

/// <summary>
Expand Down Expand Up @@ -69,7 +64,7 @@ public class TextMenu : ErasableControl, IRepeatableSupport
};

/// <summary>
/// Gets or sets the text displayed when the user chooses an inexistent option.
/// Gets or sets the text displayed when the user chooses an non-existent option.
/// </summary>
public string InvalidOptionText { get; set; } = TextMenuResources.InvalidOptionMessage;

Expand Down Expand Up @@ -114,14 +109,14 @@ private set
public event EventHandler Closed;

/// <summary>
/// Initialize a new instace of the <see cref="TextMenu"/> calss.
/// Initialize a new instance of the <see cref="TextMenu"/> class.
/// </summary>
public TextMenu()
{
}

/// <summary>
/// Initialize a new instace of the <see cref="TextMenu"/> calss with
/// Initialize a new instance of the <see cref="TextMenu"/> class with
/// the list of items to be displayed.
/// </summary>
/// <param name="menuItems">The list of items to be displayed by the menu.</param>
Expand Down Expand Up @@ -190,7 +185,7 @@ protected override void DoDisplayContent(ControlDisplay display)

private void DrawTitle(ControlDisplay display)
{
display.WriteRow(TitleText);
display.WriteRow(TitleForegroundColor, TitleBackgroundColor, TitleText);
display.WriteRow();
display.WriteRow();

Expand Down

0 comments on commit 23dc91d

Please sign in to comment.