Code: Select all
If OpenWindow(0, 0, 0, 270, 140, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ComboBoxGadget(0, 10, 10, 250, 21, #PB_ComboBox_Editable)
AddGadgetItem(0, -1, "ComboBox editable...")
For a = 1 To 5
AddGadgetItem(0, -1,"ComboBox item " + Str(a))
Next
SetGadgetState(0, 2) ; set (beginning with 0) the third item as active one
Repeat
event=WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
quit=#True
Case #PB_Event_Gadget
gadget=EventGadget()
If eventgadget=0
type=EventType()
Select type
Case #PB_EventType_RightClick ; right mouse button click
Debug("right click - is really 'select from pulldown'")
Case #PB_EventType_RightDoubleClick; Right mouse button double click
Debug("right double click - is really 'focus'")
Case #PB_EventType_Focus ; Get the focus.
Debug("should be 'focus', but not with this gadget!")
Case #PB_EventType_LostFocus ; Lose the focus.
Debug("should be 'lost focus', but not with this gadget!")
Case #PB_EventType_Change ; Content change.
Debug("should be 'change', but not with this gadget!")
Case 4
Debug("is really 'lost focus'")
Case 7
Debug("is really 'display pull-down'")
Case 8
Debug("is really 'cancel pull-down'")
Case 5
Debug("is really 'change'")
Default
Debug("Type: "+Hex(type))
EndSelect
EndIf
EndSelect
Until quit
EndIf
Please don't kill the 'display pulldown' and 'cancel pulldown' events though as they are pretty useful.
