Previous | Table of Contents | Next

Page 292

The Button Palette check box places a default button palette at the bottom of the form. The palette contains buttons to navigate up or down, scroll up, scroll down, query a record, and save the changes.

The Scrollbar check box is used to place a scrollbar on the block. It's generally used when the block contains multiple records.

The Master/Detail tab is used to create master-detail blocks, which are two related blocks. It also creates some special triggers that coordinate the two blocks. This tab is discussed in Chapter 14, "Creating and Modifying Master-Detail Forms."

Everything is now filled in and you can create the block. Press the OK button.

The dialog box disappears and the Object Navigator contains some new objects. These objects consist of the block called "One" and the selected items from the Items tab.

Figure 12.32 shows the new objects in the Object Navigator.

FIG. 12.32
The Object Navigator
after the new block
"One" is created.




CAUTION
Each of the four tab sheets on the New Block options dialog box has an OK button. Pressing this button causes the block to be created, even if you've never viewed some of the tab sheets.
When this happens, the block has missing objects such as fields, scrollbar, or button palette. You can add these items but it takes time. It's usually easier to delete the block objects and start over.
Be sure to completely fill in each of the tab sheets before pressing the OK button!
  1. Naming your form

The next step is to name the file. Since this is a new file, it has a default name beginning with "module." You can change the name of the form in the Object Navigator.

Double-click the form name. This highlights the name. Press the Backspace key. This deletes the name. Now type in the new name.

Page 293

Figure 12.33 shows the Object Navigator after this sequence. You can use this procedure to update any object name.

FIG. 12.33
The Object Navigator
after the form name is
highlighted
and changed.

  1. Saving your form
The last step is to save the file. You can do this by pressing the Save button on the tool palette or by selecting the file/save option on the menu bar.
TIP
A number of techniques are useful and time saving when you create a form. You can use the names "one," "two," "three," "four," and "five" for your block names rather than the default names.
There are two reasons for doing this. The first is that the names are short and easy to spell. The block name is often used as a qualifier in PL/SQL scripts in the forms. So this prevents typing errors and having to type lengthy names.
The second reason for using these names is standardization. Generally, there's only one master block on a form. If you always name the master block "one," you always know the name of the master block. You may find this standardization preferable to using table names as block names.
Another technique is to always edit the item labels on the Items tab. It's much easier and quicker to change them in this dialog box rather than after they are created on the Layout Editor. It'll save you time to do the job properly here.
A third technique is to put the button palette on the form when you create the last block. If you create the button palette after the first block, Designer places subsequent blocks beneath the palette.
If you usually place the button palette at the bottom of the screen, you have to move all the items above the palette. It saves formatting time to create the button palette when you create the last block.

Summary

Forms Designer is used to develop the form applications. When Forms is launched, the first screen is the Object Navigator, the main Forms Designer screen. It contains all the objects that can be changed, and offers an easy mechanism to reach all form, menu, and library objects.

Page 294

The Object Navigator has several parts. The top of the screen contains menu options, the left side of the screen contains a tool palette, the bottom of the screen displays messages, and the center of the screen displays the objects.

The objects are arranged in levels. The highest-level objects can be expanded to expose the child objects. The objects can also be collapsed to make the Object Navigator easier to read.

The File menu options offer a variety of options. There are options to open, save, close, and generate the files.

The Edit menu options allow you to cut, copy, paste, clear, and duplicate items.

The Tools menu options are used to display an item's property sheets, Layout Editor, Object Navigator, Menu Editor, PL/SQL Editor, and the Object Navigator. This menu is used to create new blocks and to call a special dialog box that creates select statements.

The Object Navigator menu has options to change the arrangement of the objects in the Object Navigator. It also has options to add and delete objects, as well as to expand and collapse them.

You can create a form by highlighting the forms object in the Object Navigator and clicking the Create icon. Then you add a block to the form. You do this by selecting the blocks object and pressing the Create icon.

A dialog box is displayed with a variety of settings that determine the type of form created. After you mark these settings, Designer creates the form. You can then save and run the form.

From Here...

The next chapter covers the Layout Editor, a screen painter that is used to format a form. The chapter discusses the formatting options available, including arranging and coloring items, adding text, placing images, changing fonts, viewing options, and formatting the form created in this chapter.

Review Exercises

  1. Create a one-block form using the Department table as the base table. The form uses the tabular style, display 12 records, and has a button palette.
  2. Create a one-block form using the Employee table as the base table. The form uses the form style and display 1 record. Do not add a default button palette.

Be sure to save the forms. You'll use them in the exercises for Chapter 13.

Previous | Table of Contents | Next