Difference between revisions of "Lua:Class:MenuItem"
Jump to navigation
Jump to search
(→Related Functions) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | MenuItem '''class''': ('''Inheritance''': ''[[Component]]''->''[[Object]]'') | + | [[Category:Lua]] |
+ | MenuItem '''class''': ('''Inheritance''': ''[[Lua:Class:Component|Component]]''->''[[Lua:Class:Object|Object]]'') | ||
A clickable part of a menu. | A clickable part of a menu. | ||
== Creation == | == Creation == | ||
− | :; [[createMenuItem]]() : MenuItem | + | :; [[Lua:createMenuItem|createMenuItem]]() : MenuItem |
:: Creates an empty region. | :: Creates an empty region. | ||
Line 13: | Line 14: | ||
; ControlCount : integer | ; ControlCount : integer | ||
− | : The number of child controls of this [[WinControl]]. | + | : The number of child controls of this [[Lua:Class:WinControl|WinControl]]. |
; Control[''index''] : Control | ; Control[''index''] : Control | ||
− | : Array to access a child [[Control]]. | + | : Array to access a child [[Lua:Class:Control|Control]]. |
; OnEnter : function | ; OnEnter : function | ||
− | : Function to be called when the [[WinControl]] gains focus. | + | : Function to be called when the [[Lua:Class:WinControl|WinControl]] gains focus. |
; OnExit : function | ; OnExit : function | ||
− | : Function to be called when the [[WinControl]] loses focus. | + | : Function to be called when the [[Lua:Class:WinControl|WinControl]] loses focus. |
== Methods == | == Methods == | ||
; getControlCount() : integer | ; getControlCount() : integer | ||
− | : Returns the number of [[Control]]s attached to this class. | + | : Returns the number of [[Lua:Class:Control|Control]]s attached to this class. |
; getControl(''index'') : WinControl | ; getControl(''index'') : WinControl | ||
− | : Returns a [[WinControl]] class object. | + | : Returns a [[Lua:Class:WinControl|WinControl]] class object. |
; getControlAtPos(''x'', ''y'') : Control | ; getControlAtPos(''x'', ''y'') : Control | ||
− | : Gets the [[Control]] at the given x,y position relative to the [[WinControl]]'s position. | + | : Gets the [[Lua:Class:Control|Control]] at the given x,y position relative to the [[Lua:Class:WinControl|WinControl]]'s position. |
; canFocus() : boolean | ; canFocus() : boolean | ||
Line 44: | Line 45: | ||
; setShape(''region'') | ; setShape(''region'') | ||
− | : Sets the region object as the new shape for this [[WinControl]]. | + | : Sets the region object as the new shape for this [[Lua:Class:WinControl|WinControl]]. |
; setShape(''bitmap'') | ; setShape(''bitmap'') | ||
− | : Sets the Bitmap object as the new shape for this [[WinControl]]. | + | : Sets the Bitmap object as the new shape for this [[Lua:Class:WinControl|WinControl]]. |
; setOnEnter(''function'') | ; setOnEnter(''function'') | ||
Line 61: | Line 62: | ||
: Returns the onExit event. (Triggered on lost focus) | : Returns the onExit event. (Triggered on lost focus) | ||
− | + | {{LuaSeeAlso}} | |
− | |||
− | |||
=== Related Functions === | === Related Functions === | ||
− | * [[ | + | * [[Lua:createMainMenu|createMainMenu]] |
− | * [[ | + | * [[Lua:createMenuItem|createMenuItem]] |
− | * [[createPopupMenu]] | + | * [[Lua:createPopupMenu|createPopupMenu]] |
=== Related Classes === | === Related Classes === | ||
− | * [[Menu]] | + | * [[Lua:Class:Menu|Menu]] |
− | * [[ | + | * [[Lua:Class:MenuItem|MenuItem]] |
− | * [[PopupMenu]] | + | * [[Lua:Class:PopupMenu|PopupMenu]] |
− | * [[Form]] | + | * [[Lua:Class:Form|Form]] |
− | * [[Control]] | + | * [[Lua:Class:Control|Control]] |
− | * [[Component]] | + | * [[Lua:Class:Component|Component]] |
− | * [[WinControl]] | + | * [[Lua:Class:WinControl|WinControl]] |
Latest revision as of 02:04, 25 January 2018
MenuItem class: (Inheritance: Component->Object)
A clickable part of a menu.
Creation[edit]
- createMenuItem() : MenuItem
- Creates an empty region.
Properties[edit]
- DoubleBuffered : boolean
- Graphical updates will go to a off screen bitmap which will then be shown on the screen instead of directly to the screen.
- May reduce flickering.
- ControlCount : integer
- The number of child controls of this WinControl.
- Control[index] : Control
- Array to access a child Control.
- OnEnter : function
- Function to be called when the WinControl gains focus.
- OnExit : function
- Function to be called when the WinControl loses focus.
Methods[edit]
- getControlCount() : integer
- Returns the number of Controls attached to this class.
- getControl(index) : WinControl
- Returns a WinControl class object.
- getControlAtPos(x, y) : Control
- Gets the Control at the given x,y position relative to the WinControl's position.
- canFocus() : boolean
- returns true if the object can be focused.
- focused() : boolean
- returns boolean true when focused.
- setFocus()
- tries to set keyboard focus the object.
- setShape(region)
- Sets the region object as the new shape for this WinControl.
- setShape(bitmap)
- Sets the Bitmap object as the new shape for this WinControl.
- setOnEnter(function)
- Sets an onEnter event. (Triggered on focus enter)
- getOnEnter() : function
- Returns the onEnter event. (Triggered on focus enter)
- setOnExit(function)
- Sets an onExit event. (Triggered on lost focus)
- getOnExit() : function
- Returns the onExit event. (Triggered on lost focus)