Sheerpower®
A Guide to the Sheerpower Language


Previous Contents Index

FORMAT:


        %HEADING ['text_str'] 

EXAMPLE:

Example 8-42 %HEADING Menu Directive

  menu$ ='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     | 
        +------------------+ 

%ITEMS

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.

FORMAT:


        %ITEMS number 

EXAMPLE:

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   |           | 
                   +------------------------+ 

%LOCKSTEP

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.

FORMAT:


        %LOCKSTEP [ON|OFF] 

EXAMPLE:

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   |   ...  | 
        +---------------+ 

%MENUBAR

The %MENUBAR directive creates menu bars (menus with choices listed horizontally) with pull-down submenus.

FORMAT:


        %MENUBAR 

EXAMPLE:

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   | 
                   +------------+ 

%MESSAGE

The %MESSAGE directive displays a message when the menu or submenu is displayed.

FORMAT:


        %MESSAGE 'message' 

EXAMPLE:

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

%MULTI

The %MULTI directive allows multiple items to be selected from a menu or submenu.

%REPLACE

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.

%SIZE Number

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.

%SPLIT

The %SPLIT directive instructs Sheerpower to start a new column at that specified point in the menu.

FORMAT:


        %SPLIT 

EXAMPLE:

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   |          | 
                   +--------------------+ 

%TITLE ".........."

The %TITLE ".........." directive assigns a title to a menu or submenu.

%WIDTH

The %WIDTH directive controls the minimum width of the current column.

FORMAT:


        %WIDTH number 

EXAMPLE:

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                             | 
        +------------------------------------------------------------------------------+ 

%INACTIVE

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.

FORMAT:


        %INACTIVE 

EXAMPLE:

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   | 
                              +------------+ 
 

%NOMOUSEOVER

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.

FORMAT:


        %NOMOUSEOVER 

EXAMPLE:

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     | 
        +------------------+ 

8.18.4 User Interface

The following is the user interface in a [LINE] INPUT MENU:

8.19 KEY INPUT

FORMAT:


        KEY INPUT [[#channel] [, PROMPT str_expr] 
             [, TIMEOUT time_limit] 
             [, ELAPSED num_var] 
             :] var, [var,...] 

EXAMPLE:

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. 


Previous Next Contents Index