Enable\Disable Multiselect Listbox
BlitzMax Forums/MaxGUI Module/Enable\Disable Multiselect Listbox
| ||
Is it possible to Enable\Disable Multiselect Listbox? Thanks |
| ||
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. |
| ||
Is it possible to do the same with treeview ? -Henri |
| ||
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. |
| ||
Can you perhaps provide an example of this ? -Henri |
| ||
Here is an example you may can adapt for your use: Please load your own icons at LoadPixmap( "CheckMarks.png" ) before running. |
| ||
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 |
| ||
That should be doable. Maybe with shift click and then calculate start and stop item and select all in between. |