Lua:Class:Menu

From Cheat Engine
Jump to navigation Jump to search

{} Class

class Menu : Component

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.

Inheritance

Class Inherits From Description
Menu Component A menu component that provides access to its root MenuItem.
Component Object Base class for components.

Properties

Property Type Description
Items MenuItem The base MenuItem object of this menu. This property is read-only.

Methods

Method Return Type Description
getItems() MenuItem Returns the main MenuItem object of this menu.

Examples

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()

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Form Related Classes