func_maxgui_combo boxes_createcombobox.rst 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. .. _func_maxgui_combo boxes_createcombobox:
  2. ==============
  3. CreateComboBox
  4. ==============
  5. CreateComboBox -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. CreateComboBox:TGadget(x,y,w,h,group:TGadget,style=0)
  10. Create a ComboBox gadget.
  11. A ComboBox gadget provides a dropdown list of items to the user.
  12. The ComboBox supports the following styles:
  13. [ @Style | @Meaning
  14. * COMBOBOX_EDITABLE | Allows the ComboBox to behave similar to a TextField, by allowing typed user input also.
  15. ]
  16. And emits the following events:
  17. [ @{Event ID} | @Description
  18. * EVENT_GADGETACTION | An item has been selected, or the selection has been cleared.
  19. ]
  20. See Also: #AddGadgetItem, #ClearGadgetItems, #ModifyGadgetItem, #SelectGadgetItem,
  21. #RemoveGadgetItem and #SelectedGadgetItem.
  22. Parameters
  23. ==========
  24. Return Values
  25. =============
  26. Nothing.
  27. Examples
  28. ========
  29. .. code-block:: blitzmax
  30. ' createcombobox.bmx
  31. Import MaxGui.Drivers
  32. Strict
  33. Local window:TGadget
  34. Local combobox:TGadget
  35. window=CreateWindow("My Window",30,20,200,200)
  36. combobox=CreateComboBox(4,4,120,22,window)
  37. AddGadgetItem combobox,"Short"
  38. AddGadgetItem combobox,"Medium"
  39. AddGadgetItem combobox,"Fat",True
  40. AddGadgetItem combobox,"Humungous"
  41. While WaitEvent()
  42. Select EventID()
  43. Case EVENT_GADGETACTION
  44. Print "eventdata="+EventData()
  45. Case EVENT_WINDOWCLOSE
  46. End
  47. End Select
  48. Wend
  49. See Also
  50. ========