Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>menu to pseudo-function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  MENU TO                                                     Pseudo-Function
 Purpose..: Replace the Clipper MENU...TO command
-------------------------------------------------------------------------------
 Syntax...: MENU TO <nPos> [ESCAPE REGION <aExitRegion[1]>, ;
                                          <aExitRegion[2]>, ;
                                          <aExitRegion[3]>, ;
                                          <aExitRegion[4]>] ;
                           [EXITKEYS <aExitKeys>]           ;
                           [IN WINDOW]

 Arguments: <nPos>             = menu item to highlight initially.

            [<aExitRegion>]    = array of co-ordinates which
                                 serves as a hot area for exit.

            [<aExitKeys>]      = array of exit keys which
                                 allows you to define additional keys
                                 to exit to menu.

 Returns..: nPos is the menu item chosen.

 Remark...: The function, MsMenuTo(), is used in a manner
            similar to MsAtPrompt() which replaces the @...PROMPT
            command. The latter displays the light-bar menu system.
            Then the light-bar menu is invoked with the use of the
            command, MsMenuTo().  MsMenuTo() navigates
            the current list of menu items in the order they were defined.
            If defined, it will start elsewhere like MENU..TO.

            In addition to using the arrow keys, the Tab key
            is active for moving about the menu.

            This function has integrated mouse support.

 Source...: FW_MENU.CH
-------------------------------------------------------------------------------
 Example..: . The example sets up an array of prompts
              and displays them in traditional menu fashion.

                . The example still needs a do case...endcase.

   local aPrompt := { { " New York      " , ;
                        " Los Angeles   " , ;
                        " Tucson        " , ;
                        " New Orleans   " , ;
                        " San Francisco " , ;
                        " Kapuskasing   " , ;
                        " Vancouver     " , ;
                        " London        " },;
                        { 6,6,2,2,6,2,2,2 } }

   while !empty( nPick )

      // Create achoice() window to pick a city
      wOpen ( "MenuWin" )

      for n = 1 to len( aPrompt[1] )
         @  wRow( ,n-1 ), wCol( ,0 ) PROMPT   aPrompt[1][n];
                                     COLOR    "W+/*B,W+/R" ;
                                     HOTKEY   aPrompt[2][n];
                                     HOTCOLOR "GR+/B*,GR+/R"
      next

      MENU TO nPick IN WINDOW

      wClose( "MenuWin" )

See Also: @...PROMPT

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