A form file is a file used for input and interaction with a 4GL program.
.fm2 is a modern and advanced form file format that extends the opportunities of legacy .per form and modernizes its look. Also, .fm2 format is easy to operate with, as it basically contains an XML code.
Using Lycia VS Code Extension, you can start your work with .per or .4fm form files, as we have tools to convert them into .fm2 format. Read more about form conversion here: Converting Form Files.
The Form Object is the abstract container where all the contents of the form are stored:
It has its own properties, which you can see in the Properties view after you click the Form Object:
The Form Object’s XML code:
<form xmlns="http://namespaces.querix.com/2015/fglForms">
...
</form>
A new form is created without any container inside:
When you drag-and-drop the first container from the Palette to the Design Area and place it within the Form Object, the Form Object’s window, displayed in the Design Area, expands:
That first container will become a Root Container - the seat for all other containers and widgets of the form.
The XML code of a GridPanel as a Root Container will be the following:
<form.rootContainer>
<GridPanel visible="true" preferredSize="," identifier="gp1">
</GridPanel>
</form.rootContainer>
A container is a form element, within which you can place other elements (containers and widgets).
A widget is a form element to serve as a field for the display and input of data.
To learn what containers and widgets to pick for specific tasks, proceed to the following chapters:
There are certain rules of size and alignment of form properties. Follow them to ensure the form will look exactly as you need it to:
Exceptions:
The Form Builder is a tool for modifying the form’s layout. You can add more details to your form’s look with themes, CSS styles, images, scripts, etc. For more detail, refer to the following pages:
To get the form displayed at runtime, use the OPEN WINDOW ... WITH FORM statement. See the code example below:
OPEN WINDOW my_form AT 1,1 WITH FORM "form_file"
ATTRIBUTE (BORDER)
Here,
my_form stands for the variable of the WINDOW data type, defined in the MAIN block;
form_file is the name of the form file to be displayed in a newly opened window.