Enable\Disable Multiselect Listbox

BlitzMax Forums/MaxGUI Module/Enable\Disable Multiselect Listbox

BLaBZ(Posted 2012) [#1]
Is it possible to Enable\Disable Multiselect Listbox?

Thanks


col(Posted 2012) [#2]
Hiya,

You can use LISTBOX_MULTISELECT in the flag parameter in the CreateListBox([...]) function, then use SelectedGadgetItems to get an array of the currently selected indices.


Henri(Posted 2012) [#3]
Is it possible to do the same with treeview ?

-Henri


jsp(Posted 2012) [#4]
Is it possible to Enable\Disable Multiselect Listbox?

If you need only one selection, you could remember the last selection and deselect it by code when a new selection has been detected. Thus one item is the maximum.

Is it possible to do the same with treeview ?

There is no MaxGUI command for it, but it can be done via an icon in front of the nodes.
If selected show a certain meaningful icon for that node. Remember internally with a flag the state. Do so for all selected treeview nodes and you have a multiselect treeview.


Henri(Posted 2012) [#5]
Can you perhaps provide an example of this ?

-Henri


jsp(Posted 2012) [#6]
Here is an example you may can adapt for your use:
Please load your own icons at LoadPixmap( "CheckMarks.png" ) before running.




Henri(Posted 2012) [#7]
Thank you for your very nice example. Now all I have to do is figure out how select multiple nodes at the same time.

-Henri


jsp(Posted 2012) [#8]
That should be doable. Maybe with shift click and then calculate start and stop item and select all in between.