Feature Request: to specify order of input items
I am building an input form that has three selectable lists (drop down menus) and two text input boxes. Currently the text input appears before the drop-downs but I'd like the text input to appear after the drop-down instead.
Can dialog have an option for strict ordering in which certain items are added? Or would it be possible to add an index=# parameter to certain customizable items and then add an "index order" statement to control the order of their appearance?
Proposed example below.
/usr/local/bin/dialog -d --title "Test window." \
--selecttitle index=0,"What flavor of ice cream is your favorite?" \
--selectvalues "Vanilla, Chocolate, Lemon Sherbet, Salted Caramel, Something Nutty" \
--selecttitle index=1,"How long does your ice cream last?" \
--selectvalues "A few seconds, a few minutes, After a few hours, A few days, It varies, Unsure" \
--selecttitle index=2,"When did you last eat ice cream?" \
--selectvalues "I am eating it now, Less than 20 minutes ago, Less than 1 hour ago, 1-6 hours ago, 6-12 hours ago, 12-24 hours ago, More than 24 hours ago" \
--textfield index=3,"Ice cream description",prompt="Briefly describe the ice cream and steps to digest it." \
--textfield index=4,"Ice cream brand",prompt="What is your favorite ice cream brand?" \
--displayindexorder "4,0,1,2,3"
This is something I've thought about.
Strict ordering would be my preferred. The argument parser includes an index so for select items it should be possible to create an ordered list.
@bartreardon : happy Monday. Just wondering if this is on the roadmap for v2.0 ?
Cheers.
indeed it is - to implement this in v1 is a complete re-write of how that code is managed anyway and a rewrite is what I'm doing for v2. If might not make it for v2.0 but the requirements to make it work are being considered.
At the moment I'm using SwiftUI's native logic for presenting multiple views which works well for a long list of things that are all the same. text boxes, dropdowns, etc are all different types of views so instead of a simple "for each" to display one or more things I essentially have to unroll everything into a seperate array, re-order the array based on what your desired ordering is, then re-draw it all. This will have implications for making all content modifiable on the fly which is also a v2 roadmap feature.
as you could imaging, this will take a bit of work to figure it out nicely.
+1
@bartreardon : I'm guessing this hasn't been worked out yet...? Does SwiftUI let you define an array of views in any arbitrary order?
it does. you can represent the views as an array of objects then display them however you like. I haven't looked into it yet though to work out a nice way of representing it.
@bradtchapman doing per item ordering might be a bit more work - initial implementation to allow re-arrangement of groups of items
Fixed (to a reasonable approximation) in v2.5.0