FT_MENU2

FT_MENU2()
 Vertical lightbar menu

 Syntax

      FT_MENU2( <aMenuarray> [, <cColors> ] ) -> NIL

 Arguments

     <aMenuarray> is an array of menu options, messages, and action
      blocks.

     Each element in this array is a nested array with the structure:

        element[x, 1] = menu option
        element[x, 2] = message to be displayed when option is highlighted
        element[x, 3] = code block to be executed when option is selected

     <cColors> is a string containing colors for the prompts, in the same
     format as that returned by Set( _SET_COLOR ).  If not supplied,
     colors default to the current color setting.

 Returns

     NIL

 Description

     This function greatly simplifies the process of displaying light-bar
     menus.  All prompts are padded out with spaces so they are the same
     length, a box is drawn around the prompts, the box is automatically
     centered on the screen, and the underlying screen is restored after
     a menu selection has been made.

     Additionally, because you can tie action blocks to each menu
     option, you can save on a lot of DO CASE or IF..ELSEIF code in your
     main program.  See the test code for a succinct demonstration.

 Examples

      LOCAL mainmenu := ;
          { { "Data Entry", "Enter data",   { || FT_MENU2(datamenu)  } }, ;
            { "Reports",    "Hard copy",    { || FT_MENU2(repmenu)   } }, ;
            { "Maintenance","Reindex files",{ || FT_MENU2(maintmenu) } }, ;
            { "Quit", "See ya later" } }
      FT_MENU2(mainmenu)

 Source: VERTMENU.PRG

 Author: Greg Lief

 

One response to “FT_MENU2

  1. Pingback: FT Menus – Prompts – Messages | Viva Clipper !

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.