Widget

Widget is derived from Object_ class

[lide.widgets] ^1.1 lide.classes.widget 1.1

Widget is the base class for all windows and represents any visible object on screen. All controls, top level windows and so on are widgets.

Widget can be used for construct your own classes derived from it. For example a new kind of Window or Dialog. Otherwise you are not exploit all the pottential of lide classes.


Constructor

Widget class has a single constructor:

object Widget:new ( string sWidgetName, string sWidgetType, number nPosX, number nPosY, number nWidth, number nHeight )

Arguments

These arguments are received by class constructor.

Argument Type Description
sWidgetName string The widget name
sWidgetType string The widget type identificator
nPosX number Position related to X
nPosY number Position related to Y
nWidth number Width of the widget
nHeight number Height of the widget

Events

The following events are emitted by this class:

Event name Description
Widget.onEnter When the mouse moves onto this widget.
Widget.onLeave When the mouse moves out to this widget.
Widget.onMotion_ When the mouse moves over this widget.

Inherited Methods

These methods are inherited from its super classes:

Class Method Description
Object:getID Returns widget’s identifier.
Object:setID Sets the widget identifier.
Object:getName Returns widget’s name.
Object:setName Sets the widget name.

Class Methods

These methods are defined by this class.


Widget:getBind

Gets the wxWidgets object.

Returns an userdata value
userdata Widget:getBind()

Widget:getParent

Returns the parent.
object_ Widget:getParent( )

Widget:getWidgetType

Returns the widget type identificator.
number Widget:getWidgetType()

Widget:setWidgetType

Sets the widget type identificator.
bool Widget:setWidgetType( string sWidgetName )

Widget:getPosX

Returns the position related to X.
number Widget:getPosX()

Widget:setPosX

Sets the position related to X.
bool Widget:setPosX( number nPosX )

Widget:getPosY

Returns the position related to Y.
number Widget:getPosY()

Widget:setPosY

Sets the position related to Y.
bool Widget:setPosY( number nPosY )

Widget:getWidth

Returns the width of the widget.
number Widget:getWidth()

Widget:setWidth

Sets the width of the widget.
bool Widget:setWidth( number nWidth )

Widget:getHeight

Returns the height of the widget.
number Widget:getHeight()

Widget:setHeight

Sets the height of the widget.
bool Widget:setHeight( number nHeight )

Widget:getVisible

Returns true if the widget is visible.
bool Widget:getVisible( )

Widget:setVisible

Sets the visibility of the widget.
nil Widget:setVisible( bool bVisible )

Widget:getEnabled

Returns true if the widget is enabled.
bool Widget:getEnabled( )

Widget:setEnabled

Set if enabled or disabled.
nil Widget:setEnabled( bool bEnable )

Widget:setFocus

Sets the focused object.
nil Widget:setFocus( object_ oDefault )

Widget:initializeEvents

Initialize events especified on list.
nil Widget:initializeEvents( table tList )