I'm at a loss as to how to use this ComboBox style. How do I retrieve the user entered text? This is my attempt so far
SuperStrict
Local MyWindow:TGadget=CreateWindow("ComboBox Example", 200,200,320,240)
Local ComboBox:TGadget=CreateComboBox(10,10,200,100,MyWindow,COMBOBOX_EDITABLE)
Local GoButton:TGadget=CreateButton("GO",215,10,20,20,MyWindow)
For Local i:Int=1000 To 1050
AddGadgetItem ComboBox,i
Next
Local s:String
ActivateGadget ComboBox
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
Case EVENT_GADGETACTION
Select EventSource()
Case GoButton
s=TextFieldText(ComboBox)
SetStatusText MyWindow, "TextField=" + s '+ "GadgetItemTxet="+GadgetItemText(ComboBox,?)
Case ComboBox
Local i:Int= SelectedGadgetItem(ComboBox)
If i>0 s=GadgetItemText(ComboBox,i)
SetStatusText MyWindow, "index="+i + ":item=" + s
End Select
End Select
Forever
|