Skip to content

Commit

Permalink
issues #98, #99, #100
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Cerqueira committed Oct 20, 2023
1 parent 186e4d5 commit 34856f0
Show file tree
Hide file tree
Showing 65 changed files with 567 additions and 372 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@
- Optimize Render of ProgressBar (less lines)
- Improvement :
- Optimize Render of SliderNumber (less lines)
- Improvement :
- Added global StyleSchema Ranger/Lines for custom color
- Improvement :
- Added command Styles for custom color in the WaitProcess control
- Improvement :
- Added parameters spinnerStyle and elapsedTimeStyle for custom color in the WaitTimer control
- Improvement :
- Added command HideRange to not show range (Min/Max values) in the SliderNumber control
- Improvement :
- Optimize resource usage in rendering (less cultural dependency)
- Improvement :
Expand Down
2 changes: 1 addition & 1 deletion Samples/BrowserMultSelectSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static void Main(string[] args)
.Root(root, true)
.Styles(StyleBrowser.UnselectedFolder, Style.Default.Foreground(Color.Blue))
.Styles(StyleBrowser.SelectedFolder, Style.Default.Foreground(Color.Yellow))
.Styles(StyleBrowser.Lines, Style.Default.Foreground(Color.Red))
.Config(cfg => cfg.ApplyStyle(StyleControls.Lines, Style.Default.Foreground(Color.Red)))
.Run();

PromptPlus.WriteLines(2);
Expand Down
2 changes: 1 addition & 1 deletion Samples/BrowserSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void Main(string[] args)
.Root(root, true)
.Styles(StyleBrowser.UnselectedFolder, Style.Default.Foreground(Color.Blue))
.Styles(StyleBrowser.SelectedFolder, Style.Default.Foreground(Color.Yellow))
.Styles(StyleBrowser.Lines, Style.Default.Foreground(Color.Red))
.Config(cfg => cfg.ApplyStyle(StyleControls.Lines, Style.Default.Foreground(Color.Red)))
.Run();

PromptPlus.WriteLines(2);
Expand Down
7 changes: 5 additions & 2 deletions Samples/CalendarSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@

