Closed ividyon closed 1 year ago
@ividyon , here is this feature for multiselect. I'll mark it as an improvement and it will be very similar (same commands). An example of what it would look like:
@ividyon , Fixed scheduled for publication 4.0.6,
live Sample :
PromptPlus.DoubleDash("Control:Select - basic usage with group and AppendGroupOnDescription");
var selgrp = PromptPlus.Select<string>("Which cities would you like to visit?")
.AddItemsGrouped("North America", new[] { "Seattle", "Boston", "New York" })
.AddItemsGrouped("Asia", new[] { "Tokyo", "Singapore", "Shanghai" })
.AddItem("South America (Any)")
.AddItem("Europe (Any)")
.AppendGroupOnDescription()
.Run();
Hm, this is useful, but isn't quite what I was looking for; is it possible to just have a simple separator line (dashes) and no nesting visuals in the list? Just like my example in my post.
The separator lines could be as long as the longest string in the select list, and the character the line is made of could be customizable.
Option 1
> Option 2
Option 3
---------------
Option 4
Option 5
Option 6
Just simple separating lines, no nesting
@ividyon done!, was maintaining a new item nesting option and adding the separation line option. Note: When using the sort option in conjunction with separation line, the separation lines will be deleted
live Sample :
PromptPlus.Select<string>("Select")
.AddItem("Seattle")
.AddItem("New York")
.AddSeparationline() //Default Separationline : SeparationLineType.SingleLine
.AddItem("Tokyo")
.AddItem("Singapore")
.AddItem("Shanghai")
.AddSeparationline(SeparationLineType.DoubleLine)
.AddItem("London")
.AddSeparationline(SeparationLineType.Char, '*')
.AddItem("Other city")
.Run();
Awesome, thank you!
Separator
since this is a fairly common term in programming for such things, rather than Separationline
(it'd at least have to be SeparationLine
).@ividyon , No problem, change made to 'Separator' . I had already noticed that the item counter was taking into account separators and groupers, I just adjusted that too
PromptPlus.DoubleDash("Control:Select - basic usage with Separationline");
PromptPlus.Select<string>("Select")
.AddItem("Seattle")
.AddItem("New York")
.Separator() //Default SeparatorLine : SeparatorLine.SingleLine
.AddItem("Tokyo")
.AddItem("Singapore")
.AddItem("Shanghai")
.Separator(SeparatorLine.DoubleLine)
.AddItem("London")
.Separator(SeparatorLine.Char, '*')
.AddItem("Other city")
.Run();
output :
PromptPlus.DoubleDash("Control:Select - basic usage with group and AppendGroupOnDescription");
PromptPlus.Select<string>("Which cities would you like to visit?")
.AddItemsGrouped("North America", new[] { "Seattle", "Boston", "New York" })
.AddItemsGrouped("Asia", new[] { "Tokyo", "Singapore", "Shanghai" })
.AddItem("South America (Any)")
.AddItem("Europe (Any)")
.AppendGroupOnDescription()
.Run();
output :
Note: The 'Page Size' setting takes into account all items that are shown
Perfect
Is it possible to have "separator" lines in Select elements?
In this example, I'd like to have, for example, a dash line between the "Toggle" options and the others, which cannot be selected (the select would just hop over it to the next one).