Comments (8)
@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();
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();
Note: The 'Page Size' setting takes into account all items that are shown
from promptplus.
@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:
from promptplus.
@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();
from promptplus.
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.
from promptplus.
Option 1
> Option 2
Option 3
---------------
Option 4
Option 5
Option 6
Just simple separating lines, no nesting
from promptplus.
@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();
from promptplus.
Awesome, thank you!
- I'd call it
Separator
since this is a fairly common term in programming for such things, rather thanSeparationline
(it'd at least have to beSeparationLine
). - The separators/group titles seem to count towards the item count on the page (10 items when there's 8 + 2 separators).
from promptplus.
Perfect
from promptplus.
Related Issues (20)
- Add command HideRange to not show range in the Slider Control
- Add Styles command for custom colors on all controls
- Table control does not render correctly when it does not support Unicode
- Refinement of Unicode symbol rendering in all controls
- Optional value refinement for generic class
- Optimize the WaitControl control (for cancel correctly tasks)
- Remove Control Pipeline to use PipeAndFilter component
- PromptPlus output becomes messy from inside Parallel.ForEach or Parallel.Invoke functions HOT 4
- PromptPlus output ignores moved cursor position by asynchronous operations
- PromptPlus.WriteLine does not print stringified JSON HOT 1
- Exception when try delete[F3] in empty colletion in AddTolist/AddtoMaskEditList control
- Edit[F2] Immutable item in AddTolist/AddtoMaskEditList control
- CTRL-V (paste data) does not show input in some controls
- Add TargetFramework .NET8
- Review method names for clarity
- Review EastAsia-Width function (Better understand how it works and research implementations) HOT 1
- Color Token accepts ':' to separate foreground color from background color
- Review Licences and Credits
- Add command Styles for custom color in the WaitProcess/WaitTime control
- Add global StyleSchema Ranger/Lines for custom color
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promptplus.