Form

From Lianjapedia
Jump to: navigation, search

Note: property, method and event names should be referred to in lowercase in case-sensitive scripting languages.

Description

Form

Forms are standalone containers used to contain other containers and controls.

Properties

This class supports the Common Properties plus the following:

Property Access (R/RW) Value Description
Accepted RW Boolean When a form is being closed the beforeclose() event is dispatched to the object (any supported scripting language). You can validate the data in the form and reject the "close" operation by setting accepted to false, default is true. (From v4.1).
Actionbar RW Boolean Whether form has an actionbar
AlwaysOnBottom RW Boolean Whether form should always be on the bottom
AlwaysOnTop RW Boolean Whether form should always be on top
AutoCenter RW Boolean Whether form is autocentered
BufferMode RW Numeric Buffer mode
Caption RW Character Text displayed in caption
Closable RW Boolean Whether form is closable
ControlCount R Numeric Number of controls in form
CurrentX RW Numeric Current x coordinate for the next drawing method
CurrentY RW Numeric Current y coordinate for the next drawing method
DrawWidth RW Numeric Line width in pixels for draw operations
ExitOnClose RW Boolean Whether to exit session on closing form
FillColor RW Numeric or Character Fill color
FillStyle RW Numeric Fill style setting
KeyPreview RW Boolean Whether keypreview is enabled
MaxButton RW Boolean Whether form has a maximize button
Message RW Character Text displayed in statusbar
MinButton RW Boolean Whether form has a minimize button
MobileFullScreen RW Boolean Whether when the form is running on a phone, it is maximized into the phone viewport with its border removed. (From v4.1).
MousePointer RW Numeric Mouse pointer: 0 = arrow, 1 = arrow, 2 = cross, 3 = I-beam, 5 = size, 6 = NE/SW, 7 = size N/S, 8 = size NW/SE, 9 = size W/E, 10 = up arrow, 12 = no drop, 15 = pointing hand
Picture RW Character Filename of background image
Scrollbars RW Numeric Scrollbars: 0 = none, 1 = horizontal, 2 = vertical, 3 = both
ShowTips RW Boolean Whether tooltips are shown for controls in the form
Statusbar RW Boolean Whether form has a statusbar
Titlebar RW Boolean Whether form has a titlebar
WindowState RW Numeric Window state: 0 = normal, 1 = minimized, 2 = maximized, 3 = fullscreen/kiosk
WindowType RW Numeric Window type: 0 = modeless, 1 = modal

Methods

This class supports the Common Methods plus the following:

Method Args Description
AddObject existing as Object | newobject as Character, class as Character Add an existing object or a new object, in which case the object's class must also be specified
Box x as Numeric, y as Numeric[, x2 as Numeric, y2 as Numeric] Draw a box from currentx, currenty to x, y. If x2 and y2 are specified, draw a box from x, y to x2, y2
Circle radius as Numeric[, x as Numeric, y as Numeric] Draw a circle with the specified radius at currentx, currenty. If x and y are specified, draw the circle at x, y
Clear None Clear the form
Controls control as Numeric Return an object reference to the specified control within the form
Draw None Repaint form
Line x as Numeric, y as Numeric[, x2 as Numeric, y2 as Numeric] Draw a line from currentx, currenty to x, y. If x2 and y2 are specified, draw a line from x, y to x2, y2
Print text as Character Print the specified text in the form
Release None Release form
RemoveObject existing as Object Remove the specified object
ShowDropDown controlID as Character[, width as Numeric[, height as Numeric]] Show the Form as a drop down from the specified controlID UI control. Optionally specify the width and height of the drop down. If these are not specified, the width will adjust to width of the controlID UI control and the height defaults to 250 pixels. The drop down can be closed by pressing the Esc key or issuing a form.close(). (From Lianja v3.3).
TextHeight None Return current text height setting in pixels
TextWidth text as Character Return pixels required to display specified text

Events

This class supports the Common Events plus the following:

Event Args Description
afterclose None Occurs after form is closed. (From v4.1).
beforeclose None Occurs when form is being closed. (From v4.1).
load None Occurs before form is activated