home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / menuing / smmenu.zip / SAMPLE.MNU < prev    next >
Text File  |  1993-08-07  |  8KB  |  272 lines

  1. ; This is a sample main menu for SUPRMENU 5.1
  2. ;
  3. ; Once you have defined SMMENU.BAT, you can actually run this menu
  4. ; file by:
  5. ;
  6. ;    > CD \subdir_containing_SUPRMENU
  7. ;    > SMMENU SAMPLE.MNU
  8. ;
  9. ; This is the main menu.  It will be executed by default when SUPRMENU
  10. ; is invoked from the SMMENU.BAT file.
  11. ;
  12. ;  *Main is the menu label which is searched for.
  13. ;  The next line is the title which will appear at the top of the
  14. ;      menu window.
  15. *Main
  16. Sample Menu
  17.  
  18. ;
  19. ; This menu item, when selected, will pop up the Exit to DOS dialog
  20. ; and cause an exit to DOS if the user selects YES.
  21. ;
  22. ;  The line beginning with # defines the menu item.  The character
  23. ;  immediately after the # is the "hotkey" which, when pressed, will
  24. ;  select this item (it will be highlighted).
  25. ;  The string "Exit to DOS" (after the comma) will be displayed as the
  26. ;  menu selection.
  27. ;
  28. ;  The !EXIT command is what causes the Exit to DOS box and exits on YES.
  29. ;
  30. #E,Exit to Dos
  31.     !EXIT
  32.  
  33. ;
  34. ; This menu item invokes another menu below, whose label is *WP.  When
  35. ; this menu item is selected, SUPRMENU will search from the beginning
  36. ; of this menu file for *WP, and will then display that menu.
  37. ;
  38. #W,Word Processing
  39.     !MENU,wp
  40.  
  41. #T,Test SUPRMENU Tools
  42.     !MENU,tools
  43. ;
  44. ; This item simply calls the SMSETUP.EXE program to change the configuration
  45. ; of SUPRMENU
  46. ;
  47. #C,Configure SUPRMENU
  48.     SMSETUP
  49. ;
  50. ; This item, when selected, issues a LOGOUT command by stuffing the
  51. ; keyboard buffer and exiting to DOS.  DOS, upon detecting "typeahead"
  52. ; in the buffer (we put "LOGOUT"+CR in there), will execute the command
  53. ; as if you typed it.
  54. ;
  55. #L,LOGOUT
  56.     !LOGOUT
  57.  
  58. ;
  59. ; This item shows a way of handling the rebooting of the computer
  60. ;
  61. ;   This assumes a subdirectory \CONFIGS which contains files to
  62. ;   replace CONFIG.SYS and AUTOEXE.BAT, which are named
  63. ;   <configname>.SYS (replaces CONFIG.SYS) and 
  64. ;   <configname>.BAT (replaces AUTOEXEC.BAT)
  65. #R,Reboot the computer
  66.  
  67. ; A choice dialog box
  68.     !CHOICE,1,COLD,WARM,Type of Reboot
  69.     !CHOICE,2,DOS,WINDOWS,None,Configuration to change to
  70. ; Skip over !EXEC commands if user chose None
  71.     !SKIPIF,2,None,2
  72. ; Immediately, right here, do the following commands.
  73.     !EXEC,IF EXIST \CONFIGS\%2.SYS copy \CONFIGS\%2.SYS C:\CONFIG.SYS
  74.     !EXEC,IF EXIST \CONFIGS\%2.BAT copy \CONFIGS\%2.SYS C:\AUTOEXEC.BAT
  75. ; Skip next line if user selected COLD
  76.     !SKIPIF,1,COLD
  77.     !REBOOT,W
  78.     !REBOOT,C
  79.  
  80. ;
  81. ; List this menu file.  Note: requires Vern Buerg LIST program.
  82. ;
  83. #V,View SAMPLE.MNU
  84.     LIST SAMPLE.MNU
  85.  
  86. ;
  87. ; Another menu definition.  This is displayed when user selects the
  88. ; word processing item above.
  89. ;
  90.  
  91. *WP
  92. Word Processing
  93.  
  94. ;
  95. ; This menu item shows a sophisticated use of the SUBMENU and SKIP commands.
  96. ; The purpose is to issue the correct NOVELL CAPTURE command to direct
  97. ; print output to a network printer as selected.
  98. ;
  99. ; This is a demonstration of the trick described at the end of the
  100. ; SUPRMENU.DOC file, where %2 is embedded in the string placed into the
  101. ; #1 variable by the PRSELECT and NETPRSEL submenus.  When the line %1
  102. ; is evaluated first %1 is replaced (including the %2 reference).  Then
  103. ; the %2 reference is replaced(!).
  104. ;
  105. ; Note the use of the "numlines" parameter on !SKIPIF to skip 2 commands
  106. ; when the user selects a local printer; there is no need to ask the
  107. ; other two items.
  108. ;
  109. ; The generated commands are ECHOed, this is a demonstration.  If you
  110. ; have Word Perfect, you could slightly modify the commands, remove
  111. ; the echos and call Word Perfect.
  112. ;
  113. #W,Word Perfect
  114.     !SUBMENU,1,PRSELECT
  115.     !SKIPIF,1,ENDCAP,2
  116.     !SUBMENU,1,NETPRSEL
  117.     !SUBMENU,2,FFSEL
  118.     cls
  119.     echo %1
  120.     echo d:
  121.     echo cd \wp51
  122.     echo wp
  123.     echo ENDCAP
  124.     pause
  125.  
  126. ;
  127. ; A demonstration of the !MSG command to display clarifying text.
  128. ;
  129. ; A demonstration of the !FILE command to get the name of a file to
  130. ; list.  Note that no default is given, so ESC will terminate this
  131. ; command.
  132. ;
  133. ; Requires Vern Buerg's LIST program (or substitute a call to your own)
  134. ;
  135. #L,List an ASCII file
  136.     !MSG,Select file to List
  137.     !FILE,1,*.*
  138.     LIST %1
  139.  
  140. ;
  141. ; This menu is called from the main menu.  It contains demonstration code
  142. ; for most of the SUPRMENU commands.
  143. ;
  144. *TOOLS
  145. SUPRMENU Tools
  146.  
  147. ;
  148. ; The !ASK command gets free-form user input up to 48 characters.
  149. ;
  150. ;   In this example, what the user types is placed into the #1 variable
  151. ;   and then substituted for the %1 on the ECHO command.
  152. ;
  153. ; Note the use of the !SKIPIF command to test for a null value and
  154. ; abort this item if one is entered.
  155. ;
  156. #A,ASK Command
  157.     !ASK,1,Enter something
  158.     !SKIPIF,1,,QUIT
  159.     cls
  160.     Echo You entered: %1
  161.     pause
  162.  
  163. ;
  164. ; The !CHOICE command puts up a dialog box with selection buttons.
  165. ;
  166. ; The text of the selection button (in this case, YES, NO, or MAYBE)
  167. ;    is placed into the variable (#1 in this case) when selected.
  168. ;
  169. #C,CHOICE Command
  170.     !CHOICE,1,YES,NO,MAYBE,What is your choice?
  171.     cls
  172.     echo You said %1
  173.     pause
  174. ;
  175. ; The !SUBMENU command defines a popup menu.  In this case, SUPRMENU
  176. ; displays the submenu defined below at *CHOICES.  The return string
  177. ; from that submenu is placed in the # 1 variable.
  178. ;
  179. #S,SUBMENU Command
  180.     !SUBMENU,1,Choices
  181.     cls
  182.     echo You chose: %1
  183.     pause
  184.  
  185. ;
  186. ; !GETENV gets the value of a DOS environment variable and places it into
  187. ; a SUPRMENU replacement variable.  Here, we get COMSPEC and USER values.
  188. ;
  189. ; The SKIPIF checks for a NULL value returned from USER, which means it
  190. ; is not defined.
  191. ;
  192. #G,GETENV Command
  193.     !GETENV,1,COMSPEC
  194.     !GETENV,2,USER
  195.     cls
  196.     echo COMSPEC=%1
  197.     !SKIPIF,2,
  198.     echo USER=%2
  199.     !SKIPNOT,2,
  200.     Echo USER variable not defined
  201.     pause
  202.  
  203.  
  204. ;
  205. ; The !FILE command pops up a list of files and returns the fully-formatted
  206. ; path and filename selected.
  207. ;
  208. ; The first !FILE command will abort the processing of this item if ESC is
  209. ; pressed.  The second !FILE command will return *.MNU is ESC is pressed.
  210. ;
  211. ; Note the use of !MSG boxes for clarification
  212. ;
  213. #F,FILE Command
  214.     !MSG,Select A Source File
  215.     !FILE,1,*.*
  216.     !MSG,Select A Destination File
  217.     !FILE,2,*.*,*.MNU
  218.     cls
  219.     ECHO You have selected:
  220.     ECHO      Source: %1  Destination: %2
  221.     pause
  222.  
  223. ;
  224. ; ^PASS means the user must enter a password in order to use this menu item.
  225. ; Password entry is not case sensitive;  It would accept PASS, pass, Pass,
  226. ; PaSs, etc.
  227. ;
  228. #P,Password Protection (PASS)
  229.     ^PASS
  230.     cls
  231.     ECHO You entered the magic word!!!!
  232.     pause
  233.  
  234.  
  235. ; Submenus for the above items
  236. ;
  237. ; The text to the left of the = sign is displayed.  If an item is
  238. ; selected, the corresponding text to the right of the = is returned
  239. ; and placed in the SUPRMENU variable defined on the !SUBMENU command.
  240. ;
  241.  
  242. *PRSELECT
  243. Select A Printer
  244. Network Printer=NETWORK
  245. Local Printer=ENDCAP
  246.  
  247. *NETPRSEL
  248. Network Printer
  249. Laser Printer=CAPTURE NB NTT %2 Q=PRINTQ_1
  250. Dot Matrix Printer=CAPTURE NB NTT %2 Q=PRINTQ_0
  251.  
  252. *FFSEL
  253. Send Form Feed
  254. Form Feed=FF
  255. No Form Feed=NFF
  256.  
  257. ;
  258. ; Invoked by the !SUBMENU,1,Choices command above
  259. ;
  260. *CHOICES
  261. Choose One
  262. Vanilla=Vanilla/Peppermint Ice Cream
  263. Chocolate=Yecch! Chocolate
  264. Strawberry=Yes, Berry Good!
  265. Cherry=Cherry Red
  266. Rasberry=Ooo! So bumpy!
  267. Banana=In you ear!!
  268. Peach=You are a peach!!
  269. Tapioca=Lumpy tapioca
  270. Blueberry=Oh, am I Blue!
  271. Plum=Ouch! That was my thumb!
  272.