Difference between revisions of "Lua:Class:Menu"

From Cheat Engine
Jump to navigation Jump to search
(Major overhaul of the post.)
m
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
{{CodeBox|'''class''' Menu ''':''' Component}}
+
{{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

{} 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[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()

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Form Related Classes