Page 1 of 1

[Granted] inputselect() - user configurable icon

Posted: 30 Jul 2011 10:45
by highend
Hi,

may I suggest to add a tiny bit of functionality to the inputselect() command?

Parameter: [style=1]

Enhancement: Add the option to add a separator (defaults to: "|") behind the number followed by path & filename for an icon resource.

Like:

Code: Select all

"1|<xypath>\Icons\Users.ico"
"2|D:\Tools\Webserver\server.exe"
"4|<xydrive>\.Icons\management.ico"
A real word example:

Code: Select all

$AllUsers = "Peter|Paul|Mary";
$SelectedUser = inputselect("Select the username:", $AllUsers, , "1|<xypath>\.Icons\usermanagement.ico");
Leads to:
Unbenannt-1.png
Unbenannt-1.png (8.68 KiB) Viewed 1231 times
Would be a nice addition :)

Tia,
highend

Re: inputselect() - user configurable icon

Posted: 01 Aug 2011 12:49
by TheQwerty
I have one issue with this wish... at times I'd like to define separate icons for each item, not just one for all of them.

So instead of adjusting style, I suggest a new argument to the InputSelect command: Icons.

If icons is omitted it falls back to the current behavior.
If icons does not contain separator then it is treated as a single icon for all items.
Otherwise icons is treated as a list of icons corresponding to the list of items (listdata[n] gets icons[n])

As an example of the last case:
listdata = "itemA|itemB|itemC|itemD"
icons = "iconA||iconC"

itemA would have iconA
itemB would have itemB's actual icon. (Handling the case of omitted icon-tokens.)
itemC would have iconC
itemD would have itemD's actual icon. (Handling the case of fewer icons then listdata items.)


To achieve highend's desired output it would be:

Code: Select all

$AllUsers = "Peter|Paul|Mary";
$SelectedUser = inputselect("Select the username:", $AllUsers, /*separator*/, "1", /*cancel*/, /*width*/, /*height*/, /*title*/,"<xypath>\.Icons\usermanagement.ico");

Re: inputselect() - user configurable icon

Posted: 31 Aug 2011 13:31
by admin
Both can make sense. But low priority.

Re: inputselect() - user configurable icon

Posted: 18 Mar 2013 15:28
by TheQwerty
*bump*

Could really use this for the scripting version of Type Stats and Filters.

Re: inputselect() - user configurable icon

Posted: 18 Mar 2013 15:57
by klownboy
+ one for this 1 especially individualized icons for each selection choice.