Page 1 of 1
inputselect() - return index of selected item
Posted: 02 Jul 2014 09:32
by highend
Don, would it be possible to let inputselect return the index of the selected item, e.g. by using an additional style (e.g. 128)
like popupmenu with the flag = 1?
I'm showing all open tabs via inputselect (because live filtering _rocks_!) and if you have more than one tab with the same destination folder I'm unable to switch to the correct one (by scripting) if it's not the first entry for that folder that get's selected. At least I can't find a way to do so...
An index would allow me to do so even if the list get's filtered

Re: inputselect() - return index of selected item
Posted: 02 Jul 2014 13:45
by LittleBiG
highend wrote:Don, would it be possible to let inputselect return the index of the selected item, e.g. by using an additional style (e.g. 128)
like popupmenu with the flag = 1?
I'm showing all open tabs via inputselect (because live filtering _rocks_!) and if you have more than one tab with the same destination folder I'm unable to switch to the correct one (by scripting) if it's not the first entry for that folder that get's selected. At least I can't find a way to do so...
An index would allow me to do so even if the list get's filtered

Why don't you attach the position of the tab before the folder name one by one and show the concatenated value in the inputselect? "1-C:\Windows", "2-C:\Documents\Office" and so on...
Re: inputselect() - return index of selected item
Posted: 02 Jul 2014 14:13
by highend
I wanted to stay away from "polluting" the path name (one of the reasons: I'm using folder icons for these entries in the list) but if it doesn't fit the nature of the inputselect() command or is too much work I'll go that route.
Thanks for the suggestion.
Re: inputselect() - return index of selected item
Posted: 02 Jul 2014 14:29
by LittleBiG
highend wrote:I wanted to stay away from "polluting" the path name (one of the reasons: I'm using folder icons for these entries in the list) but if it doesn't fit the nature of the inputselect() command or is too much work I'll go that route.
Thanks for the suggestion.
Code: Select all
//inputselect without visible pollution
$ch = inputselect(, "C: |D: |E: ",,0);
msg strlen($ch)-strlen(trim($ch,,"R"));
Just for fun

Re: inputselect() - return index of selected item
Posted: 03 Jul 2014 08:04
by admin
highend wrote:Don, would it be possible to let inputselect return the index of the selected item, e.g. by using an additional style (e.g. 128)
Yep, done.
Re: inputselect() - return index of selected item
Posted: 03 Jul 2014 08:57
by highend
@LittleBiG
A creative solution but somehow also crude
@Don
Thanks a lot!