Listbox with multiple selections?

BlitzMax Forums/BlitzMax GUI Programming/Listbox with multiple selections?

Hi,

is there a way to make a listbox with multiple selections?

I tried

AddGadgetItem (names , sf.getName() ,GADGETITEM_TOGGLE)

but that doesn't work. If I start that program, I can't selected the entries at all!

Also the other flags in the docs at AddGadgetItem aren't working.

I don't think MaxGUI supports this, but Seb might disagree?

Seb, Can one get an Array of selected items from a MaxGUI listbox?

But why is there the command SelectedGadgetItems[](gadget:TGadget)?

In the manual there is written:

Function SelectedGadgetItems[](gadget:TGadget)
Description Get selected items in a list based gadget.
Information See Also: CreateComboBox, CreateListBox and CreateTabber

So I think it must be possible?

But why is there the command SelectedGadgetItems[](gadget:TGadget)?

Probably because Skidracer originally planned for gadgets to be able to handle multiple-selections, but never got round to it. Quite a lot of the framework is there, it's just the current MaxGUI platform implementations don't allow for it.

I might have a look into this sometime soon, but atm, MaxGUI doesn't support it...

Here is the code I have used in the past
It is for windows only.

Function ListBoxGadgetMultiSelect(ListBox:TGadget)
	Local ListboxHwnd = QueryGadget(ListBox,QUERY_HWND)
	Local ListBoxstyle = GetWindowLongA(ListboxHwnd , GWL_STYLE)
	If  (ListBoxstyle & LVS_SINGLESEL) = LVS_SINGLESEL Then
		Return SetWindowLongA(ListboxHwnd , GWL_STYLE,  ListBoxstyle  ~ LVS_SINGLESEL )  'change the style 		
	EndIf
End Function