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.
Require help with combobox problem
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
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
