[Granted] inputselect() - user configurable icon

Features wanted...
Post Reply
highend
Posts: 14566
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

[Granted] inputselect() - user configurable icon

Post 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 1230 times
Would be a nice addition :)

Tia,
highend
One of my scripts helped you out? Please donate via Paypal

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: inputselect() - user configurable icon

Post 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");

admin
Site Admin
Posts: 64847
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: inputselect() - user configurable icon

Post by admin »

Both can make sense. But low priority.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: inputselect() - user configurable icon

Post by TheQwerty »

*bump*

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

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: inputselect() - user configurable icon

Post by klownboy »

+ one for this 1 especially individualized icons for each selection choice.

Post Reply