The Form Layout

Example

var btnLogin = new TButton("Login");
var layForm = new TFormLayout();
var txtPassword = new TTextBox();
var txtUserName = new TTextBox();
var wndFormSample = createWindow('Form Layout Sample');

layForm.add(new TText('Username:'), txtUserName);
layForm.add(new TText('Password:'), txtPassword);

wndFormSample.add(layForm);
wndFormSample.add(btnLogin);
showModal(wndFormSample);

In this example, we created a simple login form using form layout. Form layout arranges components one to the left and the other to the right by using the add method.
Form layout constructor takes two optional parameters:

var layForm = new TFormLayout(verticalPadding, horizontalPadding);

Form Layout Methods
Method Description
Add Adds UI objects to the layout. Takes two parameters:
add(leftObject, rightObject)
setDirection Sets layout direction left to right (ltr) or right to left (rtl)