func_maxgui_popupwindowmenu.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .. _func_maxgui_popupwindowmenu:
  2. ===============
  3. PopupWindowMenu
  4. ===============
  5. PopupWindowMenu -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. PopupWindowMenu( window:TGadget,menu:TGadget,extra:Object=Null )
  10. Display a popup menu.
  11. A drop-down menu is displayed on the screen below the user's current mouse position.
  12. See Also: #CreateMenu
  13. Parameters
  14. ==========
  15. Return Values
  16. =============
  17. Nothing.
  18. Examples
  19. ========
  20. .. code-block:: blitzmax
  21. Strict
  22. Import MaxGui.Drivers
  23. Local menu:TGadget
  24. Local window:TGadget
  25. Local panel:TGadget
  26. menu=CreateMenu("popup",0,Null)
  27. CreateMenu("Load",101,menu)
  28. CreateMenu("Save",102,menu)
  29. window=CreateWindow("Test PopupWindowMenu",20,20,200,200)
  30. ' create a panel to capture some mouse events
  31. panel=CreatePanel(0,0,ClientWidth(window),ClientHeight(window),window,PANEL_ACTIVE)
  32. While True
  33. WaitEvent
  34. Select EventID()
  35. Case EVENT_MOUSEDOWN
  36. If EventData()=2 PopupWindowMenu window,menu
  37. Case EVENT_WINDOWCLOSE
  38. End
  39. Case EVENT_MENUACTION
  40. Print "EVENT_MENUACTION: eventdata()="+EventData()
  41. End Select
  42. Wend
  43. See Also
  44. ========