CREATE SUBMENU Example


Example:

 

*

 

 

.Define the Menu Object

.

 

 

MENU1

MENU

 

MENU1D

INIT

")Options;)Display;)List;)None"

*

 

 

.Define the Submenu Object

.

 

 

SMENU1

SUBMENU

 

SMENU1D

INIT

"SubOpts;)Print;)Spool;)Append"

*

 

 

.Define Some Local Variables

.

 

 

RESULT

FORM

1

REPLY

DIM

1

*

 

 

.Create the Menu and Submenu Objects

.

 

 

  

CREATE

MENU1,MENU1D

  

CREATE

SMENU1,SMENU1D,MENU1,2

*

 

 

.Activate the Menu and Submenu Objects

.

 

 

  

ACTIVATE

MENU1,MENU1,RESULT

  

ACTIVATE

SMENU1,SMENU1,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

  EVENTWAIT

 

  

REPEAT

 

*

 

 

.A Menu Event Occurred

.

 

 

MENU1

 

 

  

KEYIN

*P1:10,"Menu Event - RESULT: ":

  

  

*DV,RESULT," ",REPLY,*P1:10,*EL

  

RETURN

 

*

 

 

.A Submenu Event Occurred

.

 

 

SMENU1

 

 

  

KEYIN

*P1:10,"Submenu Event - RESULT: ":

  

  

*DV,RESULT," ",REPLY,*P1:10,*EL

  

RETURN

 

 

This program creates a menu. A SUBMENU of the first menu's 'List' menu item is then created and attached to the appropriated main menu item. The MENU1X routine is not called if the 'List' item is selected. The SUBMENU is processed instead.

 

 



PL/B Language Reference CREATE STATUSBAR Example CREATE TABCONTROL Example