FORM

 

FORM data type serves as an analogue for a static form identifier and makes the DISPLAY FORM statement more dynamic. It is a special Querix 4GL data type created to make forms the dynamic objects which can be manipulated, it belongs to the Object data types. Like any other variables is can be declared with different scope of reference, which gives a form more flexibility. FORM variables may be passed to and from functions.

 

A variable of the FORM data type can serve as a dynamic form identifier. It cannot be assigned values directly using the LET statement. Assigning values with the help of the LET statement or in any other way may cause unexpected behaviour. Variables of this data type could be used with the special methods developed for them, which are called in the same way as a function.

 

The methods used with these variables allow the programmer to open, display, close a form as well as get its parameters:

 

loadActionDefaults()

loads the actions settings from a toolbar specified in the form file

loadToolbar()

loads a toolbar

loadTopMenu()

loads a top menu

setDefaultInitializer()

specifies a default initialization function that will be used to process globally all the forms opened by a program

setElementImage()

specifies the image for a form element

setElementText()

changes the text for a form element

setFieldHidden()

allows hiding form fields

setFieldStyle()

allows modifying display style of a static form widget by applying a class name to it

open()

opens a form from a form file

display()

displays a previously opened form with the specified display attributes

close()

closes a form opened with a open() method and frees the resources allocated to it

getHeight()

retrieves the height of the form in rows

getWidth()

retrieves the width of the form in columns

setVerticalAlignment()

specifies how an element is aligned relative to vertical borders of the parent container or cell

getVerticalAlignment()

retrieves the alignment of the specified element

ensureElementVisible()

ensures visibility of  the specified form element

ensureFieldVisible()

ensures visibility of  the specified form field

 

They resemble traditional 4GL functions, but are actually methods which are used together with a FORM variable and must be separated form it by a full stop. Here is the syntax:

 

variable.Method()

 

In this case the name of the variable is at the same time the name of the form. Forms can still be opened closed and displayed using the statements and static form identifiers as well as using the built-in functions.