Difference between revisions of "Lua:Class:Menu"
Jump to navigation
Jump to search
(Major overhaul of the post.) |
m |
||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | {{ | + | {{Class|'''class''' Menu ''':''' Component}} |
The Menu class represents a menu component. | The Menu class represents a menu component. | ||
Latest revision as of 00:28, 25 June 2026
The Menu class represents a menu component.
A Menu inherits from Component and Object. It provides access to the root MenuItem object through the Items property or the getItems() method.
Contents
Inheritance[edit]
| Class | Inherits From | Description |
|---|---|---|
| Menu | Component | A menu component that provides access to its root MenuItem. |
| Component | Object | Base class for components. |
Properties[edit]
| Property | Type | Description |
|---|---|---|
| Items | MenuItem | The base MenuItem object of this menu. This property is read-only. |
Methods[edit]
| Method | Return Type | Description |
|---|---|---|
| getItems() | MenuItem | Returns the main MenuItem object of this menu. |
Examples[edit]
local form = createForm() local menu = createMainMenu(form) form.Menu = menu local root = menu.Items local fileItem = createMenuItem(menu) fileItem.Caption = "File" root.add(fileItem) form.show()
local form = createForm() local menu = createMainMenu(form) form.Menu = menu local root = menu.getItems() local item = createMenuItem(menu) item.Caption = "Example" root.add(item) form.show()