Require help with combobox problem

Everything else that doesn't fall into one of the other PB categories.
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

Require help with combobox problem

Post by halo »

I am using PureBasic to place windows gadgets in a Blitz window.

I can detect the state of a combobox gadget, but can't really receive the events. I am using comboboxes to list textures and other things. Every time the combobox is changed, a new texture may be loaded, which takes a few seconds.

The problem is that PureBasic is changing the gadget state even while the combobox is open. This means that as you move the mouse down the combobox, each item you pass over slows the program down.

I need to be able to see if a combobox is open or closed, and only then compare the state to the last state recorded, and see if I need to load a new texture.

If anyone knows how to do this, please say so. Thanks.
TeddyLM
Enthusiast
Enthusiast
Posts: 133
Joined: Wed Apr 30, 2003 2:04 pm
Location: Germany (French expat)

Post by TeddyLM »

Hi halo

i hope this can help :



;Test Combo
If OpenWindow(0, 0, 0, 200, 150, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "Test Combo")
If CreateGadgetList(UseWindow(0))
ComboBoxGadget(1, 50, 30, 100, 90)
AddGadgetItem(1,0,"1")
AddGadgetItem(1,1,"2")
AddGadgetItem(1,2,"3")
TextGadget(2, 40, 120, 110, 30, "COMBO : ??????")
EndIf
Repeat
EventID = WaitWindowEvent()
GadgetID = EventGadgetID()
If EventID = #PB_EventGadget
Select GadgetID
Case 1
If SendMessage_(GadgetID(1), #CB_GETDROPPEDSTATE, 0, 0) = 1
SetGadgetText(2,"COMBO : DROPPED")
Else
SetGadgetText(2,"COMBO : RELEASED")
EndIf
EndSelect
EndIf
Until EventID = #PB_EventCloseWindow
EndIf
End
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

Post by halo »

Thanks!
Post Reply