FormEditor

The purpose of the component is to generate a collection of the forms to a databases and secondly an user's interface for the adaptation of these forms. The product of the form-editor is a description of the forms as a XML-document. Associations (Relationship) and other abstractions are supported in the forms directly. The user of the form-editor (application-developer) must not know the schema of the data. His task is only to adapt the automatically produced forms under the formative face point or to specify the input fields of the form.

A form becomes as a collection of different input fields, their placement, and their correspondence to objects in the databases (rows in a table). The following types of the input fields were realized:

Frames. Frames for the placement of the elements
Simple text fields (one-line)
Input fields for whole numbers with control arrows
Listsbox
Radiobuttons
Checkbox fields (Yes / No switches)
Text fields consisting of several lines
Multicolumn Listboxes for the representation of the foreign key (references)
FormLinks
Object for the nesting forms

The embedded forms and the formlinks belong to special elements of the forms. Both are a different visualization of the relationship. The FormLinks appearing along corresponding paths (association or also Aggregation). Besides, one can reach from a form a form of the object which has a foreign key on the first form. Besides, the foreign key is faded out with the tied up form (the value is determined by the first form) and the files are filtered after the foreign key. It are shown by the filtering only the objects which are in touch with the shown object in the first form. With embedded forms the tied up form is a part of the parent's form. With form-links a command button is inserted, only to open of the tied up form serves. The foreign keys are not treated as normal attributes but are represented as special diagrammatic elements. First the domain of the foreign key is limited by integrity conditions on the amount of primary key values in the corresponding table. This can be represented by a list-box. Then the user knows that he has only a certain number of possibilities at which he can look and select. Secondly the values of the key are often statement-empty for the user or unsuitably for the identification of the object. For it the user expects other attributes (e.g. name and first name besides of the PersonalIDs). The Aggregation can be realized as the embedded forms. The association is realized as form-links. The specialization can also be realized as a linkage by forms. Besides, a form is applied for a parent's object (high type) and one form for the children's object (under type).

GUI-Editor for forms

An GUI-Editor is opened by the double click on a form in main window. With it the appearance of the form and the linkages to table-columns in the database can be specified.

Figure 2. GUI Editor

The Properties of the elements are slitted to three types

Widget

The Properties, which belong to GUI-object such length, width (visual appearance).

Data

Linkage with tables-column. Default value and not-null

Packer

Information to placement of the element

The placement of the elements is not indicated definitely (with coordinates), however, under use by Geometry-manager. Most standards-Widget are displayed like they are (WYSIWYG). The other special Widget like (Nested Form, form link, SQLReference) are indicated with editor GUI by the representatives. Their size does not correspond to the reality (caution with the NestedForm). If one wants to see the real appearance of the forms, one must use FormServer, the DB-connection is not necessary for such purposes.

Drag and Drop in FormEditor

The GUI-Editor is slitted in 3 area.

Widget set
Workbench with your edited form
scratch depository

The 3 drag & drop operations are shown in Figure 3 . The Drag & Drop is signalized by special mouse-pointer-icon. The object will be not really moved. All catted objects are moved to depository. The depository can contain many objects

Tip

By inserting new widget, choose one widget in widget-set (the background is displayed colored) window and drop it on workbench.

Figure 3. Drag and Drop operations

work with Pack-Frame

The elements are places in Frames (also nested). The order of the elements in a frame is crucial. The pack-geometry-manager takes one after another the elements and places them(her) in the frame the remaining place it is applied for the next elements. The following qualities specify the placement:

Side - in which page(side) of the frames the object should be added
Anchor - anchor to which page side
Fill
Expand - the object should be adapted by change of the window size

Tip

One can see the current pack options in the status bar, after pointing the Widgets with mouse's pointer.

The position of new drooped object is computed related to the object you have target. When no object are targeted, the widget will be added at last pack position with standard option (-side top -anchor center -fill none -expand 0). The exact position can be specify by target the object, which is already in the frame.

Figure 4. Positioning in Pack-Frame (schematic)

Figure 4 show an example of Pack-Geometry-Manager composition. The are a part of Tk pack manual.

For each master the packer maintains an ordered list of slaves called the packing list. The -in, -after, and -before configuration options are used to specify the master for each slave and the slave's position in the packing list. If none of these options is given for a slave then the slave is added to the end of the packing list for its parent. The packer arranges the slaves for a master by scanning the packing list in order. At the time it processes each slave, a rectangular area within the master is still unallocated. This area is called the cavity; for the first slave it is the entire area of the master. For each slave the packer carries out the following steps:

  1. The packer allocates a rectangular parcel for the slave along the side of the cavity given by the slave's -side option. If the side is top or bottom then the width of the parcel is the width of the cavity and its height is the requested height of the slave plus the -ipady and -pady options. For the left or right side the height of the parcel is the height of the cavity and the width is the requested width of the slave plus the -ipadx and -padx options. The parcel may be enlarged further because of the -expand option (see ``EXPANSION'' below)

  2. The packer chooses the dimensions of the slave. The width will normally be the slave's requested width plus twice its -ipadx option and the height will normally be the slave's requested height plus twice its -ipady option. However, if the -fill option is x or both then the width of the slave is expanded to fill the width of the parcel, minus twice the -padx option. If the -fill option is y or both then the height of the slave is expanded to fill the width of the parcel, minus twice the -pady option.

  3. The packer positions the slave over its parcel. If the slave is smaller than the parcel then the -anchor option determines where in the parcel the slave will be placed. If -padx or -pady is non-zero, then the given amount of external padding will always be left between the slave and the edges of the parcel.

Once a given slave has been packed, the area of its parcel is subtracted from the cavity, leaving a smaller rectangular cavity for the next slave. If a slave doesn't use all of its parcel, the unused space in the parcel will not be used by subsequent slaves. If the cavity should become too small to meet the needs of a slave then the slave will be given whatever space is left in the cavity. If the cavity shrinks to zero size, then all remaining slaves on the packing list will be unmapped from the screen until the master window becomes large enough to hold them again.

working with Grid-Frame

The row and column are computed dynamic.

Figure 5. Grid-Frame

Figure 5 show one Grid-Frame. The cells A2,B2,B3,C1,C3 are occupied. By dropping in the free cell this cell will be used for placement. If you target one occupied cell one row or column will be added. See Example. If you target on cell B2, area d one row above the cell will be added.

The another grid option as sticky or rowspan can be edited by widget-propries dialog.