home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxdlg11.zip / menu.cmd < prev    next >
OS/2 REXX Batch file  |  1995-03-01  |  3KB  |  81 lines

  1. /* An example of a MENU Group */
  2.  
  3. /* Trap ERROR and FAILURE */
  4. SIGNAL ON ERROR
  5. SIGNAL ON FAILURE
  6.  
  7.  
  8. /* ====================== 'Main Window' ======================= */
  9. /* MENU Group */
  10. RXTYPE.1 = 'MENU'
  11.  
  12. /* TotalMenus, REXX variable names for the Headings */
  13. RXINFO.1 = '2 MENU1|MENU2'
  14.  
  15. /* Give me a HELP menu too */
  16. RXFLAGS.1 = 'HELP'
  17.  
  18. /* Menu 1 */
  19. MENU1.0 = 'File'
  20. MENU1.1 = 'Open|2'  /* NOTE: 2 subitems */
  21. MENU1.2 = 'Save'
  22. MENU1.3 = ' '  /* End of Menu 1 */
  23.  
  24. /* Menu 1, Item 1 subitems */
  25. MENU1.1.1 = 'All'
  26. MENU1.1.2 = 'Excerpt'
  27.  
  28. /* Menu 2 */
  29. MENU2.0 = 'Edit'
  30. MENU2.1 = 'Cut'
  31. MENU2.2 = 'Copy'
  32. MENU2.3 = 'Paste'
  33. MENU2.4 = ' '  /* End of Menu 2 */
  34.  
  35. /* Default size and position (also gives us sizing and max button) */
  36. RXWINMAIN = ' '
  37.  
  38. /* Specify NOCLOSE since we want to close the window ourselves.
  39.    No RESULT Flag, so the ESC and ENTER keys do nothing, and we
  40.    don't have to bother checking for those */
  41. RXDLG 1 '"Main Window"' 'RXWINMAIN' 'NOCLOSE'
  42.  
  43. /* Associate the help file (so that we can use the HELP menu). Note that
  44.    Rexx Dialog automatically displays panels from it when the user
  45.    selects items in the HELP menu */
  46. RXHELP 'CREATE' '""' 'TEST.HLP'
  47.  
  48. more:
  49. RXDLG
  50.  
  51. /* IF user clicked upon CLOSE ICON, close Main Window and exit */
  52. IF RXID < 0 THEN EXIT
  53.  
  54. /* Print out RXID and RXSUBID. RXID should be 1, since we only
  55.   have 1 Group, no timeout, and no KEYS or RESULT Flag set.  RXSUBID is the
  56.   label number, which will depend upon which Item or SubItem was chosen from
  57.   the menu. Since we asked for a HELP menu too, the first 5 label numbers
  58.   correspond to the Help Heading, and the 4 Help Items, "Help index",
  59.   "General Help", "Using Help", and "Keys Help", even though the Help menu
  60.   appears last on the menu bar
  61. */
  62.  
  63. RXSAY 'Group = 'RXID 'Menu = 'RXSUBID
  64.  
  65. SIGNAL more
  66.  
  67. /* ==================================================== */
  68.  
  69. FAILURE:
  70.     /* NOTE: the variable RC contains the returned error message (not a number,
  71.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  72.     Because we used the default severity level, Rexx Dialog has already displayed
  73.     this error message to the enduser */
  74.     EXIT
  75. ERROR:
  76.     /* NOTE: the variable RC contains the returned error message (not a number,
  77.     unless we use RXERR to set up Rexx Dialog to return error numbers instead).
  78.     Because we used the default severity level, Rexx Dialog has already displayed
  79.     this error message to the enduser */
  80.     EXIT
  81.