Page 1 of 3
Combo-box enhanced input field
Posted: 13 Jul 2021 11:25
by highend
Can we get an enhanced
input() that displays a small drop-down arrow on the right side that lets us selected from a given list of items?
E.g.
Code: Select all
input(topic, [notes], [default], [style=s|m|w], [cancel], [width=800], [height=400], [a pipe or <CRLF> separated list of item(s) for the combo-box entries])
Reverting to html for this kind of standard dialog is always a bit cumbersome...
Animation.gif
Re: Combo-box enhanced input field
Posted: 13 Jul 2021 14:45
by klownboy
That's a great idea, and if/when desired the "default" input could be one of the listed items in the drop-down. +1
Re: Combo-box enhanced input field
Posted: 13 Jul 2021 15:06
by highend
and if/when desired the "default" input could be one of the listed items in the drop-down
It should be prefixed with a "+" if one should be the default. Otherwise the input field should be left empty
Re: Combo-box enhanced input field
Posted: 13 Jul 2021 15:32
by klownboy
highend wrote: ↑13 Jul 2021 15:06
It should be prefixed with a "+" if one should be the default.
So as not to break old code, the "default" field would have to remain. If a drop-down list is provided the default would, as you say, be designated by the + prefixed item and the default field ignored if not blank.
Re: Combo-box enhanced input field
Posted: 14 Jul 2021 10:56
by admin
Isn't that functionally quite like inputselect()?
Re: Combo-box enhanced input field
Posted: 14 Jul 2021 11:10
by highend
It adds a bit of its basic functionality to input()
I have dozens of use-cases in my scripts for this: Remember what was typed in before and give easy access to it (not only for a single entry^^) but let's you start from scratch as well.
E.g.: In my Everything script, remember e.g. the last 10 searches instead of the necessity to type them in again...
Re: Combo-box enhanced input field
Posted: 20 Jul 2021 11:24
by highend
*bump*
Re: Combo-box enhanced input field
Posted: 20 Jul 2021 14:10
by admin
So it's about select and also type, right? Like in the Quick Search dialog.
Re: Combo-box enhanced input field
Posted: 20 Jul 2021 14:18
by highend
Yepp
Re: Combo-box enhanced input field
Posted: 20 Jul 2021 16:41
by highend
Thanks for v22.10.0001!
One small issue:
The first entry of an item list is missing...
Code: Select all
$lastQuery = "ext:pbi c:prototype|/d everything|/f @Test.xys";
$query = input("Everything", 7:=$lastQuery);
ext:pbi c:prototype is not in the drop-down list...
Re: Combo-box enhanced input field
Posted: 20 Jul 2021 17:51
by admin
Whoops, should have noted that. Fix coming... As compensation you will get an icon parameter...

Re: Combo-box enhanced input field
Posted: 21 Jul 2021 00:08
by highend
Fixed with v22.10.0002
Great new asset!
Re: Combo-box enhanced input field
Posted: 21 Jul 2021 01:14
by klownboy
highend wrote: ↑21 Jul 2021 00:08
Great new asset!
One more tool in the XY toolbox. Thanks!

Re: Combo-box enhanced input field
Posted: 21 Jul 2021 13:40
by highend
[icon] is nice but it would be a lot nicer if it'd support files as well (png, ico, exe)...

Re: Combo-box enhanced input field
Posted: 21 Jul 2021 15:24
by eil
+1 i'd wish ico, png, exe could be supported as icons for anything
all over XY.
