|
Previous | Table of Contents | Next
Page 398
- 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.
- 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.
- Select the Canvas-View object node, and click + on the vertical toolbar.
- Select the canvas that was created, and right-click Properties.
- 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.
- Now, select the form, MDI_FRAME, and right-click Properties.
- Set the Title property to Flugle Information
System.
- Scroll down to the Menu Module property, and set it to MAIN_MENU. This
is the menu that you have just created.
- 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.
- Save the MDI_FRAME form as MDI_FRAME in the directory that you
have created for storing application components.
- 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.

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:
- userid identifies the username, password, and database alias, if any, to be used
to connect to the database.
- module identifies the form that you want to run (this should be the form
that contains the root window: MDI_FRAME).
- window_state is an optional parameter that can be used to force the form
specified in module to be MAXIMIZE, MINIMIZE, or
NORMAL.
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.
- Using the Object Navigator, open the Instructor form.
- Expand the form, and select the Triggers object node at the form level.
- Click + on the vertical toolbar to create a new trigger.
- In the window that appears, select the
WHEN-WINDOW-CLOSED event and click OK.
- Double-click the icon to the left of the
WHEN-WINDOW-CLOSED trigger displayed in the Object Navigator.
- 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.
- Click Close.
- Save the Instructor form and regenerate it.
- Use the shortcut to test the form and verify that the form closes when the exit
icon is clicked.
The essential points in this lesson were the following:
- A trigger is a group of PL/SQL statements that is executed when a specified
event occurs.
- A form can have triggers defined at different levels: the form level, the block
level, and the item level.
- The events that can cause a trigger to fire vary depending on the level of the
trigger. For example, certain window events will trigger only a form-level trigger.
- Some triggers are automatically generated by the Forms Designer when you
request the enforcement of integrity constraints for a new block.
Page 401
- You use the PL/SQL Editor to specify the PL/SQL statements for a trigger.
- A trigger can be used to retrieve values from other tables.
- A trigger can be used to validate user input. Such a trigger can raise the
built-in exception, FORM_TRIGGER_FAILURE, if the user's input does not pass validation.
- A trigger can be used to automatically execute a query when a form is invoked.
- You use the Forms Designer to create and modify menus.
- A menu may consist of several object types, including a main menu and
other menus, an object group, program unit, parameter, property class, attached
library, and visual attribute.
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 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:
- Navigational procedures such as
GO_BLOCK, GO_ITEM, and NEXT_ITEM
- Procedures that modify the contents of a block such as
CLEAR_RECORD, DELETE_RECORD, and INSERT_RECORD
- Procedures that control query processing:
ENTER_QUERY and EXECUTE_QUERY
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:
- n $$DATE$$ and $$TIME$$ contain the current date and time, respectively.
- n Variables that describe the current focus of the form such
as SYSTEM.CURRENT_FORM, SYSTEM.CURRENT_BLOCK, and
SYSTEM.CURRENT_ITEM.
Previous | Table of Contents | Next
|
Используются технологии
uCoz