Class LM_PopupMenu
Parent classes: LM_BaseWidget < LM_View
Version added:
before 9.5
The LM_PopupMenu class creates a popup menu widget on the screen. Clicking on this object will bring up the actual menu. To create a new popup menu widget, you would use the LM.GUI.PopupMenu method. See the example below:
SZ_MenuTest.OPTION1 = MOHO.MSG_BASE
SZ_MenuTest.OPTION2 = MOHO.MSG_BASE+1
SZ_MenuTest.OPTION3 = MOHO.MSG_BASE+2
function SZ_MenuTest:DoLayout(moho, layout)
self.menu = LM.GUI.Menu("My Menu")
self.popup = LM.GUI.PopupMenu(120, false)
self.popup:SetMenu(self.menu)
layout:AddChild(self.popup)
self.menu:AddItem("Option 1", 0, self.OPTION1)
self.menu:AddItem("Option 2", 0, self.OPTION2)
self.menu:AddItem("Option 3", 0, self.OPTION3)
end
Methods of LM_PopupMenu:
Name | Returns | Description | Ver |
Menu | LM_Menu | Returns the menu object attached to the popup menu | < 9.5 |
SetMenu | void | Use this function to attach a menu to the widget so that when the user clicks on it, the menu appears | < 9.5 |
Methods inherited from LM_BaseWidget:
Name | Returns | Description | Ver |
Redraw | void | Call this function to force the widget to redraw itself | < 9.5 |
Methods inherited from LM_View:
Name | Returns | Description | Ver |
Enable | void | Enables or disables a view object | < 9.5 |
Height | int32 | Added in version 11 | 11 |
IsEnabled | bool | Tells whether the view is currently enabled | < 9.5 |
IsMouseDragging | bool | Added in version 11 | 11 |
SetCursor | void | Change the cursor | < 9.5 |
SetToolTip | void | Added in version 12 | 12 |
Width | int32 | Added in version 11 | 11 |