15. Embedded Forms Program Structure : The Display Block : Submenus
 
Share this page                  
Submenus
Submenus, which are menus that are not directly linked to a displayed form, can be used as a more detailed menu inside a display loop or even as a multi-item prompt without an attached form. The Ingres Forms subsystems often use submenus to provide greater detail for users. For example, while editing a field with VIFRED, your menu can change without changing the form you are editing. Submenu sections are signaled by the submenu statement. That statement is then followed by activate menuitem or activate frskey sections. You cannot include field activations in a submenu because submenu does not allow you to move the cursor off the menu line while the submenu is displayed.
The example below illustrates a submenu that displays when the user chooses the Help menu item:
...
exec frs activate menuitem 'Help';
exec frs begin;
     exec frs submenu;
     exec frs activate menuitem 'Application';
     exec frs begin;
          provide help about current application;
     exec frs end;
     exec frs activate menuitem 'Form';
     exec frs begin;
          provide help about current form;
     exec frs end;
     exec frs activate menuitem 'MenuOperations';
     exec frs begin;
          provide help about current menu operations;
     exec frs end;
exec frs end;
...
When the user selects the Help menu operation, the current menu line is replaced by this submenu:
Application Form MenuOperations
When the user selects one of the submenu operations, the statements in its activate section are executed. The original menu line then returns.
A submenu can also include an activate timeout section.