Page 341
A final object that Forms creates is a Relations. This object has a set of properties and contains the settings for the join conditions. It is possible to change the join conditions by modifying these properties.
NOTE |
I have listed the triggers and relations created for information purposes. These items are seldom if ever modified. Forms does an excellent job of developing the objects to keep blocks in sync. This is one of the truly nice things about Forms. The developer does not have to worry about developing the synchronization programming. |
Formatting block TWO is easier than block ONE because it was created in tabular style. Tabular blocks are usually aligned on the top and stacked horizontally. Forms creates the initial block in this manner. The one problem may be that the items may not be placed in the correct order. This will require the developer to select and drag the items to the proper row location.
Figure 14.5 shows selecting and dragging an item. When the block displays multiple records, each item will consist of a set of item records. Selecting the item will cause the entire set of item records to be selected. Figure 14.5 shows the selected tool_name item being dragged to a new location.
FIG. 14.5
Dragging a multiple
record item.
It is more common to reformat boilerplate text on tabular blocks because the text appears above the text item rather than to the left when using the form block style. There is generally not enough room available for the text. In tabular style blocks, the available space is usually equal to the length of the field. This lack of space requires the developer to change the text font size, wrap the text, abbreviate words, or perform a combination of each of the above. Figure 14.6 shows the form after the boilerplate text is reformatted. Try formatting block TWO that was created on form EMPCH14.FMB. Make it similar to Figure 14.6. The Employee Update form after the second block was added and reformatted.
Page 342
FIG. 14.6
The Employee Update
form after the second
block was added and
reformatted.
You create the Glasses block by filling out each of the four tab sheets in the New Block Options dialog box. Use the steps outlined in the "Creating the Tools Block" section and the following setting and instructions to create the block. This block will be the last one added to the form. You can now enter a button palette to the form. While populating the Layout tab, be sure to check the Button Palette check box. Fill out the General, Items, and Layout tab sheets with the settings in Table 14.1. The next section will discuss auto-generating the join condition for the Join Condition tab.
Table 14.1 Glasses Block Settings
Setting | Value |
Base Table | Glasses |
Block Name | THREE |
Style | Tabular |
Records | 4 |
Button Palette | Checked |
Scroll bar | Checked |
Generating the Block Join ConditionsInstead of entering the join condition, let Forms create the join expression. Forms has the capability to create the join condition between the Glasses block and the Employee block. After a block has been used once as a master block, and the form saved and generated, the block is accessible as a master block by using the Select button on the Master/Detail tab sheet. Clicking this button will activate the Blocks dialog box displayed in Figure 14.7.
Page 343
FIG. 14.7
The Blocks dialog box
displaying master form
blocks.
This dialog box will display any master blocks generated by the form. Select the appropriate master block and click the OK button. Forms will fill in the boxes on the Master/Detail tab sheet. Figure 14.8 displays the Master/Detail tab sheet for the Glasses block after selecting block "ONE" as the master block.
FIG. 14.8
The Master/Detail tab
sheet after Forms fills
in the settings.
Creating the Glasses (THREE) BlockClicking the OK button will create detail block THREE, which will contain the records from the Glasses table. Block THREE and the button palette need to be reformatted by using the techniques described earlier. Figure 14.9 shows the completed form, which is now a fully functional application that displays the records from three tables. It has the programming to keep the block records in sync. The user can query, add, update, or delete records from any of the tables. The fields are formatted in a pleasing manner. What is really neat is that this powerful application has been developed thus far without the developer writing a single line of code. There are still some minor modifications that need to be made to the form, which will be discussed in later chapters.
The form has properties that can be modified. The properties are used to change the way the form operates and looks. The next several sections discuss form, block, and item properties.
Double-clicking the form button, the first object located on the Object Navigator, activates the form property sheet as shown in Figure 14.10. The various Form properties are described in Table 14.2.
Page 344
FIG. 14.9
The Employee Update
Form after final
formatting.
FIG. 14.10
The Employee Update
form property sheet.
Table 14.2 Form Properties
Property Name | Description |
Class | The name of the property class that supplies the values to the various form properties. Comment Miscellaneous text the developer recorded about the form. |
Console Window | Determines the console window that will display the status line and message line. It will be displayed at the bottom of the screen. If you do not want a console window, set the property to null. |
Page 345
Property Name | Description |
Coordinate Information | This property consists of a set of values that control the coordinates used in the form. |
Current Record Attribute | This property contains the name of a visual attribute.The normal record attributes will be superseded by the attributes supplied by the visual attribute when a record is the current block record. |
Cursor Mode | Determines whether database cursors will remain open across applications. The default is open. The cursor will remain open. The close setting will close cursors when a commit is issued. |
Direction | Determines the layout direction of bidirectional objects. |
First Navigation Block | Determines the initial active block when the form is launched. |
Horiz.MDI Toolbar | The name of a horizontal toolbar displayed with the form. |
Menu Module | Contains the name of the compiled menu file to be used with the form. When the property is null, Forms will run the form without a menu. |
Menu Role | Determines the security role Forms uses to run the menu. This property is included for backward version compatibility. It is not recommended for current applications. |
Menu Style | Determines the type of menu to be used with the form. Options are pull-down, bar, and full-screen. The default is pull-down. |
Mouse Navigation Limit | Determines where the mouse can navigate.Form is the default. It allows the operator to navigate anywhere on the form with the mouse. The Block setting allows navigation only within the current block. The Record setting allows navigation within the current record. The Item setting prevents all mouse navigation. |
Name | The name of the form. |
Savepoint Mode | Determines whether savepoints are issued during a session. The default value is true, meaning Forms should issue a savepoint at startup or at the start of each Post and Commit process. The false setting will cause Forms to issue no savepoints, and that no rollbacks to savepoints are to be performed. |
Starting Menu | Determines the individual menu in a menu module that should be used as the main menu. |
Title | Contains the form title. |
continues