From 34856f06bd6b454ab2b8d4e88feb3e1193c9f3bd Mon Sep 17 00:00:00 2001 From: Fernando Cerqueira Date: Fri, 20 Oct 2023 17:22:54 -0300 Subject: [PATCH] issues #98, #99, #100 --- README.md | 8 + Samples/BrowserMultSelectSamples/Program.cs | 2 +- Samples/BrowserSamples/Program.cs | 2 +- Samples/CalendarSamples/Program.cs | 7 +- Samples/MultiSelectBasicSamples/Program.cs | 1 - Samples/SelectBasicSamples/Program.cs | 1 - .../Program.cs | 11 ++ .../SliderNumberUpDownModeSamples/Program.cs | 12 ++ Samples/TableBasicSamples/Program.cs | 10 +- Samples/TableMultiSelectSamples/Program.cs | 10 +- Samples/TableSelectSamples/Program.cs | 10 +- Samples/TreeViewMultiSelectSamples/Program.cs | 1 + Samples/WaitTasksSamples/Program.cs | 19 ++ Samples/WaitTimerSamples/Program.cs | 8 + Src/Controls/Calendar/CalendarControl.cs | 179 +++++++++--------- Src/Controls/Calendar/CalendarOptions.cs | 6 - Src/Controls/Calendar/StyleCalendar.cs | 12 -- .../ScreenBufferMultiSelect.cs | 12 +- .../SelectColletion/ScreenBufferSelect.cs | 6 +- Src/Controls/Slider/IControlSliderNumber.cs | 7 + .../Slider/ScreenBufferSliderNumber.cs | 12 +- Src/Controls/Slider/SliderNumberControl.cs | 11 +- Src/Controls/Slider/SliderNumberOptions.cs | 1 + Src/Controls/StyleControls.cs | 10 +- Src/Controls/StyleSchema.cs | 14 +- Src/Controls/StyleSchemaExtensions.cs | 73 ++++--- Src/Controls/Table/TableControl.cs | 29 +-- Src/Controls/Table/TableMultiSelectControl.cs | 39 +--- Src/Controls/Table/TableOptions.cs | 12 -- Src/Controls/Table/TableSelectControl.cs | 30 +-- Src/Controls/Table/TableStyle.cs | 18 +- Src/Controls/TasksProcess/IControlWait.cs | 8 + .../TasksProcess/ProgressBarControl.cs | 4 +- Src/Controls/TasksProcess/StyleWait.cs | 22 +++ Src/Controls/TasksProcess/WaitControl.cs | 28 ++- Src/Controls/TasksProcess/WaitExtensions.cs | 12 +- Src/Controls/TasksProcess/WaitOptions.cs | 5 + .../TreeDiagram/BrowserMultiSelectControl.cs | 3 - Src/Controls/TreeDiagram/BrowserOptions.cs | 2 - .../TreeDiagram/BrowserSelectControl.cs | 3 - .../ScreenBufferBrowserMultiSelect.cs | 8 +- .../TreeDiagram/ScreenBufferBrowserSelect.cs | 8 +- .../ScreenBufferTreeViewMultiSelect.cs | 8 +- .../TreeDiagram/ScreenBufferTreeViewSelect.cs | 8 +- Src/Controls/TreeDiagram/StyleBrowser.cs | 4 - Src/Controls/TreeDiagram/StyleTreeView.cs | 4 - .../TreeDiagram/TreeViewMultiSelectControl.cs | 3 - Src/Controls/TreeDiagram/TreeViewOptions.cs | 2 - .../TreeDiagram/TreeViewSelectControl.cs | 3 - Src/Drivers/ConsoleDriveMemory.cs | 1 - Src/Drivers/ConsoleDriveWindows.cs | 1 - Src/NugetREADME.md | 8 + Src/README.txt | 8 + docs/apis/apis.md | 2 + .../pplus.controls.icontrolslidernumber.md | 17 ++ docs/apis/pplus.controls.icontrolwait-1.md | 20 ++ docs/apis/pplus.controls.stylebrowser.md | 21 +- docs/apis/pplus.controls.stylecalendar.md | 13 +- docs/apis/pplus.controls.stylecontrols.md | 2 + .../pplus.controls.styleschemaextensions.md | 60 ++++-- docs/apis/pplus.controls.styletreeview.md | 17 +- docs/apis/pplus.controls.stylewait.md | 33 ++++ docs/apis/pplus.controls.tablestyle.md | 10 +- docs/apis/pplus.promptplus.md | 10 +- docs/index.md | 8 + 65 files changed, 567 insertions(+), 372 deletions(-) create mode 100644 Src/Controls/TasksProcess/StyleWait.cs create mode 100644 docs/apis/pplus.controls.stylewait.md diff --git a/README.md b/README.md index 3db0c2f5..8da2cd8a 100644 --- a/README.md +++ b/README.md @@ -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 : diff --git a/Samples/BrowserMultSelectSamples/Program.cs b/Samples/BrowserMultSelectSamples/Program.cs index 42985a36..83fbb170 100644 --- a/Samples/BrowserMultSelectSamples/Program.cs +++ b/Samples/BrowserMultSelectSamples/Program.cs @@ -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); diff --git a/Samples/BrowserSamples/Program.cs b/Samples/BrowserSamples/Program.cs index f35cb438..79220ecc 100644 --- a/Samples/BrowserSamples/Program.cs +++ b/Samples/BrowserSamples/Program.cs @@ -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); diff --git a/Samples/CalendarSamples/Program.cs b/Samples/CalendarSamples/Program.cs index c07d4a37..358ca7c3 100644 --- a/Samples/CalendarSamples/Program.cs +++ b/Samples/CalendarSamples/Program.cs @@ -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, diff --git a/Samples/MultiSelectBasicSamples/Program.cs b/Samples/MultiSelectBasicSamples/Program.cs index cd307b57..9e0c4ca4 100644 --- a/Samples/MultiSelectBasicSamples/Program.cs +++ b/Samples/MultiSelectBasicSamples/Program.cs @@ -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("Which cities would you like to visit?") .AddItems(new []{ "Seattle", "Boston", "New York", "Tokyo", "Singapore", "Shanghai" }) diff --git a/Samples/SelectBasicSamples/Program.cs b/Samples/SelectBasicSamples/Program.cs index e5ab62b7..b4a8c92a 100644 --- a/Samples/SelectBasicSamples/Program.cs +++ b/Samples/SelectBasicSamples/Program.cs @@ -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("Select") diff --git a/Samples/SliderNumberLeftRightModeSamples/Program.cs b/Samples/SliderNumberLeftRightModeSamples/Program.cs index 937295d0..33a8910a 100644 --- a/Samples/SliderNumberLeftRightModeSamples/Program.cs +++ b/Samples/SliderNumberLeftRightModeSamples/Program.cs @@ -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") diff --git a/Samples/SliderNumberUpDownModeSamples/Program.cs b/Samples/SliderNumberUpDownModeSamples/Program.cs index e0e0d089..11076673 100644 --- a/Samples/SliderNumberUpDownModeSamples/Program.cs +++ b/Samples/SliderNumberUpDownModeSamples/Program.cs @@ -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") diff --git a/Samples/TableBasicSamples/Program.cs b/Samples/TableBasicSamples/Program.cs index f815495e..f9ff23b8 100644 --- a/Samples/TableBasicSamples/Program.cs +++ b/Samples/TableBasicSamples/Program.cs @@ -75,12 +75,14 @@ static void Main() PromptPlus.Table("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(FmtDate) diff --git a/Samples/TableMultiSelectSamples/Program.cs b/Samples/TableMultiSelectSamples/Program.cs index 4dcba47f..99382d95 100644 --- a/Samples/TableMultiSelectSamples/Program.cs +++ b/Samples/TableMultiSelectSamples/Program.cs @@ -112,12 +112,14 @@ static void Main() PromptPlus.TableMultiSelect("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(FmtDate) diff --git a/Samples/TableSelectSamples/Program.cs b/Samples/TableSelectSamples/Program.cs index e053627f..4025f07a 100644 --- a/Samples/TableSelectSamples/Program.cs +++ b/Samples/TableSelectSamples/Program.cs @@ -124,12 +124,14 @@ static void Main() PromptPlus.TableSelect("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(FmtDate) diff --git a/Samples/TreeViewMultiSelectSamples/Program.cs b/Samples/TreeViewMultiSelectSamples/Program.cs index 5f963f26..a5763fd5 100644 --- a/Samples/TreeViewMultiSelectSamples/Program.cs +++ b/Samples/TreeViewMultiSelectSamples/Program.cs @@ -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"); diff --git a/Samples/WaitTasksSamples/Program.cs b/Samples/WaitTasksSamples/Program.cs index 080e507d..e3e24b3d 100644 --- a/Samples/WaitTasksSamples/Program.cs +++ b/Samples/WaitTasksSamples/Program.cs @@ -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("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("wait process", "main desc") diff --git a/Samples/WaitTimerSamples/Program.cs b/Samples/WaitTimerSamples/Program.cs index bd413455..6ecfc2f3 100644 --- a/Samples/WaitTimerSamples/Program.cs +++ b/Samples/WaitTimerSamples/Program.cs @@ -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) => { diff --git a/Src/Controls/Calendar/CalendarControl.cs b/Src/Controls/Calendar/CalendarControl.cs index f889080d..3251e48c 100644 --- a/Src/Controls/Calendar/CalendarControl.cs +++ b/Src/Controls/Calendar/CalendarControl.cs @@ -158,15 +158,6 @@ public IControlCalendar Styles(StyleCalendar styletype, Style value) { switch (styletype) { - case StyleCalendar.Line: - _options.LineStyle = value; - break; - case StyleCalendar.Disabled: - _options.DisabledStyle = value; - break; - case StyleCalendar.Selected: - _options.SelectedStyle = value; - break; case StyleCalendar.Highlight: _options.HighlightStyle = value; break; @@ -1075,16 +1066,16 @@ private void WriteCalendarAsciiSingleGrid(ScreenBuffer screenBuffer, DateTime cu curmonth = $"{curmonth[..1].ToUpperInvariant()}{curmonth[1..]}"; var curyear = currentdate.Date.ToString("yyyy", _options.CurrentCulture); - screenBuffer.AddBuffer("+-----------------------------------+", _options.LineStyle); + screenBuffer.AddBuffer("+-----------------------------------+", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer($" {curmonth}", _options.MonthStyle); screenBuffer.AddBuffer($" {curyear} ", _options.YearStyle); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("|-----------------------------------|", _options.LineStyle); + screenBuffer.AddBuffer("|-----------------------------------|", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { var abr = _options.CurrentCulture.DateTimeFormat.AbbreviatedDayNames[(int)item]; @@ -1100,7 +1091,7 @@ private void WriteCalendarAsciiSingleGrid(ScreenBuffer screenBuffer, DateTime cu if (item == _currentdate.DayOfWeek) { abr = $"<{abr}>"; - screenBuffer.AddBuffer(abr, _options.SelectedStyle); + screenBuffer.AddBuffer(abr, _options.OptStyleSchema.Selected()); } else { @@ -1108,19 +1099,19 @@ private void WriteCalendarAsciiSingleGrid(ScreenBuffer screenBuffer, DateTime cu screenBuffer.AddBuffer(abr, _options.WeekDayStyle); } } - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("|-----------------------------------|", _options.LineStyle); + screenBuffer.AddBuffer("|-----------------------------------|", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); var auxdate = new DateTime(_currentdate.Year, _currentdate.Month, 1); var weekdays = MonthWeekDays(DateTime.DaysInMonth(_currentdate.Year, _currentdate.Month)); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { if (item != weekdays[auxdate.Day - 1]) { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } else { @@ -1128,12 +1119,12 @@ private void WriteCalendarAsciiSingleGrid(ScreenBuffer screenBuffer, DateTime cu auxdate = auxdate.AddDays(1); } } - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); var maxdate = false; while (auxdate.Month == _currentdate.Month) { screenBuffer.NewLine(); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); for (int i = 0; i < 7; i++) { if (auxdate.Month == _currentdate.Month) @@ -1147,7 +1138,7 @@ private void WriteCalendarAsciiSingleGrid(ScreenBuffer screenBuffer, DateTime cu } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } else @@ -1158,13 +1149,13 @@ private void WriteCalendarAsciiSingleGrid(ScreenBuffer screenBuffer, DateTime cu } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); } screenBuffer.NewLine(); - screenBuffer.AddBuffer("+-----------------------------------+", _options.LineStyle); + screenBuffer.AddBuffer("+-----------------------------------+", _options.OptStyleSchema.Lines()); } private void WriteCalendarAsciiDoubleGrid(ScreenBuffer screenBuffer, DateTime currentdate) @@ -1173,16 +1164,16 @@ private void WriteCalendarAsciiDoubleGrid(ScreenBuffer screenBuffer, DateTime cu curmonth = $"{curmonth[..1].ToUpperInvariant()}{curmonth[1..]}"; var curyear = currentdate.Date.ToString("yyyy", _options.CurrentCulture); - screenBuffer.AddBuffer("+===================================+", _options.LineStyle); + screenBuffer.AddBuffer("+===================================+", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer($" {curmonth}", _options.MonthStyle); screenBuffer.AddBuffer($" {curyear} ", _options.YearStyle); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("|===================================|", _options.LineStyle); + screenBuffer.AddBuffer("|===================================|", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { var abr = _options.CurrentCulture.DateTimeFormat.AbbreviatedDayNames[(int)item]; @@ -1198,7 +1189,7 @@ private void WriteCalendarAsciiDoubleGrid(ScreenBuffer screenBuffer, DateTime cu if (item == _currentdate.DayOfWeek) { abr = $"<{abr}>"; - screenBuffer.AddBuffer(abr, _options.SelectedStyle); + screenBuffer.AddBuffer(abr, _options.OptStyleSchema.Selected()); } else { @@ -1206,19 +1197,19 @@ private void WriteCalendarAsciiDoubleGrid(ScreenBuffer screenBuffer, DateTime cu screenBuffer.AddBuffer(abr, _options.WeekDayStyle); } } - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("|===================================|", _options.LineStyle); + screenBuffer.AddBuffer("|===================================|", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); var auxdate = new DateTime(_currentdate.Year, _currentdate.Month, 1); var weekdays = MonthWeekDays(DateTime.DaysInMonth(_currentdate.Year, _currentdate.Month)); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { if (item != weekdays[auxdate.Day - 1]) { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } else { @@ -1226,12 +1217,12 @@ private void WriteCalendarAsciiDoubleGrid(ScreenBuffer screenBuffer, DateTime cu auxdate = auxdate.AddDays(1); } } - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); var maxdate = false; while (auxdate.Month == _currentdate.Month) { screenBuffer.NewLine(); - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); for (int i = 0; i < 7; i++) { if (auxdate.Month == _currentdate.Month) @@ -1245,7 +1236,7 @@ private void WriteCalendarAsciiDoubleGrid(ScreenBuffer screenBuffer, DateTime cu } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } else @@ -1256,13 +1247,13 @@ private void WriteCalendarAsciiDoubleGrid(ScreenBuffer screenBuffer, DateTime cu } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } - screenBuffer.AddBuffer('|', _options.LineStyle); + screenBuffer.AddBuffer('|', _options.OptStyleSchema.Lines()); } screenBuffer.NewLine(); - screenBuffer.AddBuffer("+===================================+", _options.LineStyle); + screenBuffer.AddBuffer("+===================================+", _options.OptStyleSchema.Lines()); } private void WriteCalendarSingleGrid(ScreenBuffer screenBuffer, DateTime currentdate) @@ -1271,16 +1262,16 @@ private void WriteCalendarSingleGrid(ScreenBuffer screenBuffer, DateTime current curmonth = $"{curmonth[..1].ToUpperInvariant()}{curmonth[1..]}"; var curyear = currentdate.Date.ToString("yyyy", _options.CurrentCulture); - screenBuffer.AddBuffer("┌───────────────────────────────────┐", _options.LineStyle); + screenBuffer.AddBuffer("┌───────────────────────────────────┐", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer($" {curmonth}", _options.MonthStyle); screenBuffer.AddBuffer($" {curyear} ", _options.YearStyle); - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("├───────────────────────────────────┤", _options.LineStyle); + screenBuffer.AddBuffer("├───────────────────────────────────┤", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) @@ -1298,7 +1289,7 @@ private void WriteCalendarSingleGrid(ScreenBuffer screenBuffer, DateTime current if (item == _currentdate.DayOfWeek) { abr = $"<{abr}>"; - screenBuffer.AddBuffer(abr, _options.SelectedStyle); + screenBuffer.AddBuffer(abr, _options.OptStyleSchema.Selected()); } else { @@ -1306,19 +1297,19 @@ private void WriteCalendarSingleGrid(ScreenBuffer screenBuffer, DateTime current screenBuffer.AddBuffer(abr, _options.WeekDayStyle); } } - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("├───────────────────────────────────┤", _options.LineStyle); + screenBuffer.AddBuffer("├───────────────────────────────────┤", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); var auxdate = new DateTime(_currentdate.Year, _currentdate.Month, 1); var weekdays = MonthWeekDays(DateTime.DaysInMonth(_currentdate.Year, _currentdate.Month)); - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { if (item != weekdays[auxdate.Day - 1]) { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } else { @@ -1326,12 +1317,12 @@ private void WriteCalendarSingleGrid(ScreenBuffer screenBuffer, DateTime current auxdate = auxdate.AddDays(1); } } - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); var maxdate = false; while (auxdate.Month == _currentdate.Month) { screenBuffer.NewLine(); - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); for (int i = 0; i < 7; i++) { if (auxdate.Month == _currentdate.Month) @@ -1345,7 +1336,7 @@ private void WriteCalendarSingleGrid(ScreenBuffer screenBuffer, DateTime current } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } else @@ -1356,17 +1347,17 @@ private void WriteCalendarSingleGrid(ScreenBuffer screenBuffer, DateTime current } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } - screenBuffer.AddBuffer('│', _options.LineStyle); + screenBuffer.AddBuffer('│', _options.OptStyleSchema.Lines()); if (auxdate.Date == DateTime.MaxValue.Date) { break; } } screenBuffer.NewLine(); - screenBuffer.AddBuffer("└───────────────────────────────────┘", _options.LineStyle); + screenBuffer.AddBuffer("└───────────────────────────────────┘", _options.OptStyleSchema.Lines()); } private void WriteCalendarDoubleGrid(ScreenBuffer screenBuffer, DateTime currentdate) @@ -1375,16 +1366,16 @@ private void WriteCalendarDoubleGrid(ScreenBuffer screenBuffer, DateTime current curmonth = $"{curmonth[..1].ToUpperInvariant()}{curmonth[1..]}"; var curyear = currentdate.Date.ToString("yyyy", _options.CurrentCulture); - screenBuffer.AddBuffer("╔═══════════════════════════════════╗", _options.LineStyle); + screenBuffer.AddBuffer("╔═══════════════════════════════════╗", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer($" {curmonth}", _options.MonthStyle); screenBuffer.AddBuffer($" {curyear} ", _options.YearStyle); - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("╠═══════════════════════════════════╣", _options.LineStyle); + screenBuffer.AddBuffer("╠═══════════════════════════════════╣", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) @@ -1402,7 +1393,7 @@ private void WriteCalendarDoubleGrid(ScreenBuffer screenBuffer, DateTime current if (item == _currentdate.DayOfWeek) { abr = $"<{abr}>"; - screenBuffer.AddBuffer(abr, _options.SelectedStyle); + screenBuffer.AddBuffer(abr, _options.OptStyleSchema.Selected()); } else { @@ -1410,19 +1401,19 @@ private void WriteCalendarDoubleGrid(ScreenBuffer screenBuffer, DateTime current screenBuffer.AddBuffer(abr, _options.WeekDayStyle); } } - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("╠═══════════════════════════════════╣", _options.LineStyle); + screenBuffer.AddBuffer("╠═══════════════════════════════════╣", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); var auxdate = new DateTime(_currentdate.Year, _currentdate.Month, 1); var weekdays = MonthWeekDays(DateTime.DaysInMonth(_currentdate.Year, _currentdate.Month)); - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { if (item != weekdays[auxdate.Day - 1]) { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } else { @@ -1430,12 +1421,12 @@ private void WriteCalendarDoubleGrid(ScreenBuffer screenBuffer, DateTime current auxdate = auxdate.AddDays(1); } } - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); var maxdate = false; while (auxdate.Month == _currentdate.Month) { screenBuffer.NewLine(); - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); for (int i = 0; i < 7; i++) { if (auxdate.Month == _currentdate.Month) @@ -1449,7 +1440,7 @@ private void WriteCalendarDoubleGrid(ScreenBuffer screenBuffer, DateTime current } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } else @@ -1460,13 +1451,13 @@ private void WriteCalendarDoubleGrid(ScreenBuffer screenBuffer, DateTime current } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } - screenBuffer.AddBuffer('║', _options.LineStyle); + screenBuffer.AddBuffer('║', _options.OptStyleSchema.Lines()); } screenBuffer.NewLine(); - screenBuffer.AddBuffer("╚═══════════════════════════════════╝", _options.LineStyle); + screenBuffer.AddBuffer("╚═══════════════════════════════════╝", _options.OptStyleSchema.Lines()); } private void WriteCalendarHeavyGrid(ScreenBuffer screenBuffer, DateTime currentdate) @@ -1475,16 +1466,16 @@ private void WriteCalendarHeavyGrid(ScreenBuffer screenBuffer, DateTime currentd curmonth = $"{curmonth[..1].ToUpperInvariant()}{curmonth[1..]}"; var curyear = currentdate.Date.ToString("yyyy", _options.CurrentCulture); - screenBuffer.AddBuffer("▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌", _options.LineStyle); + screenBuffer.AddBuffer("▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('▐', _options.LineStyle); + screenBuffer.AddBuffer('▐', _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer($" {curmonth}", _options.MonthStyle); screenBuffer.AddBuffer($" {curyear} ", _options.YearStyle); - screenBuffer.AddBuffer('▌', _options.LineStyle); + screenBuffer.AddBuffer('▌', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌", _options.LineStyle); + screenBuffer.AddBuffer("▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer('▐', _options.LineStyle); + screenBuffer.AddBuffer('▐', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { var abr = _options.CurrentCulture.DateTimeFormat.AbbreviatedDayNames[(int)item]; @@ -1500,7 +1491,7 @@ private void WriteCalendarHeavyGrid(ScreenBuffer screenBuffer, DateTime currentd if (item == _currentdate.DayOfWeek) { abr = $"<{abr}>"; - screenBuffer.AddBuffer(abr, _options.SelectedStyle); + screenBuffer.AddBuffer(abr, _options.OptStyleSchema.Selected()); } else { @@ -1508,19 +1499,19 @@ private void WriteCalendarHeavyGrid(ScreenBuffer screenBuffer, DateTime currentd screenBuffer.AddBuffer(abr, _options.WeekDayStyle); } } - screenBuffer.AddBuffer('▌', _options.LineStyle); + screenBuffer.AddBuffer('▌', _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); - screenBuffer.AddBuffer("▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌", _options.LineStyle); + screenBuffer.AddBuffer("▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌", _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); var auxdate = new DateTime(_currentdate.Year, _currentdate.Month, 1); var weekdays = MonthWeekDays(DateTime.DaysInMonth(_currentdate.Year, _currentdate.Month)); - screenBuffer.AddBuffer('▐', _options.LineStyle); + screenBuffer.AddBuffer('▐', _options.OptStyleSchema.Lines()); foreach (var item in _Weekdays) { if (item != weekdays[auxdate.Day - 1]) { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } else { @@ -1528,12 +1519,12 @@ private void WriteCalendarHeavyGrid(ScreenBuffer screenBuffer, DateTime currentd auxdate = auxdate.AddDays(1); } } - screenBuffer.AddBuffer('▌', _options.LineStyle); + screenBuffer.AddBuffer('▌', _options.OptStyleSchema.Lines()); var maxdate = false; while (auxdate.Month == _currentdate.Month) { screenBuffer.NewLine(); - screenBuffer.AddBuffer('▐', _options.LineStyle); + screenBuffer.AddBuffer('▐', _options.OptStyleSchema.Lines()); for (int i = 0; i < 7; i++) { if (auxdate.Month == _currentdate.Month) @@ -1547,7 +1538,7 @@ private void WriteCalendarHeavyGrid(ScreenBuffer screenBuffer, DateTime currentd } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } else @@ -1558,13 +1549,13 @@ private void WriteCalendarHeavyGrid(ScreenBuffer screenBuffer, DateTime currentd } else { - screenBuffer.AddBuffer(" ", _options.LineStyle); + screenBuffer.AddBuffer(" ", _options.OptStyleSchema.Lines()); } } - screenBuffer.AddBuffer('▌', _options.LineStyle); + screenBuffer.AddBuffer('▌', _options.OptStyleSchema.Lines()); } screenBuffer.NewLine(); - screenBuffer.AddBuffer("▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌", _options.LineStyle); + screenBuffer.AddBuffer("▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌", _options.OptStyleSchema.Lines()); } private void WriteNotes(ScreenBuffer screenBuffer) @@ -1600,7 +1591,7 @@ private void WriteDay(ScreenBuffer screenBuffer, DateTime auxdate) } if (IsDateDisable(auxdate)) { - screenBuffer.AddBuffer($" {strnote}{cday} ", _options.DisabledStyle); + screenBuffer.AddBuffer($" {strnote}{cday} ", _options.OptStyleSchema.Disabled()); } else if (auxdate == _currentdate) { @@ -1608,22 +1599,22 @@ private void WriteDay(ScreenBuffer screenBuffer, DateTime auxdate) { if (strnote == "*") { - screenBuffer.AddBuffer($"#{strnote}{cday}#", _options.SelectedStyle); + screenBuffer.AddBuffer($"#{strnote}{cday}#", _options.OptStyleSchema.Selected()); } else { - screenBuffer.AddBuffer($" #{cday}#", _options.SelectedStyle); + screenBuffer.AddBuffer($" #{cday}#", _options.OptStyleSchema.Selected()); } } else { if (strnote == "*") { - screenBuffer.AddBuffer($"<{strnote}{cday}>", _options.SelectedStyle); + screenBuffer.AddBuffer($"<{strnote}{cday}>", _options.OptStyleSchema.Selected()); } else { - screenBuffer.AddBuffer($" <{cday}>", _options.SelectedStyle); + screenBuffer.AddBuffer($" <{cday}>", _options.OptStyleSchema.Selected()); } } } diff --git a/Src/Controls/Calendar/CalendarOptions.cs b/Src/Controls/Calendar/CalendarOptions.cs index 028176ba..3b4e2b57 100644 --- a/Src/Controls/Calendar/CalendarOptions.cs +++ b/Src/Controls/Calendar/CalendarOptions.cs @@ -23,9 +23,6 @@ internal CalendarOptions(StyleSchema styleSchema, ConfigControls config, IConsol ItemsNotes = new(); Itemshighlight = new(); DescriptionStyle = styleSchema.Description(); - LineStyle = styleSchema.Prompt(); - DisabledStyle = styleSchema.Disabled(); - SelectedStyle = styleSchema.Selected(); HighlightStyle = styleSchema.TaggedInfo(); DayStyle = styleSchema.Prompt(); MonthStyle = styleSchema.Prompt(); @@ -38,9 +35,6 @@ internal CalendarOptions(StyleSchema styleSchema, ConfigControls config, IConsol public CultureInfo CurrentCulture { get; set; } = null; public PolicyInvalidDate PolicyInvalidDate { get; set; } = PolicyInvalidDate.NextDate; public Style DescriptionStyle { get; set; } - public Style LineStyle { get; set; } - public Style DisabledStyle { get; set; } - public Style SelectedStyle { get; set; } public Style HighlightStyle { get; set; } public Style DayStyle { get; set; } public Style MonthStyle { get; set; } diff --git a/Src/Controls/Calendar/StyleCalendar.cs b/Src/Controls/Calendar/StyleCalendar.cs index 7b1412bd..48380bbd 100644 --- a/Src/Controls/Calendar/StyleCalendar.cs +++ b/Src/Controls/Calendar/StyleCalendar.cs @@ -10,18 +10,6 @@ namespace PPlus.Controls /// public enum StyleCalendar { - /// - /// lines content - /// - Line, - /// - /// Disabled content - /// - Disabled, - /// - /// Selected content - /// - Selected, /// /// Highlight content /// diff --git a/Src/Controls/SelectColletion/ScreenBufferMultiSelect.cs b/Src/Controls/SelectColletion/ScreenBufferMultiSelect.cs index b568caaa..3755f266 100644 --- a/Src/Controls/SelectColletion/ScreenBufferMultiSelect.cs +++ b/Src/Controls/SelectColletion/ScreenBufferMultiSelect.cs @@ -86,7 +86,7 @@ public static void WriteLineIndentCheckSelect(this ScreenBuffer screenBuffer, Ba screenBuffer.NewLine(); } screenBuffer.AddBuffer($"{options.Symbol(SymbolType.Selector)} {options.Symbol(SymbolType.Selected)} ", options.OptStyleSchema.Selected(), true); - screenBuffer.AddBuffer(message, options.OptStyleSchema.UnSelected(),true,false); + screenBuffer.AddBuffer(message, options.OptStyleSchema.Lines(),true,false); } public static void WriteLineIndentCheckUnSelect(this ScreenBuffer screenBuffer, BaseOptions options, string message, bool newline = true) @@ -96,7 +96,7 @@ public static void WriteLineIndentCheckUnSelect(this ScreenBuffer screenBuffer, screenBuffer.NewLine(); } screenBuffer.AddBuffer($" {options.Symbol(SymbolType.Selected)} ", options.OptStyleSchema.Disabled(), true); - screenBuffer.AddBuffer(message, options.OptStyleSchema.Disabled(), true, false); + screenBuffer.AddBuffer(message, options.OptStyleSchema.Lines(), true, false); } public static void WriteCheckValueSelect(this ScreenBuffer screenBuffer, BaseOptions options, string message) @@ -114,7 +114,7 @@ public static void WriteLineIndentCheckNotSelect(this ScreenBuffer screenBuffer, screenBuffer.NewLine(); } screenBuffer.AddBuffer($" {options.Symbol(SymbolType.Selected)} ", options.OptStyleSchema.UnSelected(), true); - screenBuffer.AddBuffer(message, options.OptStyleSchema.UnSelected(), false, false); + screenBuffer.AddBuffer(message, options.OptStyleSchema.Lines(), false, false); } public static void WriteCheckValueNotSelect(this ScreenBuffer screenBuffer, BaseOptions options, string message) @@ -132,7 +132,7 @@ public static void WriteLineIndentUncheckedDisabled(this ScreenBuffer screenBuff screenBuffer.NewLine(); } screenBuffer.AddBuffer($" {options.Symbol(SymbolType.NotSelect)} ", options.OptStyleSchema.Disabled(), true); - screenBuffer.AddBuffer(message, options.OptStyleSchema.UnSelected(),false,false); + screenBuffer.AddBuffer(message, options.OptStyleSchema.Lines(),false,false); } public static void WriteUncheckedValueDisabled(this ScreenBuffer screenBuffer, BaseOptions options, string message) @@ -158,7 +158,7 @@ public static void WriteLineIndentUncheckedSelect(this ScreenBuffer screenBuffer screenBuffer.NewLine(); } screenBuffer.AddBuffer($"{options.Symbol(SymbolType.Selector)} {options.Symbol(SymbolType.NotSelect)} ", options.OptStyleSchema.Selected(),true); - screenBuffer.AddBuffer(message, options.OptStyleSchema.UnSelected(), false, false); + screenBuffer.AddBuffer(message, options.OptStyleSchema.Lines(), false, false); } public static void WriteUncheckedValueSelect(this ScreenBuffer screenBuffer, BaseOptions options, string message) { @@ -175,7 +175,7 @@ public static void WriteLineIndentUncheckedNotSelect(this ScreenBuffer screenBuf screenBuffer.NewLine(); } screenBuffer.AddBuffer($" {options.Symbol(SymbolType.NotSelect)} ", options.OptStyleSchema.UnSelected(),true); - screenBuffer.AddBuffer(message, options.OptStyleSchema.UnSelected(), false, false); + screenBuffer.AddBuffer(message, options.OptStyleSchema.Lines(), false, false); } public static void WriteUncheckedValueNotSelect(this ScreenBuffer screenBuffer, BaseOptions options, string message) diff --git a/Src/Controls/SelectColletion/ScreenBufferSelect.cs b/Src/Controls/SelectColletion/ScreenBufferSelect.cs index d9ecee76..5bab3c2c 100644 --- a/Src/Controls/SelectColletion/ScreenBufferSelect.cs +++ b/Src/Controls/SelectColletion/ScreenBufferSelect.cs @@ -68,7 +68,7 @@ public static void WriteLineNotSelectorDisabled(this ScreenBuffer screenBuffer, } else { - screenBuffer.AddBuffer($" {indentgroup}", Style.Default, true); + screenBuffer.AddBuffer($" {indentgroup}", options.OptStyleSchema.Lines(), true); screenBuffer.AddBuffer($" {message}", options.OptStyleSchema.Disabled(), false, false); } } @@ -86,7 +86,7 @@ public static void WriteLineSelector(this ScreenBuffer screenBuffer, BaseOptions else { screenBuffer.AddBuffer($"{options.Symbol(SymbolType.Selector)}", options.OptStyleSchema.Selected(), false); - screenBuffer.AddBuffer($"{indentgroup}", Style.Default, true); + screenBuffer.AddBuffer($"{indentgroup}", options.OptStyleSchema.Lines(), true); screenBuffer.AddBuffer($" {message}", options.OptStyleSchema.Selected(), false); } } @@ -104,7 +104,7 @@ public static void WriteLineNotSelector(this ScreenBuffer screenBuffer, BaseOpti } else { - screenBuffer.AddBuffer($" {indentgroup}", Style.Default, true); + screenBuffer.AddBuffer($" {indentgroup}", options.OptStyleSchema.Lines(), true); screenBuffer.AddBuffer($" {message}", options.OptStyleSchema.UnSelected(), false, false); } } diff --git a/Src/Controls/Slider/IControlSliderNumber.cs b/Src/Controls/Slider/IControlSliderNumber.cs index beab2b1d..3aeec191 100644 --- a/Src/Controls/Slider/IControlSliderNumber.cs +++ b/Src/Controls/Slider/IControlSliderNumber.cs @@ -76,6 +76,13 @@ public interface IControlSliderNumber : IPromptControls /// IControlSliderNumber Range(double minvalue, double maxvalue); + /// + /// Hide min./max elements in slider. Default is Show + /// + /// True for hide,false for show + /// + IControlSliderNumber HideRange(bool value = true); + /// /// Define the short step to change. Default value is 1/100 of range /// diff --git a/Src/Controls/Slider/ScreenBufferSliderNumber.cs b/Src/Controls/Slider/ScreenBufferSliderNumber.cs index fdbead1a..8941c195 100644 --- a/Src/Controls/Slider/ScreenBufferSliderNumber.cs +++ b/Src/Controls/Slider/ScreenBufferSliderNumber.cs @@ -59,7 +59,10 @@ public static void WriteLineWidgetsSliderNumber(this ScreenBuffer screenBuffer, { screenBuffer.NewLine(); } - screenBuffer.AddBuffer($"{options.ValueToString(options.Minvalue)} ", options.OptStyleSchema.UnSelected(),true); + if (!options.HideRanger) + { + screenBuffer.AddBuffer($"{options.ValueToString(options.Minvalue)} ", options.OptStyleSchema.Ranger(), true); + } if (options.ChangeColor != null) { var color = options.ChangeColor(input); @@ -110,8 +113,11 @@ public static void WriteLineWidgetsSliderNumber(this ScreenBuffer screenBuffer, { screenBuffer.AddBuffer(new string(bar, options.Witdth - valuestep), Style.Default.Foreground(options.OptStyleSchema.Slider().Background), true, false); } - screenBuffer.AddBuffer($" {options.ValueToString(options.Maxvalue)}", options.OptStyleSchema.UnSelected(),true,false); - screenBuffer.AddBuffer($" ({options.ValueToString(input)})", options.OptStyleSchema.TaggedInfo(), true, false); + if (!options.HideRanger) + { + screenBuffer.AddBuffer($" {options.ValueToString(options.Maxvalue)}", options.OptStyleSchema.Ranger(), true, false); + } + screenBuffer.AddBuffer($" ({options.ValueToString(input)})", options.OptStyleSchema.Answer(), true, false); screenBuffer.SaveCursor(); } diff --git a/Src/Controls/Slider/SliderNumberControl.cs b/Src/Controls/Slider/SliderNumberControl.cs index 1b2153ff..48e91d47 100644 --- a/Src/Controls/Slider/SliderNumberControl.cs +++ b/Src/Controls/Slider/SliderNumberControl.cs @@ -25,6 +25,12 @@ public SliderNumberControl(IConsoleControl console, SliderNumberOptions options) #region IControlSliderNumber + public IControlSliderNumber HideRange(bool value = true) + { + _options.HideRanger = value; + return this; + } + public IControlSliderNumber BarType(SliderBarType value) { _options.BarType = value; @@ -236,7 +242,10 @@ public override void InputTemplate(ScreenBuffer screenBuffer) if (_options.MoveKeyPress == LayoutSliderNumber.UpDown) { hasprompt = true; - screenBuffer.AddBuffer($"[{_options.Minvalue},{_options.Maxvalue}] ", _options.OptStyleSchema.Suggestion(), true, false); + if (!_options.HideRanger) + { + screenBuffer.AddBuffer($"[{_options.Minvalue},{_options.Maxvalue}] ", _options.OptStyleSchema.Ranger(), true, false); + } screenBuffer.WriteAnswer(_options, _options.ValueToString(_currentValue)); screenBuffer.SaveCursor(); } diff --git a/Src/Controls/Slider/SliderNumberOptions.cs b/Src/Controls/Slider/SliderNumberOptions.cs index 64f7005f..12b11b70 100644 --- a/Src/Controls/Slider/SliderNumberOptions.cs +++ b/Src/Controls/Slider/SliderNumberOptions.cs @@ -25,6 +25,7 @@ internal SliderNumberOptions(StyleSchema styleSchema, ConfigControls config, ICo public Color[] Gradient { get; set; } public Func ChangeColor { get; set; } public CultureInfo CurrentCulture { get; set; } = null; + public bool HideRanger { get; set; } public double DefaultValue { get; set; } public int Witdth { get; set; } = _defaultSliderWitdth; public LayoutSliderNumber MoveKeyPress { get; set; } = LayoutSliderNumber.LeftRight; diff --git a/Src/Controls/StyleControls.cs b/Src/Controls/StyleControls.cs index 20335736..c6241f80 100644 --- a/Src/Controls/StyleControls.cs +++ b/Src/Controls/StyleControls.cs @@ -61,6 +61,14 @@ public enum StyleControls /// /// Chart Region /// - Chart + Chart, + /// + /// Ranger Region + /// + Ranger, + /// + /// Lines Region + /// + Lines, } } diff --git a/Src/Controls/StyleSchema.cs b/Src/Controls/StyleSchema.cs index a39f8076..1438c02d 100644 --- a/Src/Controls/StyleSchema.cs +++ b/Src/Controls/StyleSchema.cs @@ -18,7 +18,7 @@ public class StyleSchema internal StyleSchema() { - _Styles = StyleSchema.Init(); + _Styles = Init(); } private StyleSchema(Dictionary newtyles) @@ -90,6 +90,12 @@ internal static Dictionary Init() case StyleControls.Chart: auxdic.Add(item, Style.Default.Foreground(ConsoleColor.White)); break; + case StyleControls.Ranger: + auxdic.Add(item, Style.Default.Foreground(ConsoleColor.DarkYellow)); + break; + case StyleControls.Lines: + auxdic.Add(item, Style.Default.Foreground(ConsoleColor.White)); + break; default: throw new PromptPlusException($"{item} Not Implemented"); } @@ -155,6 +161,12 @@ internal static StyleSchema Clone(StyleSchema source) case StyleControls.Chart: auxdic.Add(item, source.Chart()); break; + case StyleControls.Ranger: + auxdic.Add(item, source.Ranger()); + break; + case StyleControls.Lines: + auxdic.Add(item, source.Lines()); + break; default: throw new PromptPlusException($"{item} Not Implemented"); } diff --git a/Src/Controls/StyleSchemaExtensions.cs b/Src/Controls/StyleSchemaExtensions.cs index 8344a1d9..e3f67b07 100644 --- a/Src/Controls/StyleSchemaExtensions.cs +++ b/Src/Controls/StyleSchemaExtensions.cs @@ -38,8 +38,8 @@ public static Style ApplyBackground(this StyleSchema schema, StyleControls style /// /// Get text Prompt. - ///
ValueResult Foreground : 'ConsoleColor.White'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.White'
+ ///
Background : same Console Background when not set
///
public static Style Prompt(this StyleSchema schema) { @@ -49,8 +49,8 @@ public static Style Prompt(this StyleSchema schema) /// /// Get text Chart. - ///
ValueResult Foreground : 'ConsoleColor.White'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.White'
+ ///
Background : same Console Background when not set
///
public static Style Chart(this StyleSchema schema) { @@ -59,18 +59,39 @@ public static Style Chart(this StyleSchema schema) /// /// Get text Slider-On(Foreground)/Slider-Off(Background). - ///
ValueResult Foreground : 'ConsoleColor.Cyan'
- ///
ValueResult Background : 'ConsoleColor.DarkGray'
+ ///
Foreground : 'ConsoleColor.Cyan'
+ ///
Background : 'ConsoleColor.DarkGray'
///
public static Style Slider(this StyleSchema schema) { return schema.GetStyle(StyleControls.Slider); } + + /// + /// Get Range. + ///
Foreground : 'ConsoleColor.DarkYellow'
+ ///
Background : same Console Background when not set
+ ///
+ public static Style Ranger(this StyleSchema schema) + { + return schema.GetStyle(StyleControls.Ranger); + } + + /// + /// Get Lines. + ///
Foreground : 'ConsoleColor.White'
+ ///
Background : same Console Background when not set
+ ///
+ public static Style Lines(this StyleSchema schema) + { + return schema.GetStyle(StyleControls.Lines); + } + /// /// Get text Answer. - ///
ValueResult Foreground : 'ConsoleColor.Cyan'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.Cyan'
+ ///
Background : same Console Background when not set
///
public static Style Answer(this StyleSchema schema) { @@ -79,8 +100,8 @@ public static Style Answer(this StyleSchema schema) /// /// Get text Description. - ///
ValueResult Foreground : 'ConsoleColor.DarkYellow'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.DarkYellow'
+ ///
Background : same Console Background when not set
///
public static Style Description(this StyleSchema schema) { @@ -90,8 +111,8 @@ public static Style Description(this StyleSchema schema) /// /// Get text Suggestion. - ///
ValueResult Foreground : 'ConsoleColor.Yellow'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.Yellow'
+ ///
Background : same Console Background when not set
///
public static Style Suggestion(this StyleSchema schema) { @@ -101,8 +122,8 @@ public static Style Suggestion(this StyleSchema schema) /// /// Get text Selected. - ///
ValueResult Foreground : 'ConsoleColor.Green'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.Green'
+ ///
Background : same Console Background when not set
///
public static Style Selected(this StyleSchema schema) { @@ -112,8 +133,8 @@ public static Style Selected(this StyleSchema schema) /// /// Get text UnSelected. - ///
ValueResult Foreground : 'ConsoleColor.Gray'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.Gray'
+ ///
Background : same Console Background when not set
///
public static Style UnSelected(this StyleSchema schema) { @@ -122,8 +143,8 @@ public static Style UnSelected(this StyleSchema schema) /// /// Get text Disabled. - ///
ValueResult Foreground : 'ConsoleColor.DarkGray'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.DarkGray'
+ ///
Background : same Console Background when not set
///
public static Style Disabled(this StyleSchema schema) { @@ -132,8 +153,8 @@ public static Style Disabled(this StyleSchema schema) /// /// Get text Error. - ///
ValueResult Foreground : 'ConsoleColor.Red'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.Red'
+ ///
Background : same Console Background when not set
///
public static Style Error(this StyleSchema schema) { @@ -142,8 +163,8 @@ public static Style Error(this StyleSchema schema) /// /// Get text Pagination. - ///
ValueResult Foreground : 'ConsoleColor.DarkGray'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.DarkGray'
+ ///
Background : same Console Background when not set
///
public static Style Pagination(this StyleSchema schema) { @@ -152,8 +173,8 @@ public static Style Pagination(this StyleSchema schema) /// /// Get text Tagged info. - ///
ValueResult Foreground : 'ConsoleColor.DarkYellow'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.DarkYellow'
+ ///
Background : same Console Background when not set
///
public static Style TaggedInfo(this StyleSchema schema) { @@ -162,8 +183,8 @@ public static Style TaggedInfo(this StyleSchema schema) /// /// Get text Tooltips. - ///
ValueResult Foreground : 'ConsoleColor.DarkGray'
- ///
ValueResult Background : same Console Background when set
+ ///
Foreground : 'ConsoleColor.DarkGray'
+ ///
Background : same Console Background when not set
///
public static Style Tooltips(this StyleSchema schema) { diff --git a/Src/Controls/Table/TableControl.cs b/Src/Controls/Table/TableControl.cs index 7d443d6d..87f96a31 100644 --- a/Src/Controls/Table/TableControl.cs +++ b/Src/Controls/Table/TableControl.cs @@ -9,7 +9,6 @@ using System.Linq; using System.Linq.Expressions; using System.Text; -using System.Text.Json; using System.Threading; using PPlus.Controls.Objects; @@ -448,27 +447,15 @@ public IControlTable Styles(TableStyle styletype, Style value) { switch (styletype) { - case TableStyle.Grid: - _options.GridStyle = value; - break; case TableStyle.Title: _options.TitleStyle = value; break; case TableStyle.Header: _options.HeaderStyle = value; break; - case TableStyle.SelectedHeader: - _options.SelectedHeaderStyle = value; - break; case TableStyle.Content: _options.ContentStyle = value; break; - case TableStyle.DisabledContent: - _options.DisabledContentStyle = value; - break; - case TableStyle.SelectedContent: - _options.SelectedContentStyle = value; - break; default: throw new PromptPlusException($"TableStyle: {styletype} Not Implemented"); } @@ -534,7 +521,7 @@ private static string AlignmentText(string value, Alignment alignment, int maxle private void BuildLineColumn(ScreenBuffer screenBuffer,char startln,char sepln, char endln, char contentln) { - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); if ( _options.Layout == TableLayout.HideGrid) { stl = Style.Default; @@ -822,9 +809,9 @@ private void WriteTitleInRow(string tit, ScreenBuffer screenBuffer) default: throw new PromptPlusException($"Layout {_options.Layout} Not implemented"); } - screenBuffer.AddBuffer(sep, _options.GridStyle); + screenBuffer.AddBuffer(sep, _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer(tit, _options.TitleStyle); - screenBuffer.AddBuffer(sep, _options.GridStyle); + screenBuffer.AddBuffer(sep, _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); switch (_options.Layout) @@ -1033,7 +1020,7 @@ private void WriteTableHeader(ScreenBuffer screenBuffer) var col = -1; var sepstart = " "; var sepend = " "; - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); switch (_options.Layout) { case TableLayout.HideGrid: @@ -1112,7 +1099,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) var sep = " "; var sepcol = " "; var sepend = " "; - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); switch (_options.Layout) { case TableLayout.HideGrid: @@ -1179,7 +1166,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) { if (itemcol == 0) { - screenBuffer.AddBuffer(col, _options.SelectedContentStyle, true); + screenBuffer.AddBuffer(col, _options.OptStyleSchema.Selected(), true); } else { @@ -1188,7 +1175,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) } else { - screenBuffer.AddBuffer(col, _options.SelectedContentStyle, true); + screenBuffer.AddBuffer(col, _options.OptStyleSchema.Selected(), true); } } else @@ -1196,7 +1183,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) var stld = _options.ContentStyle; if (isdisabled) { - stld = _options.DisabledContentStyle; + stld = _options.OptStyleSchema.Disabled(); } screenBuffer.AddBuffer(col, stld, true); } diff --git a/Src/Controls/Table/TableMultiSelectControl.cs b/Src/Controls/Table/TableMultiSelectControl.cs index 0f364279..5239985a 100644 --- a/Src/Controls/Table/TableMultiSelectControl.cs +++ b/Src/Controls/Table/TableMultiSelectControl.cs @@ -1096,27 +1096,15 @@ public IControlTableMultiSelect Styles(TableStyle styletype, Style value) { switch (styletype) { - case TableStyle.Grid: - _options.GridStyle = value; - break; case TableStyle.Title: _options.TitleStyle = value; break; case TableStyle.Header: _options.HeaderStyle = value; break; - case TableStyle.SelectedHeader: - _options.SelectedHeaderStyle = value; - break; case TableStyle.Content: _options.ContentStyle = value; break; - case TableStyle.DisabledContent: - _options.DisabledContentStyle = value; - break; - case TableStyle.SelectedContent: - _options.SelectedContentStyle = value; - break; default: throw new PromptPlusException($"TableStyle: {styletype} Not Implemented"); } @@ -1198,7 +1186,7 @@ private static string AlignmentText(string value, Alignment alignment, int maxle private void BuildLineColumn(ScreenBuffer screenBuffer,char startln,char sepln, char endln, char contentln) { - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); if ( _options.Layout == TableLayout.HideGrid) { stl = Style.Default; @@ -1211,15 +1199,6 @@ private void BuildLineColumn(ScreenBuffer screenBuffer,char startln,char sepln, screenBuffer.AddBuffer(endln, stl); } - private object GetValueColumn(int column, ItemTableRow item) - { - if (column < 0 || column > _options.Columns.Count) - { - return null; - } - return _options.Columns[column].Field.Invoke(item.Value); - } - private List GetTextColumns(T value, out int lines) { var cols = new List(); @@ -1523,9 +1502,9 @@ private void WriteTitleInRow(string tit, ScreenBuffer screenBuffer) default: throw new PromptPlusException($"Layout {_options.Layout} Not implemented"); } - screenBuffer.AddBuffer(sep, _options.GridStyle); + screenBuffer.AddBuffer(sep, _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer(tit, _options.TitleStyle); - screenBuffer.AddBuffer(sep, _options.GridStyle); + screenBuffer.AddBuffer(sep, _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); switch (_options.Layout) @@ -1734,7 +1713,7 @@ private void WriteTableHeader(ScreenBuffer screenBuffer) var col = -1; var sepstart = " "; var sepend = " "; - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); switch (_options.Layout) { case TableLayout.HideGrid: @@ -1765,7 +1744,7 @@ private void WriteTableHeader(ScreenBuffer screenBuffer) if (_options.IsColumnsNavigation && col == _currentcol) { var h = AlignmentText($"{_options.Symbol(SymbolType.Selector)} {item.Title.Trim()}", item.AlignTitle, item.Width); - screenBuffer.AddBuffer(h, _options.SelectedHeaderStyle); + screenBuffer.AddBuffer(h, _options.OptStyleSchema.Selected()); } else { @@ -1830,7 +1809,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) var sep = " "; var sepcol = " "; var sepend = " "; - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); switch (_options.Layout) { case TableLayout.HideGrid: @@ -1933,7 +1912,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) { if (itemcol == _currentcol || itemcol == 0) { - screenBuffer.AddBuffer(col, _options.SelectedContentStyle, true); + screenBuffer.AddBuffer(col, _options.OptStyleSchema.Selected(), true); } else { @@ -1942,7 +1921,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) } else { - screenBuffer.AddBuffer(col, _options.SelectedContentStyle, true); + screenBuffer.AddBuffer(col, _options.OptStyleSchema.Selected(), true); } } else @@ -1950,7 +1929,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) var stld = _options.ContentStyle; if (isdisabled) { - stld = _options.DisabledContentStyle; + stld = _options.OptStyleSchema.Disabled(); } screenBuffer.AddBuffer(col, stld, true); } diff --git a/Src/Controls/Table/TableOptions.cs b/Src/Controls/Table/TableOptions.cs index 985fcd21..c86df83d 100644 --- a/Src/Controls/Table/TableOptions.cs +++ b/Src/Controls/Table/TableOptions.cs @@ -20,13 +20,9 @@ internal TableOptions(StyleSchema styleSchema, ConfigControls config, IConsoleCo { TimeoutOverwriteDefault = config.HistoryTimeout; PageSize = config.PageSize; - GridStyle = styleSchema.Prompt(); HeaderStyle = styleSchema.Prompt(); - SelectedHeaderStyle = styleSchema.Selected(); TitleStyle = styleSchema.Prompt(); ContentStyle = styleSchema.Prompt(); - DisabledContentStyle = styleSchema.Disabled(); - SelectedContentStyle = styleSchema.Selected(); SelectAllPress = config.SelectAllPress; InvertSelectedPress = config.InvertSelectedPress; } @@ -61,20 +57,12 @@ internal TableOptions(StyleSchema styleSchema, ConfigControls config, IConsoleCo public TableLayout Layout { get; set; } = TableLayout.SingleGridFull; - public Style GridStyle { get; set; } - public Style TitleStyle { get; set; } public Style HeaderStyle { get; set; } - public Style SelectedHeaderStyle { get; set; } - public Style ContentStyle { get; set; } - public Style DisabledContentStyle { get; set; } - - public Style SelectedContentStyle { get; set; } - public string Title { get; set; } = string.Empty; public Alignment TitleAlignment { get; set; } = Alignment.Center; diff --git a/Src/Controls/Table/TableSelectControl.cs b/Src/Controls/Table/TableSelectControl.cs index 77109a65..d8be6973 100644 --- a/Src/Controls/Table/TableSelectControl.cs +++ b/Src/Controls/Table/TableSelectControl.cs @@ -973,27 +973,15 @@ public IControlTableSelect Styles(TableStyle styletype, Style value) { switch (styletype) { - case TableStyle.Grid: - _options.GridStyle = value; - break; case TableStyle.Title: _options.TitleStyle = value; break; case TableStyle.Header: _options.HeaderStyle = value; break; - case TableStyle.SelectedHeader: - _options.SelectedHeaderStyle = value; - break; case TableStyle.Content: _options.ContentStyle = value; break; - case TableStyle.DisabledContent: - _options.DisabledContentStyle = value; - break; - case TableStyle.SelectedContent: - _options.SelectedContentStyle = value; - break; default: throw new PromptPlusException($"TableStyle: {styletype} Not Implemented"); } @@ -1078,7 +1066,7 @@ private static string AlignmentText(string value, Alignment alignment, int maxle private void BuildLineColumn(ScreenBuffer screenBuffer,char startln,char sepln, char endln, char contentln) { - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); if ( _options.Layout == TableLayout.HideGrid) { stl = Style.Default; @@ -1403,9 +1391,9 @@ private void WriteTitleInRow(string tit, ScreenBuffer screenBuffer) default: throw new PromptPlusException($"Layout {_options.Layout} Not implemented"); } - screenBuffer.AddBuffer(sep, _options.GridStyle); + screenBuffer.AddBuffer(sep, _options.OptStyleSchema.Lines()); screenBuffer.AddBuffer(tit, _options.TitleStyle); - screenBuffer.AddBuffer(sep, _options.GridStyle); + screenBuffer.AddBuffer(sep, _options.OptStyleSchema.Lines()); screenBuffer.NewLine(); switch (_options.Layout) @@ -1614,7 +1602,7 @@ private void WriteTableHeader(ScreenBuffer screenBuffer) var col = -1; var sepstart = " "; var sepend = " "; - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); switch (_options.Layout) { case TableLayout.HideGrid: @@ -1645,7 +1633,7 @@ private void WriteTableHeader(ScreenBuffer screenBuffer) if (_options.IsColumnsNavigation && col == _currentcol) { var h = AlignmentText($"{_options.Symbol(SymbolType.Selector)} {item.Title.Trim()}", item.AlignTitle, item.Width); - screenBuffer.AddBuffer(h, _options.SelectedHeaderStyle); + screenBuffer.AddBuffer(h, _options.OptStyleSchema.Selected()); } else { @@ -1709,7 +1697,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) var sep = " "; var sepcol = " "; var sepend = " "; - var stl = _options.GridStyle; + var stl = _options.OptStyleSchema.Lines(); switch (_options.Layout) { case TableLayout.HideGrid: @@ -1780,7 +1768,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) { if (itemcol == _currentcol || !_options.HideSelectorRow && itemcol == 0) { - screenBuffer.AddBuffer(col, _options.SelectedContentStyle, true); + screenBuffer.AddBuffer(col, _options.OptStyleSchema.Selected(), true); } else { @@ -1789,7 +1777,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) } else { - screenBuffer.AddBuffer(col, _options.SelectedContentStyle, true); + screenBuffer.AddBuffer(col, _options.OptStyleSchema.Selected(), true); } } else @@ -1797,7 +1785,7 @@ private void WriteTableRows(ScreenBuffer screenBuffer) var stld = _options.ContentStyle; if (isdisabled) { - stld = _options.DisabledContentStyle; + stld = _options.OptStyleSchema.Disabled(); } screenBuffer.AddBuffer(col, stld, true); } diff --git a/Src/Controls/Table/TableStyle.cs b/Src/Controls/Table/TableStyle.cs index ac69f479..b7f3321e 100644 --- a/Src/Controls/Table/TableStyle.cs +++ b/Src/Controls/Table/TableStyle.cs @@ -10,10 +10,6 @@ namespace PPlus.Controls /// public enum TableStyle { - /// - /// Grid lines - /// - Grid, /// /// Title content /// @@ -23,20 +19,8 @@ public enum TableStyle /// Header, /// - /// Selected Header content - /// - SelectedHeader, - /// /// Data content /// - Content, - /// - /// Disabled content - /// - DisabledContent, - /// - /// Selected content - /// - SelectedContent + Content } } diff --git a/Src/Controls/TasksProcess/IControlWait.cs b/Src/Controls/TasksProcess/IControlWait.cs index ea0a1327..c0210492 100644 --- a/Src/Controls/TasksProcess/IControlWait.cs +++ b/Src/Controls/TasksProcess/IControlWait.cs @@ -95,5 +95,13 @@ public interface IControlWait : IPromptControls> /// list of tasks /// IControlWait AddStep(StepMode stepMode, string? id, string? label, params Action,CancellationToken>[] process); + + /// + /// Overwrite Styles Wait. + /// + /// Styles Wait + /// + /// + IControlWait Styles(StyleWait styletype, Style value); } } diff --git a/Src/Controls/TasksProcess/ProgressBarControl.cs b/Src/Controls/TasksProcess/ProgressBarControl.cs index 0a22775a..cc1b9437 100644 --- a/Src/Controls/TasksProcess/ProgressBarControl.cs +++ b/Src/Controls/TasksProcess/ProgressBarControl.cs @@ -439,7 +439,7 @@ private void WriteProgressBar(double value,string handlerdescription, (int Curso if (_options.ShowRanger) { var top = ConsolePlus.CursorTop; - qtd = ConsolePlus.Write($"{ValueToString(_options.Minvalue)} ", _options.OptStyleSchema.Prompt()); + qtd = ConsolePlus.Write($"{ValueToString(_options.Minvalue)} ", _options.OptStyleSchema.Ranger()); if (ConsolePlus.IsTerminal && top + qtd >= ConsolePlus.BufferHeight) { var dif = top + qtd - ConsolePlus.BufferHeight; @@ -611,7 +611,7 @@ private void WriteProgressBar(double value,string handlerdescription, (int Curso if (_options.ShowRanger) { var top = ConsolePlus.CursorTop; - qtd = ConsolePlus.Write($" {ValueToString(_options.Maxvalue)}", _options.OptStyleSchema.Prompt()); + qtd = ConsolePlus.Write($" {ValueToString(_options.Maxvalue)}", _options.OptStyleSchema.Ranger()); if (_options.ShowPercent) { qtd += ConsolePlus.WriteLine($" ({ValueToString(value)}%)", _options.OptStyleSchema.Answer()); diff --git a/Src/Controls/TasksProcess/StyleWait.cs b/Src/Controls/TasksProcess/StyleWait.cs new file mode 100644 index 00000000..36c66a01 --- /dev/null +++ b/Src/Controls/TasksProcess/StyleWait.cs @@ -0,0 +1,22 @@ +// *************************************************************************************** +// MIT LICENCE +// The maintenance and evolution is maintained by the PromptPlus project under MIT license +// *************************************************************************************** + +namespace PPlus.Controls +{ + /// + /// Represents The Style region of Wait + /// + public enum StyleWait + { + /// + /// Label Region + /// + Label, + /// + /// ElapsedTime Region + /// + ElapsedTime + } +} diff --git a/Src/Controls/TasksProcess/WaitControl.cs b/Src/Controls/TasksProcess/WaitControl.cs index cc2dace6..08607f03 100644 --- a/Src/Controls/TasksProcess/WaitControl.cs +++ b/Src/Controls/TasksProcess/WaitControl.cs @@ -84,6 +84,22 @@ protected virtual void Dispose(bool disposing) #region IControlWait + public IControlWait Styles(StyleWait styletype, Style value) + { + switch (styletype) + { + case StyleWait.Label: + _options.LabelStyle = value; + break; + case StyleWait.ElapsedTime: + _options.ElapsedTimeStyle = value; + break; + default: + throw new PromptPlusException($"StyleWait: {styletype} Not Implemented"); + } + return this; + } + public IControlWait Interaction(IEnumerable values, Action, T1> action) { foreach (var item in values) @@ -459,7 +475,9 @@ private void RunAllTasks(CancellationToken cancellationtoken) } } top = ConsolePlus.CursorTop; - qtd = ConsolePlus.Write($"{symb} {desc}", _options.OptStyleSchema.Description(), false); + qtd = ConsolePlus.Write($"{symb}", _options.OptStyleSchema.Lines(), false); + qtd += ConsolePlus.Write($" ", _options.OptStyleSchema.Prompt(), false); + qtd += ConsolePlus.Write($"{desc}", _options.LabelStyle, false); if (!_options.ShowCountdown) { qtd += ConsolePlus.Write(" ", _options.OptStyleSchema.Prompt(), true); @@ -599,15 +617,15 @@ private void ShowSpinner(List<(int left, int top, Stopwatch sw)> elapsetm, Stopw ConsolePlus.Write("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", _options.OptStyleSchema.Prompt(), false); if (_options.ShowElapsedTime) { - ConsolePlus.Write($" ({item.sw.Elapsed:hh\\:mm\\:ss\\:ff})", _options.OptStyleSchema.Description(), false); + ConsolePlus.Write($" ({item.sw.Elapsed:hh\\:mm\\:ss\\:ff})", _options.ElapsedTimeStyle, false); } if (!item.sw.IsRunning) { - ConsolePlus.Write($" {_options.Symbol(SymbolType.Done)}", _options.OptStyleSchema.Description(), true); + ConsolePlus.Write($" {_options.Symbol(SymbolType.Done)}", _options.ElapsedTimeStyle, true); } else { - ConsolePlus.Write($" ", _options.OptStyleSchema.Description(), true); + ConsolePlus.Write($" ", _options.OptStyleSchema.Prompt(), true); } } } @@ -615,7 +633,7 @@ private void ShowSpinner(List<(int left, int top, Stopwatch sw)> elapsetm, Stopw { var countdown = _options.TimeDelay - elapsetm[0].sw.Elapsed; ConsolePlus.Write("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", _options.OptStyleSchema.Prompt(), false); - ConsolePlus.Write($"({countdown:hh\\:mm\\:ss\\:ff})", _options.OptStyleSchema.Description(), true); + ConsolePlus.Write($"({countdown:hh\\:mm\\:ss\\:ff})", _options.ElapsedTimeStyle, true); } if (_promptlines < _promptlines+qtdlines) { diff --git a/Src/Controls/TasksProcess/WaitExtensions.cs b/Src/Controls/TasksProcess/WaitExtensions.cs index 463f87f9..bcc0a3a9 100644 --- a/Src/Controls/TasksProcess/WaitExtensions.cs +++ b/Src/Controls/TasksProcess/WaitExtensions.cs @@ -80,8 +80,10 @@ public static IControlWait WaitProcess(string prompt, string description /// The /// True show Countdown, otherwise 'no' /// The config action + /// Spinner + /// Countdown /// for control - public static void WaitTimer(string prompt, TimeSpan delay, SpinnersType spinnersType = SpinnersType.Ascii, bool showCountdown = false, Action config = null, CancellationToken? cancellationToken = null) + public static void WaitTimer(string prompt, TimeSpan delay, SpinnersType spinnersType = SpinnersType.Ascii, bool showCountdown = false, Action config = null, Style? spinnerStyle = null, Style? elapsedTimeStyle = null, CancellationToken? cancellationToken = null) { var cts = cancellationToken ?? CancellationToken.None; var opt = new WaitOptions(_styleschema, _configcontrols, _consoledrive, false) @@ -91,6 +93,14 @@ public static void WaitTimer(string prompt, TimeSpan delay, SpinnersType spinner ShowCountdown = showCountdown, OptPrompt = prompt }; + if (spinnerStyle != null) + { + opt.SpinnerStyle = spinnerStyle.Value; + } + if (spinnerStyle != null) + { + opt.ElapsedTimeStyle = elapsedTimeStyle.Value; + } opt.HideAfterFinish(true); opt.EnabledAbortKey(false); config?.Invoke(opt); diff --git a/Src/Controls/TasksProcess/WaitOptions.cs b/Src/Controls/TasksProcess/WaitOptions.cs index e1324f7f..7ffd0766 100644 --- a/Src/Controls/TasksProcess/WaitOptions.cs +++ b/Src/Controls/TasksProcess/WaitOptions.cs @@ -22,6 +22,9 @@ internal WaitOptions(StyleSchema styleSchema, ConfigControls config, IConsoleCon Steps = new(); States = new(); SpinnerStyle = styleSchema.Prompt(); + LabelStyle = styleSchema.TaggedInfo(); + ElapsedTimeStyle = styleSchema.TaggedInfo(); + } public T Context { get; set; } = default; public TimeSpan TimeDelay { get; set; } @@ -35,5 +38,7 @@ internal WaitOptions(StyleSchema styleSchema, ConfigControls config, IConsoleCon public Spinners Spinner { get; set; } = new Spinners(SpinnersType.Ascii, false); public int MaxDegreeProcess { get; set; } = Environment.ProcessorCount; public bool ShowElapsedTime { get; set; } + public Style LabelStyle { get; set; } + public Style ElapsedTimeStyle { get; set; } } } diff --git a/Src/Controls/TreeDiagram/BrowserMultiSelectControl.cs b/Src/Controls/TreeDiagram/BrowserMultiSelectControl.cs index c56d8002..cbb12aaf 100644 --- a/Src/Controls/TreeDiagram/BrowserMultiSelectControl.cs +++ b/Src/Controls/TreeDiagram/BrowserMultiSelectControl.cs @@ -326,9 +326,6 @@ public IControlBrowserMultiSelect Styles(StyleBrowser styletype, Style value) case StyleBrowser.SelectedRoot: _options.SelectedRootStyle = value; break; - case StyleBrowser.Lines: - _options.LineStyle = value; - break; case StyleBrowser.UnselectedSize: _options.SizeStyle = value; break; diff --git a/Src/Controls/TreeDiagram/BrowserOptions.cs b/Src/Controls/TreeDiagram/BrowserOptions.cs index 2abb8e53..7bb03f0f 100644 --- a/Src/Controls/TreeDiagram/BrowserOptions.cs +++ b/Src/Controls/TreeDiagram/BrowserOptions.cs @@ -24,7 +24,6 @@ internal BrowserOptions(StyleSchema styleSchema, ConfigControls config, IConsole CurrentFolderStyle = styleSchema.TaggedInfo().Overflow(Overflow.Crop); RootStyle = styleSchema.UnSelected().Overflow(Overflow.Crop); SelectedRootStyle = styleSchema.Selected().Overflow(Overflow.Crop); - LineStyle = styleSchema.Prompt().Overflow(Overflow.Crop); SizeStyle = styleSchema.UnSelected().Overflow(Overflow.Crop); ExpandStyle = styleSchema.UnSelected().Overflow(Overflow.Crop); FolderStyle = styleSchema.UnSelected().Overflow(Overflow.Crop); @@ -51,7 +50,6 @@ internal BrowserOptions(StyleSchema styleSchema, ConfigControls config, IConsole public Style CurrentFolderStyle { get; set; } public Style RootStyle { get; set; } public Style SelectedRootStyle { get; set; } - public Style LineStyle { get; set; } public Style SizeStyle { get; set; } public Style ExpandStyle { get; set; } public Style FolderStyle { get; set; } diff --git a/Src/Controls/TreeDiagram/BrowserSelectControl.cs b/Src/Controls/TreeDiagram/BrowserSelectControl.cs index 0f92deee..e05fd355 100644 --- a/Src/Controls/TreeDiagram/BrowserSelectControl.cs +++ b/Src/Controls/TreeDiagram/BrowserSelectControl.cs @@ -283,9 +283,6 @@ public IControlBrowserSelect Styles(StyleBrowser styletype, Style value) case StyleBrowser.SelectedRoot: _options.SelectedRootStyle = value; break; - case StyleBrowser.Lines: - _options.LineStyle = value; - break; case StyleBrowser.UnselectedSize: _options.SizeStyle = value; break; diff --git a/Src/Controls/TreeDiagram/ScreenBufferBrowserMultiSelect.cs b/Src/Controls/TreeDiagram/ScreenBufferBrowserMultiSelect.cs index 197f6c40..9aae30b3 100644 --- a/Src/Controls/TreeDiagram/ScreenBufferBrowserMultiSelect.cs +++ b/Src/Controls/TreeDiagram/ScreenBufferBrowserMultiSelect.cs @@ -139,7 +139,7 @@ public static void WriteLineMultiSelectorBrowser(this ScreenBuffer screenBuffer, screenBuffer.NewLine(); screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true,false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.SelectedExpandStyle, true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.SelectedExpandStyle, true,false); if (data.IsRoot) @@ -165,7 +165,7 @@ public static void WriteLineNotDisabledMultiSelectorBrowser(this ScreenBuffer sc screenBuffer.NewLine(); screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true,false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.OptStyleSchema.Disabled(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true,false); @@ -177,7 +177,7 @@ public static void WriteLineNotMultiSelectorBrowser(this ScreenBuffer screenBuff screenBuffer.NewLine(); screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true,false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.ExpandStyle, true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.ExpandStyle, true,false); if (data.IsRoot) @@ -203,7 +203,7 @@ public static void WriteLineDisabledNotMultiSelectorBrowser(this ScreenBuffer sc screenBuffer.NewLine(); screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true,false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.OptStyleSchema.Disabled(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true,false); diff --git a/Src/Controls/TreeDiagram/ScreenBufferBrowserSelect.cs b/Src/Controls/TreeDiagram/ScreenBufferBrowserSelect.cs index 373ccfdc..7c4502bd 100644 --- a/Src/Controls/TreeDiagram/ScreenBufferBrowserSelect.cs +++ b/Src/Controls/TreeDiagram/ScreenBufferBrowserSelect.cs @@ -140,7 +140,7 @@ public static void WriteLineSelectorBrowser(this ScreenBuffer screenBuffer, Brow } screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true, false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.SelectedExpandStyle, true, false) ; if (data.IsRoot) { @@ -168,7 +168,7 @@ public static void WriteLineDisabledSelectorBrowser(this ScreenBuffer screenBuff } screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true,false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextSize, options.OptStyleSchema.Disabled(), true,false); @@ -182,7 +182,7 @@ public static void WriteLineNotSelectorBrowser(this ScreenBuffer screenBuffer, B } screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.ExpandStyle, true, false); if (data.IsRoot) { @@ -211,7 +211,7 @@ public static void WriteLineDisabledNotSelectorBrowser(this ScreenBuffer screenB screenBuffer.NewLine(); screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true, false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextSize, options.OptStyleSchema.Disabled(), true, false); diff --git a/Src/Controls/TreeDiagram/ScreenBufferTreeViewMultiSelect.cs b/Src/Controls/TreeDiagram/ScreenBufferTreeViewMultiSelect.cs index a9bd9848..2231d255 100644 --- a/Src/Controls/TreeDiagram/ScreenBufferTreeViewMultiSelect.cs +++ b/Src/Controls/TreeDiagram/ScreenBufferTreeViewMultiSelect.cs @@ -123,7 +123,7 @@ public static void WriteLineSelectorTreeViewMultiSelect(this ScreenBuffer scr } screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true,false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.SelectedExpandStyle, true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.SelectedExpandStyle, true, false); if (data.IsRoot) @@ -151,7 +151,7 @@ public static void WriteLineDisabledSelectorTreeViewMultiSelect(this ScreenBu } screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true, false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.OptStyleSchema.Disabled(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true, false); @@ -165,7 +165,7 @@ public static void WriteLineNotSelectorTreeViewMultiSelect(this ScreenBuffer } screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true, false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.ExpandStyle, true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.ExpandStyle, true, false); if (data.IsRoot) @@ -193,7 +193,7 @@ public static void WriteLineDisabledNotSelectorTreeViewMultiSelect(this Scree } screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextSelected, options.OptStyleSchema.Disabled(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true, false); diff --git a/Src/Controls/TreeDiagram/ScreenBufferTreeViewSelect.cs b/Src/Controls/TreeDiagram/ScreenBufferTreeViewSelect.cs index 2c2485b3..6e0c8b24 100644 --- a/Src/Controls/TreeDiagram/ScreenBufferTreeViewSelect.cs +++ b/Src/Controls/TreeDiagram/ScreenBufferTreeViewSelect.cs @@ -123,7 +123,7 @@ public static void WriteLineSelectorTreeViewSelect(this ScreenBuffer screenBu } screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true, false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.SelectedExpandStyle, true, false); if (data.IsRoot) { @@ -150,7 +150,7 @@ public static void WriteLineDisabledSelectorTreeViewSelect(this ScreenBuffer } screenBuffer.AddBuffer(options.Symbol(SymbolType.Selector), options.OptStyleSchema.Selected(), true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true,false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true, false); } @@ -163,7 +163,7 @@ public static void WriteLineNotSelectorTreeViewSelect(this ScreenBuffer scree } screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.ExpandStyle, true, false); if (data.IsRoot) { @@ -190,7 +190,7 @@ public static void WriteLineDisabledNotSelectorTreeViewSelect(this ScreenBuff } screenBuffer.AddBuffer(' ', Style.Default, true); screenBuffer.AddBuffer(' ', Style.Default, true,false); - screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.LineStyle, true, false); + screenBuffer.AddBuffer(data.MessagesNodes.TextLines, options.OptStyleSchema.Lines(), true, false); screenBuffer.AddBuffer(data.MessagesNodes.TextExpand, options.OptStyleSchema.Disabled(), true,false); screenBuffer.AddBuffer(data.MessagesNodes.TextItem, options.OptStyleSchema.Disabled(), true, false); } diff --git a/Src/Controls/TreeDiagram/StyleBrowser.cs b/Src/Controls/TreeDiagram/StyleBrowser.cs index 7940d745..2f6086bc 100644 --- a/Src/Controls/TreeDiagram/StyleBrowser.cs +++ b/Src/Controls/TreeDiagram/StyleBrowser.cs @@ -15,10 +15,6 @@ public enum StyleBrowser /// CurrentFolder, /// - /// Lines Region - /// - Lines, - /// /// Unselected Size region/state /// UnselectedSize, diff --git a/Src/Controls/TreeDiagram/StyleTreeView.cs b/Src/Controls/TreeDiagram/StyleTreeView.cs index 0162ffba..ef9b20dd 100644 --- a/Src/Controls/TreeDiagram/StyleTreeView.cs +++ b/Src/Controls/TreeDiagram/StyleTreeView.cs @@ -15,10 +15,6 @@ public enum StyleTreeView /// CurrentNode, /// - /// Lines Region - /// - Lines, - /// /// Unselected Root Region/State /// UnselectedRoot, diff --git a/Src/Controls/TreeDiagram/TreeViewMultiSelectControl.cs b/Src/Controls/TreeDiagram/TreeViewMultiSelectControl.cs index aab790bb..2c4a1986 100644 --- a/Src/Controls/TreeDiagram/TreeViewMultiSelectControl.cs +++ b/Src/Controls/TreeDiagram/TreeViewMultiSelectControl.cs @@ -96,9 +96,6 @@ public IControlTreeViewMultiSelect Styles(StyleTreeView styletype, Style valu case StyleTreeView.CurrentNode: _options.CurrentNodeStyle = value; break; - case StyleTreeView.Lines: - _options.LineStyle = value; - break; case StyleTreeView.UnselectedRoot: _options.RootStyle = value; break; diff --git a/Src/Controls/TreeDiagram/TreeViewOptions.cs b/Src/Controls/TreeDiagram/TreeViewOptions.cs index 66dd455f..321d7d58 100644 --- a/Src/Controls/TreeDiagram/TreeViewOptions.cs +++ b/Src/Controls/TreeDiagram/TreeViewOptions.cs @@ -20,7 +20,6 @@ private TreeViewOptions() : base(null, null, null, true) internal TreeViewOptions(StyleSchema styleSchema, ConfigControls config, IConsoleControl console, bool showcursor) : base(styleSchema, config, console, showcursor) { CurrentNodeStyle = styleSchema.TaggedInfo().Overflow(Overflow.Crop); - LineStyle = styleSchema.Prompt().Overflow(Overflow.Crop); ExpandStyle = styleSchema.UnSelected().Overflow(Overflow.Crop); RootStyle = styleSchema.UnSelected().Overflow(Overflow.Crop); ParentStyle = styleSchema.UnSelected().Overflow(Overflow.Crop); @@ -44,7 +43,6 @@ internal TreeViewOptions(StyleSchema styleSchema, ConfigControls config, IConsol public bool SelectAll { get; set; } public Func SelectAllExpression { get; set; } public Style CurrentNodeStyle { get; set; } - public Style LineStyle { get; set; } public Style ExpandStyle { get; set; } public Style RootStyle { get; set; } public Style ParentStyle { get; set; } diff --git a/Src/Controls/TreeDiagram/TreeViewSelectControl.cs b/Src/Controls/TreeDiagram/TreeViewSelectControl.cs index ba197798..718e08b6 100644 --- a/Src/Controls/TreeDiagram/TreeViewSelectControl.cs +++ b/Src/Controls/TreeDiagram/TreeViewSelectControl.cs @@ -53,9 +53,6 @@ public IControlTreeViewSelect Styles(StyleTreeView styletype, Style value) case StyleTreeView.CurrentNode: _options.CurrentNodeStyle = value; break; - case StyleTreeView.Lines: - _options.LineStyle = value; - break; case StyleTreeView.UnselectedRoot: _options.RootStyle = value; break; diff --git a/Src/Drivers/ConsoleDriveMemory.cs b/Src/Drivers/ConsoleDriveMemory.cs index 6e07a510..22a992e9 100644 --- a/Src/Drivers/ConsoleDriveMemory.cs +++ b/Src/Drivers/ConsoleDriveMemory.cs @@ -10,7 +10,6 @@ using System.Threading; using System; using System.Collections.Generic; -using PPlus.Controls.Objects; using EastAsianWidthDotNet; namespace PPlus.Drivers diff --git a/Src/Drivers/ConsoleDriveWindows.cs b/Src/Drivers/ConsoleDriveWindows.cs index 0873c31c..ecfed836 100644 --- a/Src/Drivers/ConsoleDriveWindows.cs +++ b/Src/Drivers/ConsoleDriveWindows.cs @@ -4,7 +4,6 @@ // *************************************************************************************** using EastAsianWidthDotNet; -using PPlus.Controls.Objects; using PPlus.Drivers.Ansi; using System; using System.IO; diff --git a/Src/NugetREADME.md b/Src/NugetREADME.md index 19d4d18c..6715644c 100644 --- a/Src/NugetREADME.md +++ b/Src/NugetREADME.md @@ -50,6 +50,14 @@ PromptPlus **Supports 4/8/24-bit colors** in the terminal with auto-detection of - 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 : diff --git a/Src/README.txt b/Src/README.txt index 5110f7fd..cf390500 100644 --- a/Src/README.txt +++ b/Src/README.txt @@ -70,6 +70,14 @@ PromptPlus was developed in C# with target frameworks: - 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 : diff --git a/docs/apis/apis.md b/docs/apis/apis.md index fe687bc5..b5cb4899 100644 --- a/docs/apis/apis.md +++ b/docs/apis/apis.md @@ -200,6 +200,8 @@ - [StyleTreeView](./pplus.controls.styletreeview.md) +- [StyleWait](./pplus.controls.stylewait.md) + - [SuggestionInput](./pplus.controls.suggestioninput.md) - [SuggestionOutput](./pplus.controls.suggestionoutput.md) diff --git a/docs/apis/pplus.controls.icontrolslidernumber.md b/docs/apis/pplus.controls.icontrolslidernumber.md index 024f83a2..26a28e56 100644 --- a/docs/apis/pplus.controls.icontrolslidernumber.md +++ b/docs/apis/pplus.controls.icontrolslidernumber.md @@ -179,6 +179,23 @@ Fracional Digits [IControlSliderNumber](./pplus.controls.icontrolslidernumber.md) +### **HideRange(Boolean)** + +Hide min./max elements in slider. Default is Show + +```csharp +IControlSliderNumber HideRange(bool value) +``` + +#### Parameters + +`value` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
+True for hide,false for show + +#### Returns + +[IControlSliderNumber](./pplus.controls.icontrolslidernumber.md) + ###
**LargeStep(Double)** Define the large step to change. Default value is 1/10 of range diff --git a/docs/apis/pplus.controls.icontrolwait-1.md b/docs/apis/pplus.controls.icontrolwait-1.md index d4e7434e..909a1cde 100644 --- a/docs/apis/pplus.controls.icontrolwait-1.md +++ b/docs/apis/pplus.controls.icontrolwait-1.md @@ -209,6 +209,26 @@ IEnumerable values for custom spinner. Valid only to SpinnersType.custom, otherw [IControlWait<T>](./pplus.controls.icontrolwait-1.md) +### **Styles(StyleWait, Style)** + +Overwrite Styles Wait. [StyleWait](./pplus.controls.stylewait.md) + +```csharp +IControlWait Styles(StyleWait styletype, Style value) +``` + +#### Parameters + +`styletype` [StyleWait](./pplus.controls.stylewait.md)
+Styles Wait + +`value` [Style](./pplus.style.md)
+[Style](./pplus.style.md) + +#### Returns + +[IControlWait<T>](./pplus.controls.icontrolwait-1.md) + ###
**TaskTitle(String)** Overwrite Task Title . Default task title comes from the embedded resource. diff --git a/docs/apis/pplus.controls.stylebrowser.md b/docs/apis/pplus.controls.stylebrowser.md index 799cbfcf..4b7c0bca 100644 --- a/docs/apis/pplus.controls.stylebrowser.md +++ b/docs/apis/pplus.controls.stylebrowser.md @@ -26,17 +26,16 @@ Implements [IComparable](https://docs.microsoft.com/en-us/dotnet/api/system.icom | Name | Value | Description | | --- | --: | --- | | CurrentFolder | 0 | CurrentFolder Region | -| Lines | 1 | Lines Region | -| UnselectedSize | 2 | Unselected Size region/state | -| UnselectedExpand | 3 | Unselected Expand region/state | -| UnselectedRoot | 4 | Unselected Root region/state | -| UnselectedFolder | 5 | Unselected Folder region/state | -| UnselectedFile | 6 | Unselected File region/state | -| SelectedSize | 7 | Selected Size region/state | -| SelectedExpand | 8 | Selected Expand region/state | -| SelectedRoot | 9 | Selected Root region/state | -| SelectedFile | 10 | Selected File region/state | -| SelectedFolder | 11 | Selected Folder region/state | +| UnselectedSize | 1 | Unselected Size region/state | +| UnselectedExpand | 2 | Unselected Expand region/state | +| UnselectedRoot | 3 | Unselected Root region/state | +| UnselectedFolder | 4 | Unselected Folder region/state | +| UnselectedFile | 5 | Unselected File region/state | +| SelectedSize | 6 | Selected Size region/state | +| SelectedExpand | 7 | Selected Expand region/state | +| SelectedRoot | 8 | Selected Root region/state | +| SelectedFile | 9 | Selected File region/state | +| SelectedFolder | 10 | Selected Folder region/state | - - - diff --git a/docs/apis/pplus.controls.stylecalendar.md b/docs/apis/pplus.controls.stylecalendar.md index 2becc79b..0c96d954 100644 --- a/docs/apis/pplus.controls.stylecalendar.md +++ b/docs/apis/pplus.controls.stylecalendar.md @@ -25,14 +25,11 @@ Implements [IComparable](https://docs.microsoft.com/en-us/dotnet/api/system.icom | Name | Value | Description | | --- | --: | --- | -| Line | 0 | lines content | -| Disabled | 1 | Disabled content | -| Selected | 2 | Selected content | -| Highlight | 3 | Highlight content | -| Day | 4 | Day content | -| Month | 5 | Month content | -| Year | 6 | Year content | -| WeekDay | 7 | Week Day content | +| Highlight | 0 | Highlight content | +| Day | 1 | Day content | +| Month | 2 | Month content | +| Year | 3 | Year content | +| WeekDay | 4 | Week Day content | - - - diff --git a/docs/apis/pplus.controls.stylecontrols.md b/docs/apis/pplus.controls.stylecontrols.md index ca2bd162..1d4b2b3f 100644 --- a/docs/apis/pplus.controls.stylecontrols.md +++ b/docs/apis/pplus.controls.stylecontrols.md @@ -38,6 +38,8 @@ Implements [IComparable](https://docs.microsoft.com/en-us/dotnet/api/system.icom | Tooltips | 10 | Tooltips Region | | Slider | 11 | Slider Region | | Chart | 12 | Chart Region | +| Ranger | 13 | Ranger Region | +| Lines | 14 | Lines Region | - - - diff --git a/docs/apis/pplus.controls.styleschemaextensions.md b/docs/apis/pplus.controls.styleschemaextensions.md index 91684549..95290cac 100644 --- a/docs/apis/pplus.controls.styleschemaextensions.md +++ b/docs/apis/pplus.controls.styleschemaextensions.md @@ -25,7 +25,7 @@ Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) ### **Answer(StyleSchema)** Get [Style](./pplus.style.md) text Answer. -
ValueResult Foreground : 'ConsoleColor.Cyan'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.Cyan'
Background : same Console Background when not set ```csharp public static Style Answer(StyleSchema schema) @@ -88,7 +88,7 @@ Foreground [Color](./pplus.color.md) ###
**Chart(StyleSchema)** Get [Style](./pplus.style.md) text Chart. -
ValueResult Foreground : 'ConsoleColor.White'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.White'
Background : same Console Background when not set ```csharp public static Style Chart(StyleSchema schema) @@ -105,7 +105,7 @@ public static Style Chart(StyleSchema schema) ###
**Description(StyleSchema)** Get [Style](./pplus.style.md) text Description. -
ValueResult Foreground : 'ConsoleColor.DarkYellow'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.DarkYellow'
Background : same Console Background when not set ```csharp public static Style Description(StyleSchema schema) @@ -122,7 +122,7 @@ public static Style Description(StyleSchema schema) ###
**Disabled(StyleSchema)** Get [Style](./pplus.style.md) text Disabled. -
ValueResult Foreground : 'ConsoleColor.DarkGray'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.DarkGray'
Background : same Console Background when not set ```csharp public static Style Disabled(StyleSchema schema) @@ -139,7 +139,7 @@ public static Style Disabled(StyleSchema schema) ###
**Error(StyleSchema)** Get [Style](./pplus.style.md) text Error. -
ValueResult Foreground : 'ConsoleColor.Red'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.Red'
Background : same Console Background when not set ```csharp public static Style Error(StyleSchema schema) @@ -153,10 +153,27 @@ public static Style Error(StyleSchema schema) [Style](./pplus.style.md) +###
**Lines(StyleSchema)** + +Get [Style](./pplus.style.md) Lines. +
Foreground : 'ConsoleColor.White'
Background : same Console Background when not set + +```csharp +public static Style Lines(StyleSchema schema) +``` + +#### Parameters + +`schema` [StyleSchema](./pplus.controls.styleschema.md)
+ +#### Returns + +[Style](./pplus.style.md) + ###
**Pagination(StyleSchema)** Get [Style](./pplus.style.md) text Pagination. -
ValueResult Foreground : 'ConsoleColor.DarkGray'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.DarkGray'
Background : same Console Background when not set ```csharp public static Style Pagination(StyleSchema schema) @@ -173,7 +190,7 @@ public static Style Pagination(StyleSchema schema) ###
**Prompt(StyleSchema)** Get [Style](./pplus.style.md) text Prompt. -
ValueResult Foreground : 'ConsoleColor.White'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.White'
Background : same Console Background when not set ```csharp public static Style Prompt(StyleSchema schema) @@ -187,10 +204,27 @@ public static Style Prompt(StyleSchema schema) [Style](./pplus.style.md) +###
**Ranger(StyleSchema)** + +Get [Style](./pplus.style.md) Range. +
Foreground : 'ConsoleColor.DarkYellow'
Background : same Console Background when not set + +```csharp +public static Style Ranger(StyleSchema schema) +``` + +#### Parameters + +`schema` [StyleSchema](./pplus.controls.styleschema.md)
+ +#### Returns + +[Style](./pplus.style.md) + ###
**Selected(StyleSchema)** Get [Style](./pplus.style.md) text Selected. -
ValueResult Foreground : 'ConsoleColor.Green'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.Green'
Background : same Console Background when not set ```csharp public static Style Selected(StyleSchema schema) @@ -207,7 +241,7 @@ public static Style Selected(StyleSchema schema) ###
**Slider(StyleSchema)** Get [Style](./pplus.style.md) text Slider-On(Foreground)/Slider-Off(Background). -
ValueResult Foreground : 'ConsoleColor.Cyan'
ValueResult Background : 'ConsoleColor.DarkGray' +
Foreground : 'ConsoleColor.Cyan'
Background : 'ConsoleColor.DarkGray' ```csharp public static Style Slider(StyleSchema schema) @@ -224,7 +258,7 @@ public static Style Slider(StyleSchema schema) ###
**Suggestion(StyleSchema)** Get [Style](./pplus.style.md) text Suggestion. -
ValueResult Foreground : 'ConsoleColor.Yellow'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.Yellow'
Background : same Console Background when not set ```csharp public static Style Suggestion(StyleSchema schema) @@ -241,7 +275,7 @@ public static Style Suggestion(StyleSchema schema) ###
**TaggedInfo(StyleSchema)** Get [Style](./pplus.style.md) text Tagged info. -
ValueResult Foreground : 'ConsoleColor.DarkYellow'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.DarkYellow'
Background : same Console Background when not set ```csharp public static Style TaggedInfo(StyleSchema schema) @@ -258,7 +292,7 @@ public static Style TaggedInfo(StyleSchema schema) ###
**Tooltips(StyleSchema)** Get [Style](./pplus.style.md) text Tooltips. -
ValueResult Foreground : 'ConsoleColor.DarkGray'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.DarkGray'
Background : same Console Background when not set ```csharp public static Style Tooltips(StyleSchema schema) @@ -275,7 +309,7 @@ public static Style Tooltips(StyleSchema schema) ###
**UnSelected(StyleSchema)** Get [Style](./pplus.style.md) text UnSelected. -
ValueResult Foreground : 'ConsoleColor.Gray'
ValueResult Background : same Console Background when set +
Foreground : 'ConsoleColor.Gray'
Background : same Console Background when not set ```csharp public static Style UnSelected(StyleSchema schema) diff --git a/docs/apis/pplus.controls.styletreeview.md b/docs/apis/pplus.controls.styletreeview.md index 93bc01c5..48dd1e98 100644 --- a/docs/apis/pplus.controls.styletreeview.md +++ b/docs/apis/pplus.controls.styletreeview.md @@ -26,15 +26,14 @@ Implements [IComparable](https://docs.microsoft.com/en-us/dotnet/api/system.icom | Name | Value | Description | | --- | --: | --- | | CurrentNode | 0 | CurrentNode Region | -| Lines | 1 | Lines Region | -| UnselectedRoot | 2 | Unselected Root Region/State | -| UnselectedExpand | 3 | Unselected Expand Region/State | -| UnselectedParent | 4 | Unselected Parent Region/State | -| UnselectedChild | 5 | Unselected Child Region/State | -| SelectedExpand | 6 | Selected Expand Region/State | -| SelectedRoot | 7 | Selected Root Region/State | -| SelectedParent | 8 | Selected Parent Region/State | -| SelectedChild | 9 | Selected Child Region/State | +| UnselectedRoot | 1 | Unselected Root Region/State | +| UnselectedExpand | 2 | Unselected Expand Region/State | +| UnselectedParent | 3 | Unselected Parent Region/State | +| UnselectedChild | 4 | Unselected Child Region/State | +| SelectedExpand | 5 | Selected Expand Region/State | +| SelectedRoot | 6 | Selected Root Region/State | +| SelectedParent | 7 | Selected Parent Region/State | +| SelectedChild | 8 | Selected Child Region/State | - - - diff --git a/docs/apis/pplus.controls.stylewait.md b/docs/apis/pplus.controls.stylewait.md new file mode 100644 index 00000000..6e31369f --- /dev/null +++ b/docs/apis/pplus.controls.stylewait.md @@ -0,0 +1,33 @@ +# PromptPlus API:StyleWait + +[![Build](https://github.com/FRACerqueira/PromptPlus/workflows/Build/badge.svg)](https://github.com/FRACerqueira/PromptPlus/actions/workflows/build.yml) +[![Publish](https://github.com/FRACerqueira/PromptPlus/actions/workflows/publish.yml/badge.svg)](https://github.com/FRACerqueira/PromptPlus/actions/workflows/publish.yml) +[![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/FRACerqueira/PromptPlus/blob/master/LICENSE) +[![NuGet](https://img.shields.io/nuget/v/PromptPlus)](https://www.nuget.org/packages/PromptPlus/) +[![Downloads](https://img.shields.io/nuget/dt/PromptPlus)](https://www.nuget.org/packages/PromptPlus/) + +[**Back to List Api**](./apis.md) + +# StyleWait + +Namespace: PPlus.Controls + +Represents The Style region of Wait + +```csharp +public enum StyleWait +``` + +Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ValueType](https://docs.microsoft.com/en-us/dotnet/api/system.valuetype) → [Enum](https://docs.microsoft.com/en-us/dotnet/api/system.enum) → [StyleWait](./pplus.controls.stylewait.md)
+Implements [IComparable](https://docs.microsoft.com/en-us/dotnet/api/system.icomparable), [IFormattable](https://docs.microsoft.com/en-us/dotnet/api/system.iformattable), [IConvertible](https://docs.microsoft.com/en-us/dotnet/api/system.iconvertible) + +## Fields + +| Name | Value | Description | +| --- | --: | --- | +| Label | 0 | Label Region | +| ElapsedTime | 1 | ElapsedTime Region | + + +- - - +[**Back to List Api**](./apis.md) diff --git a/docs/apis/pplus.controls.tablestyle.md b/docs/apis/pplus.controls.tablestyle.md index a3b19d93..6fbed81f 100644 --- a/docs/apis/pplus.controls.tablestyle.md +++ b/docs/apis/pplus.controls.tablestyle.md @@ -25,13 +25,9 @@ Implements [IComparable](https://docs.microsoft.com/en-us/dotnet/api/system.icom | Name | Value | Description | | --- | --: | --- | -| Grid | 0 | Grid lines | -| Title | 1 | Title content | -| Header | 2 | Header content | -| SelectedHeader | 3 | Selected Header content | -| Content | 4 | Data content | -| DisabledContent | 5 | Disabled content | -| SelectedContent | 6 | Selected content | +| Title | 0 | Title content | +| Header | 1 | Header content | +| Content | 2 | Data content | - - - diff --git a/docs/apis/pplus.promptplus.md b/docs/apis/pplus.promptplus.md index 7cc0627c..f992d706 100644 --- a/docs/apis/pplus.promptplus.md +++ b/docs/apis/pplus.promptplus.md @@ -2292,12 +2292,12 @@ The config action [IPromptConfig](./pplus.controls.ipromptconfig.md) [IControlWait<T>](./pplus.controls.icontrolwait-1.md) -###
**WaitTimer(String, TimeSpan, SpinnersType, Boolean, Action<IPromptConfig>, Nullable<CancellationToken>)** +### **WaitTimer(String, TimeSpan, SpinnersType, Boolean, Action<IPromptConfig>, Nullable<Style>, Nullable<Style>, Nullable<CancellationToken>)** Create Wait Control with step [TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/system.timespan) delay and run ```csharp -public static void WaitTimer(string prompt, TimeSpan delay, SpinnersType spinnersType, bool showCountdown, Action config, Nullable cancellationToken) +public static void WaitTimer(string prompt, TimeSpan delay, SpinnersType spinnersType, bool showCountdown, Action config, Nullable