Form

Note

Form is derived from Window class.

A form is a window or screen that contains numerous controls, or fields to enter data.


Constructor

Form class has a complex constructor:

Form:new {
   string Name, string Title,

   number PosX  , number PosY,
   number Width , number Height,
}

Arguments

These arguments are received by class constructor.

Argument Description
Name The form’s name
PosX Position related to X on Screen or Parent object
PosY Position related to X on Screen or Parent object
Width Width of the form
Height Height of the form

Events

The following events are emitted by this class:

Event name Description
Form.onShow When the form is shown.
Form.onClose When the form is closed.

Class Methods

These methods are defined by this class.


Form:getFocusedObject

Returns focused object.
object Form:getFocusedObject()

Form:setFocusedObject

Sets the focused object.
nil Form:setFocusedObject( Widget oDefault )

Example

In this example we create a new Form …

1
2
3
4
5
6
7
8
 myWnd = Form:new { Name = "MyForm",

     -- PosX = 30, PosY = 70, Width , Height, >> Here we don't send the size, for using default sizes

     Title  = "YOUR NEW Form",
 }

 myWnd:show();