Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - <b>lite_menu()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LITE_MENU()

    LITE_MENU() provides an intriguing alternative to MENU TO... and
    ACHOICE(). It will highlight the trigger letter of each menu option.
    Not only that, but it will allow you to specify an alternate trigger
    letter for a menu option.

    Syntax

    LITE_MENU(<top>, <left>, <array>, [<confirm>]
              [, <unselected color>, <selected color>]
              [, <initial>] [, <title>] [, <triggercolor>] )

    Required Parameters

    <top> is an integer representing the topmost row of the menu box.

    <left> is an integer representing the leftmost column of the menu
    box.

    <array> is the name of the array containing your menu options.  Do
    not surround this by quotes.

    Optional Parameters

    <confirm> is a logical value that will determine whether or not you
    want LITE_MENU() to emulate MENU TO (i.e., trigger selection
    immediately upon pressing a letter). The default is confirmation on,
    which will force you to press Enter before selecting an option.  If
    you would prefer to emulate MENU TO, pass a logical False (.F.) as
    this parameter.

    <unselected color> is the color in which the unselected menu options
    will be drawn.  The default is white on blue.

    <selected color> is the color in which the selected menu options
    will be drawn.  The default is yellow on red.

    <initial> is a numeric expression that specifies the initial menu
    option to highlight.  The default is 1 (first element in <array>).

    <title> is a character string that will be centered on the top
    row of the menu box.  The default is no title.

    <triggercolor> is the color to use for highlighting the trigger
    letters.  If not passed, the trigger letters will be displayed in
    the high intensity version of the <unselected color>.

    Notes

    LITE_MENU() will draw your menu framed by a box.  The first letter,
    or any alternate trigger letter that you specify, will be displayed
    in the high intensity equivalent of the unselected color.  In the
    Clipper 5 version, you may override this behavior by passing the
    ninth parameter, <triggercolor> (see above).

    If you do not use the <triggercolor>, it makes no sense to use a
    high intensity color as your unselected color because you will then
    be unable to discern any difference in the trigger letters.

    As written, LITE_MENU() does not support all of the same keys as MENU
    TO or ACHOICE().  The keys that it does support are:

    Up Arrow - move up one option, or if at first option, jump to
               last option (thus effectively simulating SET WRAP ON)

    Down Arrow - move down one option, or if at last option, move
                 to first option

    Home - jump to first option

    End - jump to last option

    Enter - select highlighted option and exit

    Esc - exit and return zero

    Alternate Trigger Letters

    You can select a menu option by pressing the first letter, which
    will be highlighted.  However, you can also specify an alternate
    trigger letter by preceding the desired letter with a tilde ("~") in
    the array element.  See the following code fragment for a real-life
    example.

    Sample Usage

    *** Summer '87 syntax                        
    private marray[6]                            
    marray[1] = 'Data entry'      && trigger is D
    marray[2] = 'Reports'         && trigger is R
    marray[3] = 'Invoices'        && trigger is I
    marray[4] = 'Reindex ~Files'  && trigger is F
    marray[5] = 'Dumb ~Stuff'     && trigger is S
    marray[6] = 'Quit'            && trigger is Q
    lite_menu(5, 6, marray, .F.)                 

    // Clipper 5.0 syntax - note use of the color parameters
    // please compile and run this to see what happens      
    lite_menu(5, 6, { 'Data entry', 'Reports', 'Invoices', ;
              'Reindex ~Files', 'Dumb ~Stuff', 'Quit' } ,  ;
              .f., 'w/b', '+w/r', , 'Sample', 'n/bg')       

See Also: MENUH() MENUV() LITE_MENU2()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson