* The following example demonstrates a system of cascading submenus. A 
* menu bar named mnuDinner is created with two menu bar titles. Each title 
* uses ON PAD to activate the menu named popMainCourse or 
* popDessert. The menus named popMainCourse and popDessert 
* each have additional menus named popBurger, popPizza and 
* popPie assigned to their item lists with three ON BAR commands. 
* The popOlives and popPie items have additional menus assigned with 
* two ON BAR commands.

* When you make a selection, ON SELECTION POPUP ALL executes 
* a procedure named yourchoice that activates a window and displays 
* your choice. The choice is determined with POPUP( ) and PROMPT( ), 
* which return the name of the menu and the contents (text) of the menu item.
*DEFINE POPUP popExam FROM 5,5
*DEFINE WINDOW wOrder FROM 20,0 TO 23,39
DEFINE POPUP mnuDinner FROM 20,0
*DEFINE MENU mnuDinner
DEFINE PAD padOne OF mnuDinner PROMPT '\<Main Course' KEY ALT+M, ''
ON PAD padOne OF mnuDinner ACTIVATE POPUP popMainCourse
DEFINE POPUP popMainCourse MARGIN MESSAGE ;
	'We have burgers and pizza today'
DEFINE BAR 1 OF popMainCourse PROMPT '\<Hamburgers'
DEFINE BAR 2 OF popMainCourse PROMPT '\<Pizza'
ON BAR 1 OF popMainCourse ACTIVATE POPUP burger 
ON BAR 2 OF popMainCourse ACTIVATE POPUP pizza 
ON SELECTION POPUP ALL DO yourchoice
ACTIVATE MENU mnuDinner
PROCEDURE yourchoice
ACTIVATE WINDOW wOrder 
CLEAR
DO CASE
	CASE POPUP( ) = 'BURGER'
		@ 0,0 SAY 'A ' + POPUP( ) + ' order:'

@ 1,0 SAY 'You ordered a burger with ' + LOWER(PROMPT( ))
	CASE POPUP( ) = 'PIZZA'
		@ 0,0 SAY 'A ' + POPUP( ) + ' order:'
		@ 1,0 SAY 'You ordered a pizza with ' + LOWER(PROMPT( ))
	CASE POPUP( ) = 'OLIVES'
		@ 0,0 SAY 'A ' + POPUP( ) + ' order:'
		@ 1,0 SAY 'You ordered a pizza with ' ;
			+ LOWER(PROMPT( )) + ' olives'
	CASE POPUP( ) = 'DESSERT'
		@ 0,0 SAY 'A ' + POPUP( ) + ' order:'
		@ 1,0 SAY 'You ordered ' + LOWER(PROMPT( )) + ' for dessert'
	CASE POPUP( ) = 'PIE'

@ 0,0 SAY 'A ' + POPUP( ) + ' order:'
		@ 1,0 SAY 'You ordered ' + LOWER(PROMPT( )) + ' pie'
ENDCASE
WAIT WINDOW
DEACTIVATE WINDOW wOrder
RETURN