PromptPlus
.Calendar("Date", "Select date")
.Styles(StyleCalendar.Line, Style.Default.Foreground(Color.Red))
.Config(cfg =>
{
cfg.ApplyStyle(StyleControls.Lines, Style.Default.Foreground(Color.Red));
cfg.ApplyStyle(StyleControls.Selected, Style.Default.Foreground(Color.Maroon));
})
.Styles(StyleCalendar.Day, Style.Default.Foreground(Color.Yellow))
.Styles(StyleCalendar.Highlight, Style.Default.Foreground(Color.Blue))
.Styles(StyleCalendar.Month, Style.Default.Foreground(Color.Green))
.Styles(StyleCalendar.Selected, Style.Default.Foreground(Color.Maroon))
.Styles(StyleCalendar.WeekDay, Style.Default.Foreground(Color.Aqua))
.Styles(StyleCalendar.Year, Style.Default.Foreground(Color.Violet))
.AddItems(CalendarScope.Highlight,
Expand Down
1 change: 0 additions & 1 deletion Samples/MultiSelectBasicSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ static void Main(string[] args)

//Ensure ValueResult Culture for all controls
PromptPlus.Config.DefaultCulture = new CultureInfo("en-us");

PromptPlus.DoubleDash("Control:MultiSelect - basic usage with PageSize");
var multsel = PromptPlus.MultiSelect<string>("Which cities would you like to visit?")
.AddItems(new []{ "Seattle", "Boston", "New York", "Tokyo", "Singapore", "Shanghai" })
Expand Down
1 change: 0 additions & 1 deletion Samples/SelectBasicSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ static void Main()

//Ensure ValueResult Culture for all controls
PromptPlus.Config.DefaultCulture = new CultureInfo("en-us");

PromptPlus.DoubleDash("Control:Select - basic usage");

var sel = PromptPlus.Select<string>("Select")
Expand Down
11 changes: 11 additions & 0 deletions Samples/SliderNumberLeftRightModeSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ static void Main(string[] args)
.LargeStep(1)
.Run();

PromptPlus.DoubleDash($"Control:SliderNumber {cult} - Hide Range");
PromptPlus
.SliderNumber("SliderNumber")
.Range(-100, 100)
.HideRange()
.Default(0)
.FracionalDig(1)
.Step(0.1)
.LargeStep(1)
.Run();

PromptPlus.DoubleDash($"Control:SliderNumber with culture (pt-br) - normal usage");
PromptPlus
.SliderNumber("SliderNumber")
Expand Down
12 changes: 12 additions & 0 deletions Samples/SliderNumberUpDownModeSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ static void Main(string[] args)
.LargeStep(1)
.Run();

PromptPlus.DoubleDash($"Control:SliderNumber {cult} - Hide Range");
PromptPlus
.SliderNumber("SliderNumber")
.Layout(LayoutSliderNumber.UpDown)
.Range(-100, 100)
.HideRange()
.Default(0)
.FracionalDig(1)
.Step(0.1)
.LargeStep(1)
.Run();

PromptPlus.DoubleDash($"Control:SliderNumber with culture (pt-br) - normal usage");
PromptPlus
.SliderNumber("SliderNumber")
Expand Down
10 changes: 6 additions & 4 deletions Samples/TableBasicSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ static void Main()

PromptPlus.Table<MyTable>("Your Prompt", "Descripion Table")
.AddItems(data)
.Config(cfg =>
{
cfg.ApplyStyle(StyleControls.Lines, Style.Default.Foreground(Color.Red));
cfg.ApplyStyle(StyleControls.Disabled, Style.Default.Foreground(Color.Magenta1));
cfg.ApplyStyle(StyleControls.Selected, Style.Default.Foreground(Color.Aquamarine1));
})
.Styles(TableStyle.Content, Style.Default.Foreground(Color.Yellow))
.Styles(TableStyle.DisabledContent, Style.Default.Foreground(Color.Magenta1))
.Styles(TableStyle.Grid, Style.Default.Foreground(Color.Red))
.Styles(TableStyle.Header, Style.Default.Foreground(Color.Blue))
.Styles(TableStyle.SelectedHeader, Style.Default.Foreground(Color.Aqua))
.Styles(TableStyle.SelectedContent, Style.Default.Foreground(Color.Aquamarine3))
.Styles(TableStyle.Title, Style.Default.Foreground(Color.Cyan1))
.AutoFill(0, 80)
.AddFormatType<DateTime>(FmtDate)
Expand Down
10 changes: 6 additions & 4 deletions Samples/TableMultiSelectSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,14 @@ static void Main()

PromptPlus.TableMultiSelect<MyTable>("Your Prompt", "Descripion Table")
.AddItems(data)
.Config(cfg =>
{
cfg.ApplyStyle(StyleControls.Lines, Style.Default.Foreground(Color.Red));
cfg.ApplyStyle(StyleControls.Disabled, Style.Default.Foreground(Color.Magenta1));
cfg.ApplyStyle(StyleControls.Selected, Style.Default.Foreground(Color.Aquamarine1));
})
.Styles(TableStyle.Content, Style.Default.Foreground(Color.Yellow))
.Styles(TableStyle.DisabledContent, Style.Default.Foreground(Color.Magenta1))
.Styles(TableStyle.Grid, Style.Default.Foreground(Color.Red))
.Styles(TableStyle.Header, Style.Default.Foreground(Color.Blue))
.Styles(TableStyle.SelectedHeader, Style.Default.Foreground(Color.Aqua))
.Styles(TableStyle.SelectedContent, Style.Default.Foreground(Color.Aquamarine3))
.Styles(TableStyle.Title, Style.Default.Foreground(Color.Cyan1))
.AutoFill(0, 80)
.AddFormatType<DateTime>(FmtDate)
Expand Down
10 changes: 6 additions & 4 deletions Samples/TableSelectSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ static void Main()

PromptPlus.TableSelect<MyTable>("Your Prompt", "Descripion Table")
.AddItems(data)
.Config(cfg =>
{
cfg.ApplyStyle(StyleControls.Lines, Style.Default.Foreground(Color.Red));
cfg.ApplyStyle(StyleControls.Disabled, Style.Default.Foreground(Color.Magenta1));
cfg.ApplyStyle(StyleControls.Selected, Style.Default.Foreground(Color.Aquamarine1));
})
.Styles(TableStyle.Content, Style.Default.Foreground(Color.Yellow))
.Styles(TableStyle.DisabledContent, Style.Default.Foreground(Color.Magenta1))
.Styles(TableStyle.Grid, Style.Default.Foreground(Color.Red))
.Styles(TableStyle.Header, Style.Default.Foreground(Color.Blue))
.Styles(TableStyle.SelectedHeader, Style.Default.Foreground(Color.Aqua))
.Styles(TableStyle.SelectedContent, Style.Default.Foreground(Color.Aquamarine3))
.Styles(TableStyle.Title, Style.Default.Foreground(Color.Cyan1))
.AutoFill(0, 80)
.AddFormatType<DateTime>(FmtDate)
Expand Down
1 change: 1 addition & 0 deletions Samples/TreeViewMultiSelectSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ static void Main(string[] args)

//Ensure ValueResult Culture for all controls
PromptPlus.Config.DefaultCulture = new CultureInfo("en-us");

PromptPlus.WriteLine("Hello, World!");
PromptPlus.DoubleDash("Control:TreeView - Common usage");

Expand Down
19 changes: 19 additions & 0 deletions Samples/WaitTasksSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ static void Main(string[] args)
1, 2, 3, 4, 5, 6, 7
};

