Difference between revisions of "Lua:Class:WinControl"
Jump to navigation
Jump to search
m (moved WinControl to Lua:Class:WinControl) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Lua]] | ||
Control '''class''': ('''Inheritance''': ''[[Control]]''->''[[Component]]''->''[[Object]]'') | Control '''class''': ('''Inheritance''': ''[[Control]]''->''[[Component]]''->''[[Object]]'') | ||
Line 13: | Line 14: | ||
; Control[''index''] : Control | ; Control[''index''] : Control | ||
− | : Array to access a child | + | : Array to access a child [[Control]]. |
; OnEnter : function | ; OnEnter : function | ||
Line 30: | Line 31: | ||
; getControlAtPos(''x'', ''y'') : (integer, integer) | ; getControlAtPos(''x'', ''y'') : (integer, integer) | ||
− | : Gets the | + | : Gets the [[Control]] at the given x,y position relative to the WinControl's position |
; canFocus() : boolean | ; canFocus() : boolean | ||
Line 42: | Line 43: | ||
; 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 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 WinControl. |
; setOnEnter(''function'') | ; setOnEnter(''function'') | ||
− | : Sets an onEnter event. (Triggered on focus enter) | + | : Sets an 'onEnter' event. (Triggered on focus enter) |
; getOnEnter() : function | ; getOnEnter() : function | ||
− | : Returns the 'onEnter' | + | : Returns the 'onEnter' event. |
; setOnExit(''function'') | ; setOnExit(''function'') | ||
− | : Sets an onExit event. (Triggered on lost focus) | + | : Sets an 'onExit' event. (Triggered on lost focus) |
; getOnExit() : function | ; getOnExit() : function | ||
− | : Returns the 'onExit' | + | : Returns the 'onExit' event. |
== See also == | == See also == |
Latest revision as of 01:15, 25 January 2018
Control class: (Inheritance: Control->Component->Object)
Base class for windows aware controls.
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) : control
- Returns a WinControl class object
- getControlAtPos(x, y) : (integer, integer)
- 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 to 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.
- setOnExit(function)
- Sets an 'onExit' event. (Triggered on lost focus)
- getOnExit() : function
- Returns the 'onExit' event.