Previous | Table of Contents | Next

Page 437

have a toolbar. It consists of a set of iconified buttons on a form canvas. Iconified means the button has an image on it.

To create a horizontal toolbar follow these steps:

  1. Open the Object Navigator and create a new canvas-view object.

  2. Open the canvas's property sheet and modify the Canvas-view Type property. The developer has a choice between a vertical or horizontal toolbar.

    Figure 16.34 displays the Canvas-view Type picklist.

  3. Select the Horizontal Toolbar value and set the Height property set to 20.

FIG. 16.34
The Canvas-view
type values picklist.




  1. Open the form's property sheet.

    This property sheet has two properties that pertain to toolbars. They are the Vert. MDI Toolbar and the Horiz. MDI Toolbar property. The properties contain the names of canvases that will be displayed as vertical or horizontal toolbars. Figure 16.35 displays the form property sheet for the Employee Update form (EMPCH16.FMB). The Horiz. MDI Toolbar is selected and the picklist displays the canvas toolbars available. Canvas2 is selected.

  2. Select the Horiz. MDI Toolbar and the canvas created in Step 1.

    Figure 16.36 contains the executed form that includes an unpopulated toolbar. The toolbar is located between the menu and the application. It has a height of 20 pixels and stretches across the screen.

The next step is to create the iconified buttons that will appear on the toolbar. This can be done on the Object Navigator. Add the buttons to the Button Palette Block or create a new nonbase table block. In the case of the Employee Update form, a new block called "Tools" is created.

  1. Open the Object Navigator.

  2. Select the Blocks object. Click the create button. This will open the New Block dialog.

Page 438

FIG. 16.35
The form property sheet
and the Horiz. MDI
Toolbar and Vert.
MDI Toolbar
properties.




FIG. 16.36
The Employee Update
form with a blank
horizontal tool bar.




  1. Change the name of the block to "Tools." Click the OK button.

  2. Expand the Tools block object on the Object Navigator.

  3. Select the Items object under the Tools block.

  4. Click the Create button ten times. This will create ten items.

  5. Rename the items to the names shown in Figure 16.37. You can do this by clicking on the item on the Object Navigator until it is highlighted. At that point, type over the old name. Figure 16.37 shows the Object Navigator and the tools.

    The next step is to set up a property class. The property class decreases the labor needed to populate the tool item properties.

  6. Select the property class object on the Object Navigator. Click the Create button on the Tool Palette. This will create a property class object.

Page 439

FIG. 16.37
The Object Navigator
displaying the Tools
block and the tool
items after they have
been renamed.



  1. Add item_type, canvas, width, height, and iconic properties to the property class. You may use the add tool to accomplish this.

  2. Populate the new property class with the settings shown in Figure 16.38.

    Figure 16.38 contains the property class that will be used by the buttons. This property class is assigned to each of the items.

FIG. 16.38
The tool item property
class.




    After creating the property class:


  1. Select and open the property sheet of each of the tool items.

  2. The property class created in Step 13 should be added to the class property.

    This will change the values of several of the properties.

  3. Change the value of the X Position property. The value for each tool should be 20 pixels more than the previous tool. For instance, the first tool on the toolbar has an X Position value of 0. The next tool has an X position value of 20. This will spread the tools across the toolbar.

    The last item property to change is the Icon Name. This value consists of the icon file name without the file path and file extension. Figure 16.39 illustrates the Icon Name

Page 440

    property for the Save tool. The Icon Name property is "save." It will call the "save.ico" icon file in the \orawin\forms45\demos\icons directory. Oracle has placed the icons used in this example in that directory. Other icons can be created and used by a form. However, they must be moved to the this directory before the form will use them.


  1. Add the name of the icon file to the Icon Name property.

  2. Repeats Steps 11-14 for each item on the tool bar.

FIG. 16.39
The Save tool property
sheet specifying the
name of the Icon file.




The last step is to attach a When-button-pressed trigger to each of the buttons. This trigger will perform the actual function. Figure 16.40 displays the EMPCH16B.FMB form that contains a horizontal toolbar. This file is contained on the CD.

FIG. 16.40
The Employee Update
form after a horizontal
toolbar has been
added.



Page 441

Summary

The call_form command calls another form from an existing form or menu. The command overlays the child form on top of the parent form. When closing the called form, the operator returns to the original form. The new_form command calls another form, but replaces it with the called form.

The call_form command entirely overlays the existing form with the new form. If the called form is smaller that the parent form, it covers the entire form. This can be prevented by using the no_hide option. Using this option makes Forms cover only the portion of the parent form taken up by the called form.

A directory is a special application used to search the database. It consists of a two-part form. The first part consists of search fields and the second part the results of the search. This application usually has a variety of buttons that allow the operator to navigate to other applications for additional information.

A menu is a Forms module attached to a form. A menu contains a number of options that allow the operator to execute functions or call other forms. The most common use of a menu is to tie a set of related applications into a system.

Menus are usually attached to a startup application. This is the application initially launched by the operator. It sets up the system. It contains the name of the system menu, the database log in passwords, records security values, and maximizes the screen.

Toolbars are Forms objects that consist of a vertical or horizontal row of iconified buttons that execute a When-button-pressed trigger when poked.

From Here…

This chapter completes Part IV of the book. At this time you should have a grasp of how to develop a Forms system. The operator adds, deletes, and modifies records on these applications. The next part of the book covers Oracle's SQL *Reports product. It is a sophisticated tool for developing and executing reports. Chapter 17 will introduce you to the Reports Runtime and Designer products. In some respects they are similar to the Forms products. The chapter will cover the Reports object navigator and data model editor. The chapter will also describe how to create a simple employee listing using the product.

The tables were loaded and the data converted in Installment 3. The portion of the Employee Project will consist of creating the system that will be used by the user to maintain the database. Create the following modules:

Department Update Form

Employee Update Form

Employee Directory

Security Administration Form

Previous | Table of Contents | Next