PromptPlus.DoubleDash($"Control:WaitProcess - Custom Color");
wt1 = PromptPlus.WaitProcess<object>("wait process", "main desc")
.Finish($"end wait all process")
.TaskTitle("MyProcess")
.MaxDegreeProcess(4)
.Interaction(steps2.Take(5), (ctrl, item) =>
{
ctrl.AddStep(StepMode.Parallel, $"id{item}", null,
(eventw, cts) =>
{
cts.WaitHandle.WaitOne(TimeSpan.FromSeconds(item));
});
})
.ShowElapsedTime()
.Config(cfg => cfg.ApplyStyle(StyleControls.Lines, Style.Default.Foreground(Color.Red)))
.Styles(StyleWait.Label, Style.Default.Foreground(Color.Blue))
.Styles(StyleWait.ElapsedTime, Style.Default.Foreground(Color.Green))
.Run();


PromptPlus.DoubleDash($"Control:WaitProcess - normal usage Parallel mode");
wt1 = PromptPlus.WaitProcess<object>("wait process", "main desc")
Expand Down
8 changes: 8 additions & 0 deletions Samples/WaitTimerSamples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ static void Main(string[] args)
PromptPlus.DoubleDash($"Control:WaitTimer - Countdown usage ");
PromptPlus.WaitTimer($"wait time", TimeSpan.FromSeconds(2),showCountdown: true);

PromptPlus.DoubleDash($"Control:WaitTimer - Custom Color usage ");
PromptPlus.WaitTimer($"wait time",
TimeSpan.FromSeconds(2),
spinnerStyle: Style.Default.Foreground(Color.Red),
elapsedTimeStyle: Style.Default.Foreground(Color.Green),
showCountdown: true);


PromptPlus.DoubleDash($"Control:WaitTimer - with no hide after");
PromptPlus.WaitTimer($"wait time", TimeSpan.FromSeconds(3), SpinnersType.Ascii, true, (cfg) =>
{
Expand Down
Loading

0 comments on commit 34856f0

Please sign in to comment.