0849-0853

Previous Table of Contents Next

Page 849

Figure 35.5.
Warehouse Mainte-
nance form.


Figure 35.6.
Block-definition dialog.


Once this box is complete, click the Items tab to present the Item-definition dialog shown in Figure 35.7. To obtain the columns in this table, click the Select Columns button and all columns in the table are listed. A plus sign preceding a column indicates that the column is used in the form. To exclude a column, double-click the column name in the listbox. For each column listed, modify the column label and width as indicated in Table 35.2.

Table 35.2. Warehouse Maintenance form column definitions.

DB Column
Label
Width
WH_CODE Code 35
WH_NAME Warehouse 150
WH_OPEN_DATE Opened 60
WH_CLOSE_DATE Closed 60

Page 850

Figure 35.7.
Item-definition dialog.


After the column definition is complete, you should define the form layout using the Layout tab as shown in Figure 35.8. This form presents multiple rows in a tabular arrangement with the individual rows arranged vertically. The Records field representing the maximum number of records displayed should be 8, and there should be 0 spacing between the records. You use other options to determine whether integrity constraints should be enforced for the form and if a button palette is needed for the table. (The button palette creates a default set of iconic buttons that can be used for table maintenance.) The last checkbox includes a scrollbar in the form that you can use to navigate through the block if you cannot display all the records at one time.

Figure 35.8.
Defining form style and
layout.


After this dialog box is complete, click OK to finish constructing the form. To test the form, run it by clicking the Run icon or choose Run in the File menu. (Note that this chapter assumes that the designer options Save Before Generate and Generate Before Run are selected. Otherwise, you must do these steps manually prior to running the form.) The form appears, as shown previously in Figure 35.5, with all the data boxes empty. To list the existing data, select Query Execute. You can enter data into the fields and then save it using Action Save. You choose Action Exit to close the form.

Using Boilerplate Text and Graphics to Enhance Forms Applications

The previous example does not provide the three-dimensional look and feel that is common in most Windows software. Using some of Oracle Forms' graphical objects and visual effects, you

Page 851

can transform the previous example into a more aesthetically pleasing application, as shown in Figure 35.9.

Figure 35.9.
Using boilerplate
objects to enhance
applications.


To modify this form, first select the block title in the Layout Editor and remove it using the Delete key. Do the same with the box around the data grid. Now, using the select tool, select all the column headings on the screen. To modify the font, choose Format Font to display the font-selection dialog as shown in Figure 35.10. In this case, choose the Arial font, Bold Italic style, and size 9. (A sample of the selected font is shown within the dialog.) Click OK to change the fonts.

Figure 35.10.
Font-selection dialog.


Page 852

Now, position the column headings at the center above the columns using the Align Objects tool. To do this, click the column heading text for the Warehouse Code, and then while holding the Shift key, click the code field. Using Arrange Align Objects, choose the alignment options as shown in Figure 35.11. Repeat for all four columns.

Figure 35.11.
Align Objects dialog.


Select the Rectangle tool, and draw a rectangle, as shown in Figure 35.9, so that it borders both sides and the bottom of the data grid. (Use the sizing anchors to resize and position the rectangle if necessary.) To create the three-dimensional effect, select Format Bevel and select the lowered effect to create the appearance of a lowered block on the screen. You can adjust the depth using Format Line. Create another smaller rectangle overlapping the previous rectangle for the screen label. Using the Text tool, create the screen label (WAREHOUSES) using an appropriate font. Using the mouse, arrange the objects to appear on the screen as shown in the example.

NOTE
Sometimes the intelligent defaulting feature of Oracle Forms causes objects to appear differently from what you want, especially regarding the fill and border-line visual attributes for the object. You can correct these attributes using the attribute palette buttons below the current visual-attribute display in the Layout Editor. Also, the Arrange menu provides options to move objects in front of or behind other objects.

Page 853

Customizing Forms with Properties

As previously mentioned, you can use Oracle Forms' intelligent defaulting capabilities to create useful applications. In many cases, however, it is necessary to define specific characteristics for application objects. You can do this by modifying the properties of the form objects using the object property sheets.

To examine properties, again load the form from the previous section. Each object in the form (including the form itself) has an associated context-sensitive property sheet. The properties for the objects are organized in logical groups based on usage. To change a property, select the object in the Object Navigator. If the property sheet is visible in the split window arrangement, the property sheet automatically displays for the object. If the property sheet is not visible, double-click the icon at the left of the object name in the Object Navigator to view the property sheet. Usually, only some of the properties are visible in the window and a scrollbar is available to view the other properties. To modify a property, click the property in the property sheet. The value of the property is copied to the top line of the property sheet window. Edit this line and press Enter to modify the property.

The first custom modifications you make affect the overall application appearance. Select the property sheet for the form window. Change the Window Title to "Warehouse Maintenance Form," and then change the window width to 382 and the height to 200. To prevent a user from using the Windows function to resize the window frame or to minimize the form, update the Fixed Size property to TRUE and the Iconifiable property to FALSE for the form window. Additionally, repeat the sizing properties for the WH_CANVAS canvas.

Now, select the WH_CODE item and change the Update Allowed property to FALSE. This change protects the primary key for the warehouses table from being changed. Finally, select the WH_OPEN_DATE and WH_CLOSE_DATE fields together. Notice that the common property sheet shows that multiple objects are selected and that in cases where the properties are different, a set of asterisks is shown. In this case, modify the Format Mask property to be MM/DD/YY. As a final step, change the font and sizing for all the fields in the warehouse record by selecting all of them and displaying the common property sheet. Modify the height to equal 14 and change the font name to Arial with a size of 8 points and a weight of bold.

Upon completion of these changes, save and run the new form. The result should look like the form shown in Figure 35.12. Compare this form with the form created in the previous section to see how the property changes affected the resulting form module.

Previous Table of Contents Next


Oracle Unleashed
Oracle Development Unleashed (3rd Edition)
ISBN: 0672315750
EAN: 2147483647
Year: 1997
Pages: 391

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net