Previous | Table of Contents | Next

Page 398

  1. To properly display this window for a 600¥480 size display, set Width to 473 and Length to 289. If you're planning to use a different screen resolution, you'll have to change Width and Length accordingly.
  2. Scroll to the Title property, X and set it to Flugle Information System. Figure 14.19 illustrates what the window properties are set to.

Figure 14.19.
Setting the
ROOT_WINDOW
window properties.

Now, you need to create a canvas for this form.

  1. Select the Canvas-View object node, and click + on the vertical toolbar.
  2. Select the canvas that was created, and right-click Properties.
  3. Scroll the Width property to 473 and the Length property to 289. These are the same values that you specified for ROOT_WINDOW. Those are the only properties that you need to set for the canvas.
  4. Now, select the form, MDI_FRAME, and right-click Properties.
  5. Set the Title property to Flugle Information System.
  6. Scroll down to the Menu Module property, and set it to MAIN_MENU. This is the menu that you have just created.
  7. Scroll down to the Starting Menu property, and set it to MAIN_MENU. This will be the menu that is initially used when the MDI_FRAME form is invoked. Figure 14.20 displays the property values for the MDI_FRAME form.
  8. Save the MDI_FRAME form as MDI_FRAME in the directory that you have created for storing application components.
  9. Generate the .fmx file for the MDI_FRAME form by pressing Ctrl+t.

Page 399

Figure 14.20.
Setting the properties
for MDI_FRAME
form.

Creating a Windows Shortcut to Run an Application

Believe it or not, you've constructed the basic elements that are needed for a multiple-form application. To test your application, create a shortcut. To create the shortcut, right-click New | Shortcut on the Windows 95 desktop. You need to enter the command-line argument in the Create Shortcut window. Before you enter the command-line arguments for the shortcut, let's discuss a few arguments used by Forms Runtime:

To run your forms application, enter the following line in the Command Line field:

c:\Orawin95\bin\F45run32 module=c:\Tyo\MDI_FRAME
Âuserid=flugle/flugle@flugle window_state=maximize

Click on Next. Give the shortcut a name like Flugle Information System, and click Finish. You should see the new shortcut on your desktop. Try running the shortcut. Invoke Data Entry | Instructor from the menu; you should see the Instructor form.

Page 400

NOTE
One disadvantage of this shortcut is that the password is contained within the shortcut and could be viewed by others. If you don't specify a value for userid, Forms Runtime will prompt the user for username, password, and database when the shortcut is invoked.

Closing a Form

If you invoke the Instructor form from the Data Entry menu, you might discover that one way to close the form is to select Action | Exit from the menu. However, if you click the exit icon in the upper-right corner of the Instructor form (not the MDI_FRAME form), the Instructor form will not close. Ideally, you would like the form to close when the user clicks this icon. To do this, you need to create another trigger in the Instructor form.

  1. Using the Object Navigator, open the Instructor form.
  2. Expand the form, and select the Triggers object node at the form level.
  3. Click + on the vertical toolbar to create a new trigger.
  4. In the window that appears, select the WHEN-WINDOW-CLOSED event and click OK.
  5. Double-click the icon to the left of the WHEN-WINDOW-CLOSED trigger displayed in the Object Navigator.
  6. In the PL/SQL Editor, enter a single line: exit_form. This is a built-in procedure that will be invoked whenever the window is closed.
  7. Click Close.
  8. Save the Instructor form and regenerate it.
  9. Use the shortcut to test the form and verify that the form closes when the exit icon is clicked.

Summary

The essential points in this lesson were the following:

Page 401

What Comes Next?

On Day 15, "Developer/2000: Developing Reports with Oracle Reports," you learn about Oracle Reports. You'll go through the steps of creating two reports: a simple report based on a single table and a master-detail report. You'll also see how to specify a format trigger that uses PL/SQL statements to control the appearance of a report item, depending on its value.

Q&A

Q How does Oracle Forms handle triggers, associated with different levels, which respond to the same event?

A If two or more triggers are defined for the same event, the trigger associated with the lowest item level takes precedence. For example, suppose a form has two triggers, one at the block level and the other at the item level. If both triggers are defined for the WHEN-NEW-ITEM-INSTANCE event, the item-level trigger will fire when the event occurs.

Q What are some of the built-in procedures that are available in Oracle Forms?

A There are a number of built-in procedures that can be invoked from PL/SQL subprograms in triggers or library modules. These procedures include:

Q What are some of the system variables that are available in Oracle Forms?

A There are several system variables that can be very useful in a trigger:

Previous | Table of Contents | Next

Используются технологии uCoz