| Previous | Contents | Index |
The %ITEMS directive creates a multi-column menu. "Number" represents the number of items per column. %ITEMS creates as many columns as is necessary. Horizontally scroll the columns as needed.
%ITEMS number
|
| Example 8-43 %ITEMS menu directive |
|---|
menu$='ENGINES={%items 3, DBMS, ARS, ADABASE, RDB, DBASE}'
input menu menu$: ans$
end
+----------+------------------------+
| ENGINES | DBMS | RDB |
+----------| ARS | DBASE |
| ADABASE | |
+------------------------+
|
The %LOCKSTEP directive controls column scrolling when there are multiple columns in one menu. If it is turned OFF, the columns scroll independently. Otherwise, the columns scroll together.
%LOCKSTEP [ON|OFF]
|
| Example 8-44 %LOCKSTEP menu directive |
|---|
menu$ = '%lockstep off, %SIZE 4, 1, 2, 3, 4, 5, 6, %split, 7, 8, 9, 10, 11, 12'
line input menu menu$ : ans$
end
+---------------+
| ... | 7 |
| 4 | 8 |
| 5 | 9 |
| 6 | ... |
+---------------+
|
The %MENUBAR directive creates menu bars (menus with choices listed horizontally) with pull-down submenus.
%MENUBAR
|
| Example 8-45 %MENUBAR menu directive |
|---|
item1$='%menubar, OPEN, SELECT={INCLUDE,EXCLUDE}, SORT, PRINT'
line input menu item1$ : ans$
end
+---------------------------------------------------------------------------+
| OPEN SELECT SORT PRINT |
+----------+---SELECT---+---------------------------------------------------+
| INCLUDE |
| EXCLUDE |
+------------+
|
The %MESSAGE directive displays a message when the menu or submenu is displayed.
%MESSAGE 'message'
|
| Example 8-46 %MESSAGE menu directive |
|---|
menu$ = 'open, show, print, %message "Select a menu option"'
line input menu menu$: ans$
end
+----------+
| OPEN |
| SHOW |
| PRINT |
+----------+
Select a menu option
|
The %MULTI directive allows multiple items to be selected from a menu or submenu.
The %REPLACE directive can be located in any submenu. The calling menu is not kept on the screen. Pressing '\' will return to the calling menu.
The %SIZE number directive determines the number of DESCRIPTIVE items that are located in the menu_box.
There is no limit to the number of the items that can be used. If all of the items do not fit within the menu box, the items are vertically scrolled using the UP, DOWN, LEFT and RIGHT ARROW keys. "Str_var" contains the name of the selected item. If the %MULTI directive is used and the [Select] key is pressed, "Str_var" contains the names of the items. Each item is separated by a line feed character.
The %SPLIT directive instructs SheerPower to start a new column at that specified point in the menu.
%SPLIT
|
| Example 8-47 %SPLIT menu directive |
|---|
item1$='title, chapter, page={1201, 1202, 1203, 1204, %split, 1305, 1306, 1307}'
line input menu item1$ : ans$
end
+------------+
| TITLE |
| CHAPTER +-------PAGE---------+
| PAGE | 1201 | 1305 |
+----------| 1202 | 1306 |
| 1203 | 1307 |
| 1204 | |
+--------------------+
|
The %TITLE ".........." directive assigns a title to a menu or submenu.
The %WIDTH directive controls the minimum width of the current column.
%WIDTH number
|
| Example 8-48 %WIDTH menu directive |
|---|
menu$ = '%width 20,%items 2, a, b, c,d, f, g, h, i, j'
input menu menu$ : ans$
end
+------------------------------------------------------------------------------+
|<< C | F | H >>|
| D | G | I |
+------------------------------------------------------------------------------+
|
Normally menus are ON TOP of all windows and ACTIVE. The %INACTIVE directive makes the menus be like "normal" windows where other windows can be on top of them.
%INACTIVE
|
| Example 8-49 %INACTIVE menu directive |
|---|
title$ = '%inactive, %title "structure",%multi,'
box_loc$ = '%at 10,15,'
client$ = '"TTI_Client"={id,name={Cass,Brock,Errant},phone},'
address$ = 'address={%bar,street,city,state,country},'
misc$ = 'misc={%replace,mail,record}'
menu$ = title$ & box_loc$ & client$ & address$ & misc$
line input menu menu$: ans$
end
+---STRUCTURE---+
| TTI_CLIENT +---ADDRESS--+
| ADDRESS |------------|
| MISC... | STREET |
+--------------| CITY |
| STATE |
| COUNTRY |
+------------+
|
Usually as you move your mouse over a menu item, the menu item under the mouse becomes active. %NOMOUSEOVER turns off the mouse-over feature.
%NOMOUSEOVER
|
| Example 8-50 %NOMOUSEOVER menu directive |
|---|
menu$ ='%nomouseover, OPEN, SHOW, PRINT, %heading "GUIDE_OPTIONS",' +
'NOSYSTEM, "MENU ON|OFF"'
line input menu menu$ : ans$
end
+------------------+
| OPEN |
| SHOW |
| PRINT |
| |
| GUIDE_OPTIONS |
| NOSYSTEM |
| MENU ON|OFF |
+------------------+
|
The following is the user interface in a [LINE] INPUT MENU:
KEY INPUT [[#channel] [, PROMPT str_expr]
[, TIMEOUT time_limit]
[, ELAPSED num_var]
:] var, [var,...]
|
| Example 8-51 KEY INPUT statement |
|---|
print 'See how quick you are.'
key input prompt 'Press a key, quick!', &
elapsed x: press$
print
print 'You took'; x; 'seconds to Press '; press$; '.'
end
See how quick you are.
Press a key, quick!
You took 1.99 seconds to Press h.
|
KEY INPUT is used to input a keystroke from the user and stores the value of the key in the string variable specified.
Some applications require the use of special keys or keystroke level validation. The KEY INPUT statement is used for these applications.
KEY INPUT does not echo the key pressed, nor does it generate a line feed.
All the options available with the preceding "INPUT" statement are also available with KEY INPUT. KEY INPUT returns the following:
_back_TERMINATOR returns control (Ctrl) characters in the format "CTRL/X". For example, if the user presses [Ctrl/G], _TERMINATOR returns "CTRL/G".
_exit
_help
_terminator
| Example 8-52 _TERMINATOR system function |
|---|
key input 'Press a terminator' : z$
print
print 'You pressed '; _terminator
end
Press a terminator? (User presses [CTRL/G])
You pressed CTRL/G
|
| Previous | Next | Contents | Index |