Resetting many combo boxes

BlitzMax Forums/MaxGUI Module/Resetting many combo boxes

Nokiaman(Posted 2008) [#1]
Hi,
I have 40 combo boxes aranged in a grid (5x8) that I want to be able to reset to their default value by the click of another button. I'm using Logic Gui Version 3.0 Build 317 to create the GUI. How do I do this easily? Currently I've made the combo boxes Global and I'm clearing them individually but surely there must be a better way? Apologies if this has already been covered before.
Thanks
Lee


SebHoll(Posted 2008) [#2]
The best way I can think of doing this, is by storing the gadget objects for the comboboxes in a gadget array. You could then use a For...Loop to iterate through the array, resetting them. The only problem being that I don't think LogicGui supports gadget arrays, so you'd have to convert the gadgets to an array yourself.


jsp(Posted 2008) [#3]
Logic Gui can create a gadget list (TList) for you, if that helps. Open the Properties Editor and choose Application/Gadgets/ Enable GadgetCommander. Every gadget will then put in this list and you can run certain actions on it. Depending on the structure of your program you can copy the list and do your own manipulations or shrink the original 'GadgetList' that only your Comboboxes are inside. The GadgetList created lets you access all your gadgets inside your event functions without the need to set them all to global.
Then go trough the list via each in ... to reset all boxes.

I'm just creating a second flash tutorial video which shows some of those things (not your special problem though) i hope i finish it this evening and will post it then, that could help as well.


Nokiaman(Posted 2008) [#4]
Thanks for the replies.
I'd thought about the array option but I'll try the TList approach and let you know how I get on.
Thanks
Lee