Document-ID: 41455.1
Subject: HOW TO CREATE A CUSTOM MENU IN ORACLE FORMS 4.5
Author: Unknown
Last Modified: 23 Sep 96
How to Create a Custom Menu in Oracle Forms 4.5
===============================================
Introduction:
-------------
This bulletin explains how to create a custom menu consisting of the
following:
MAIN MENU ----------------------- |FILE| (title of a menu)
INDIVIDUAL MENU ----------------------- |SAVE| (save a form)
SUBMENU ----------------------- |EXIT| (exit a form)
Menu Type Definitions:
MAIN MENU is the title of an individual menu that does not execute
commands.
INDIVIDUAL MENU is a menu item that executes a command and calls a
submenu.
SUBMENU is a menu item that provides additional choices to an
individual menu and executes commands.
How to Create a Custom Menu:
----------------------------
I. Create a menu module:
1. Open the Forms Designer.
2. Choose File-->New -->Menu
or in the Object Navigator, select the Menus node and
click on the "Create" icon in the toolbar.
3. A default menu name MODULE2 displays on the Object Navigator.
4. Click once to select MODULE2, and click again to be in edit mode.
5. Drag to select MODULE2, and replace it with MY_MENU.
II. Create a main menu in the Layout Editor:
1. To bring up the Menu Layout Editor, select File-->Tools-->Menu Editor.
2. The Menu Editor displays one item highlighted as <New_Item>.
3. Type a menu label, such as FILE, to replace the <New_Item> label.
4. Click on the "Create Right" icon to create another Main Menu item.
5. Type a menu label, such as EDIT, to replace the <New_Item> label.
6. Repeat steps 4 and 5 to create additional Main Menu items.
III. Create an individual menu under the main menu in the Layout Editor:
1. Select the main menu item FILE.
2. Click on the "Create Down" icon to create a menu item.
3. A <New_Item> created under FILE.
4. Select it, and type in a label, such as SAVE.
5. Select Tools-->Properties to bring up the SAVE item properties.
6. Set the Command Type property to PL/SQL.
7. Double-click on the Command Text property
to bring up the PL/SQL Editor.
8. To assign an action to the SAVE menu item, type:
COMMIT_FORM;
9. Click on the "Compile" button to compile the PL/SQL code.
10. Click on the "Close" button to exit the PL/SQL Editor.
11. Repeat steps 2 through 9 to create additional items for the menu.
IV. Create a submenu next to the SAVE menu item in the layout editor:
1. Select the menu item SAVE.
2. Click on the "Create Right" icon to create a submenu.
3. A <New_Item> is created under SAVE.
4. Select it, and type in a label, such as EXIT.
5. Select Tools-->Properties to bring up the EXIT item properties.
6. Set the Command Type property to PL/SQL.
7. Double-click on the Command Text property
to bring up the PL/SQL Editor.
8. To apply an action to the EXIT menu item, type:
EXIT_FORM;
9. Click on the "Compile" button to compile the PL/SQL code.
10. Click on the "Close" button to exit PL/SQL Editor.
11. Repeat steps 2 through 10 to create additional submenu items.
V. Save the menu file as MYMENU.MMB and generate it:
1. Select File-->Save
to save the MYMENU.MMB file.
2. Select File-->Administration-->Generate
to generate the MYMENU.MMX file.
Note: To successfully run the MYMENU.MMB file, check the following:
1. MYMENU.MMB or .MMX needs to be on the FORMS45 or ORACLE path.
2. Attach MYMENU file to an existing Oracle Forms module.
a. Select Tools-->Properties to open the Form Module properties.
b. Set the Menu Module property to MYMENU.
c. For more information, refer to:
Bulletin 106754.089: (V4/V45) LINKING A FORM TO A MENU
3. Generate and run the form.
For more information on custom menus, refer to:
Chapter 22, "Basic Menu Design",
in the Oracle Developer/2000 Forms 4.5 Developer's Guide Manual