Add interactive prompts for selecting values

* Adds SelectionPrompt
* Adds MultiSelectionPrompt

Closes #210
This commit is contained in:
Patrik Svensson
2021-01-08 06:38:07 +01:00
committed by Patrik Svensson
parent 3a593857c8
commit 0e0f4b4220
20 changed files with 980 additions and 40 deletions

View File

@ -26,10 +26,10 @@ namespace Spectre.Console.Internal
{
if (_out.IsStandardOut())
{
return ConsoleHelper.GetSafeBufferWidth(Constants.DefaultBufferWidth);
return ConsoleHelper.GetSafeWidth(Constants.DefaultTerminalWidth);
}
return Constants.DefaultBufferWidth;
return Constants.DefaultTerminalWidth;
}
}
@ -39,10 +39,10 @@ namespace Spectre.Console.Internal
{
if (_out.IsStandardOut())
{
return ConsoleHelper.GetSafeBufferHeight(Constants.DefaultBufferHeight);
return ConsoleHelper.GetSafeHeight(Constants.DefaultTerminalHeight);
}
return Constants.DefaultBufferHeight;
return Constants.DefaultTerminalHeight;
}
}

View File

@ -21,12 +21,12 @@ namespace Spectre.Console.Internal
public int Width
{
get { return ConsoleHelper.GetSafeBufferWidth(Constants.DefaultBufferWidth); }
get { return ConsoleHelper.GetSafeWidth(Constants.DefaultTerminalWidth); }
}
public int Height
{
get { return ConsoleHelper.GetSafeBufferHeight(Constants.DefaultBufferHeight); }
get { return ConsoleHelper.GetSafeHeight(Constants.DefaultTerminalHeight); }
}
public FallbackBackend(TextWriter @out, Capabilities capabilities)