Difference between revisions of "Lua:Class:MenuItem"
Jump to navigation
Jump to search
(Created page with ''''MenuItem Class''': (Inheritance: Component->Object) A clickable part of a menu createMenuItem(ownermenu) : Creates a menu item that gets added to the owner menu …') |
|||
Line 1: | Line 1: | ||
− | ''' | + | MenuItem '''class''': ('''Inheritance''': ''[[Component]]''->''[[Object]]'') |
− | A clickable part of a menu | + | A clickable part of a menu. |
− | + | == Creation == | |
+ | :; [[createMenuItem]]() : MenuItem | ||
+ | :: Creates an empty region. | ||
+ | == Properties == | ||
+ | ; 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 == | |
− | + | ; getControlCount() : integer | |
− | + | : Returns the number of [[Control]]s 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) | ||
+ | |||
+ | == See also == | ||
+ | * [[Lua]] | ||
+ | * [[Help_File:Script engine|Script engine]] | ||
+ | |||
+ | === Related Functions === | ||
+ | * [[createMenuItem]] | ||
+ | |||
+ | === Related Classes === | ||
+ | * [[Menu]] | ||
+ | * [[MainMenu]] | ||
+ | * [[PopupMenu]] | ||
+ | * [[Form]] | ||
+ | * [[Control]] | ||
+ | * [[Component]] | ||
+ | * [[WinControl]] |
Revision as of 03:22, 11 March 2017
MenuItem class: (Inheritance: Component->Object)
A clickable part of a menu.
Creation
- createMenuItem() : MenuItem
- Creates an empty region.
Properties
- 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
- 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)