Programming Tools:prgtools

Working with the FormDesigner Foundation

Working with the FormDesigner always involves following distinct steps: selection of controls or database fields, arrangement in the form, saving the form, and creation of program code. Each of these steps in the design process are outlined in the following sections.

Designing your form

The easiest way for selection of controls or Xbase Parts, respectively, is clicking a corresponding icon in the tool palette of the FormDesigner. Then an insertion frame is displayed in the form which is to be positioned with the mouse. A left click marks the insert position and creates an Xbase Part in the form at this point. If database fields are to be inserted, the field selection window must be opened via the menu items "Assistants->Fields". Multiple field names can be selected in this window. Depending on the data type of a field, different Xbase Parts accessing a database field are created in the form. They must be positioned with the insertion frame.

The FormDesigner has two modes to position the insertion frame: pixel-oriented and grid-oriented. The positioning mode is selected in the settings dialog ("Use grid") which is opened via the menu items "Options->Settings". This dialog defines settings to configure the FormDesigner. One setting, for instance, is the grid size used for positioning. If the grid is activated, Xbase Parts can be moved in the form only in steps defined by the grid. To position an Xbase Part exactly at the mouse pointer tip, the grid must be deactivated.

While a form is designed, it is normally necessary to reposition inserted Xbase Parts, to group them using static elements such as lines or frames, or to make other changes. The form can be modified comfortably by means of a marking frame that allows the entire appearance of a form to be changed with just a few mouse clicks. The marking frame selects one or more Xbase Parts for modification. Position and size of the marking frame define position and size of the marked elements. If the frame is resized, different options are available to define how the marked Xbase Parts are to be scaled. These options are selected in the "Options->Settings" dialog. For instance, the spacing between Xbase Parts can be scaled, or their size, or both. Whether or not controls embedded in Xbase Parts (children) should be scaled as well, is also configurable. A variety of standardized alignment options can be selected in the "Alignment" window. All marked Xbase Parts can be centered in the marking frame or given the same width by just clicking the corresponding icon.

Parent-child relationships between Xbase Parts can be defined or modified easily. Various options exist for this purpose in the context menu of the form which is opened by a right mouse click.

Options in the context menu
Option Description
Group XBPs Creates a Group box as the parent for all marked Xbase Parts
Ungroup XBPs Removes the Group box and defines the form as the parent for Xbase Parts contained in the Group box
Assign parent Defines an Xbase Parts as the parent for all marked elements
Release parent Releases a parent-child relationship without deleting the parent
To back Moves all marked Xbase Parts to the background
To front Moves all marked Xbase Parts to the foreground
Repaint all Redraws the entire form

Xbase Parts are grouped using a Group box by default (an XbpStatic element of the type XBPSTATIC_TYPE_GROUPBOX). It is used as parent for marked Xbase Parts. After a group is defined in this way only the parent can be marked, not the embedded Xbase Parts. To select or modify children of an Xbase Part, it is necessary to release the parent-child relationship.

Clicking the menu items "Options->Property monitor" opens a window which is used to change proprties of Xbase Parts contained in the form. It uses a tree view for visualization of the parent-child hierarchy and is equipped with a browser which displays the properties of the current Xbase Part. If properties are changed in the browser the corresponding Xbase Part is updated with new data.

Saving your work

When a form is completely designed, it can be saved or code can be generated in both functional or object-oriented style. In general, it is recommended to save a form in case it needs to be modified later on, or to serve as template for other forms. The FormDesigner stores a form in binary files which can be loaded at a later point in time.

Having the FormDesigner generate code for your form allows to recreate the same form at runtime in your applications. The generated code can be included in your projects, and it can be modified further using a standard text editor. More details about generating code with the FormDesigner are given in the section Generating code .

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.