home *** CD-ROM | disk | FTP | other *** search
- if %# == 0
- echo !
- usage: menu <id> <x> <y> <header> <selection1> ...
- MENU saves the current screen and displays a window containing
- the given selections. The upper left corner of the window is
- defined by <x> and <y>. The <id> should be a number in one of
- two ranges:
- 1 .. 9 Once the menu is exited, the menu will be erased
- from the screen.
- 10 .. 99 The menu will stay on the screen after menu is
- exited. To remove a menu, execute the shell
- REMOVEM.SH with the menu <id>.
-
- MENU returns a number 1 thru # of selection items or a -1 if
- the <esc> was pressed. You may access this return value thru the
- use of the %%? special variable.
- Once you are done with all menus, you can get rid of all screen
- saving files by DELeting all SH1TMPS.* from the directory
- specified by SH1FILES.
-
- Example:
-
- menu 1 10 10 "SW development" Edit Compile Link "Load and Run"
- !
- exit
- endif
-
- local MENUY MENUX1 MENUID MENUH MENUN MENUX
-
- MENUID=%1
- MENUX=%2
- compute MENUX1=%MENUX+2
- MENUY=%3
- MENUH=%4
- MENUN=1
- shift
- shift
- shift
- shift
- shx -scrs %{SH1FILES}sh1tmps.%MENUID
- gotoxy %MENUX %MENUY
- echo ┌────────────────────────┐_
- gotoxy %MENUX1 %MENUY
- echo %MENUH ^^
- compute MENUY=%MENUY+1
- gotoxy %MENUX %MENUY
- echo │ │_
- compute MENUY=%MENUY+1
- while '%1' != ''
- gotoxy %MENUX %MENUY
- echo │ │_
- gotoxy %MENUX1 %MENUY
- echo %MENUN %1_
- shift
- compute MENUN=%MENUN+1
- compute MENUY=%MENUY+1
- endwhile
- gotoxy %MENUX %MENUY
- echo │ │_
- compute MENUY=%MENUY+1
- gotoxy %MENUX %MENUY
- echo └────────────────────────┘_
- compute MENUY=%MENUY-1
- gotoxy %MENUX1 %MENUY
- echo Enter selection: _
- repeat
- MENUX=%!
- until ('%MENUX' >= '1' & '%MENUX' < '%MENUN') | '%MENUX' == ''
- if %MENUID < 10
- shx -scrl %{SH1FILES}sh1tmps.%MENUID
- endif
- if '%MENUX' == ''
- MENUX=-1
- endif
- exit %MENUX