SP Menu Functions

SLOTUSMENU()   1-2-3 style menu
PULLDN()       Pulldown menu creator, handler
PSTABMENU()    Popup tabular (grid style) )menu
RAT_MENU2()    Mouseable MENU TO emulation
STABMENU()     Tabular (grid style) menu
MENU_V()       Vertical popup menu from variable # parameters
BUNGDROP()     Causes dropdown during BUNGEE() menu def sequence
BUNGEE()       Mouseable, multi-level dropdown menu with triggers
BUNGEND()      Ends a BUNGEE() menu array definition sequence
BUNGOPTION()   Adds option during a BUNGEE() menu definition sequence
BUNGSTART()    Starts a BUNGEE() menu array definition sequence
BUNGUNDROP()   Ends dropdown during BUNGEE() menu def sequence




  SLOTUSMENU() 1-2-3 style menu

  <expReturn> => depends on several factors


  Draws a 1-2-3 style menu from <nTop>,<nLeft> to

  <nTop> is the menu option line. <nTop+1> is the
  message line.

  <aOptions> is an array of arrays in the format:

  {  {cOption,cMessage,expAction},
  {cOption,cMessage,expAction},... }

  where <cOption> is the option prompt, <cMessage> is
  the option message, and <expAction> is the option action.

  <expAction> may be of three types:

      1.    a codeblock, in which case it is executed on

      2.    a submenu array of the form:

         {  {cOption,cMessage,expAction},  ;
             {cOption,cMessage,expAction},... }
            which is displayed on ENTER. Pressing ESCAPE
            from the submenu returns to the prior menu.

            The submenu <expaction> may be a codeblock,
            another subarray, or any other value, etc.
            Thus nesting can go as deep as you like.

      3.    any other value, which is returned to the
            calling program on ENTER.

  Pressing ESCAPE from the main menu returns 0

  [lBox]  If True, the menu is drawn inside of a popup
  box. Actual dimensions of the menu area then become
  <nTop>+1,<nLeft>+1 to <nTop>+2,<nRight>-1. Default is False - no box.

  [lSaveRest] If True, the underlying screen is saved
  and restored on entrance/exit. Default is False - no restore.

  [lReset] If True, the menu is reset to first option
  on exit. Default is False - menu remembers where it was.

  SLOTUSCLEAR() resets the menu.


   proc test
   local nReturn := 0
   local aMain := {}
   local aSub1 := {{"Pizza",     "Eat Pizza", {||pizza()}},;
                   {"Spaghetti", "Eat Spaghetti", {||spagett()}},;
                   {"Tortellini","Eat Tortellini", {||tortellini()}} }

   local aSub2 := {{"Steak",     "Eat Steak", {||steak()}},;
                   {"Hamburger", "Eat Hamburger",  {||burgers()}},;
                   {"Chili Dog", "Eat Chili Dog",  {||burntwice()}}  }

   aadd(aMain,{"Italian","Eat Italian food",aSub1})
   aadd(aMain,{"American","Eat American food",aSub2})
   aadd(aMain,{"Quit","Just not hungry - Quit",0})
   aadd(aMain,{"Relief","Already ate - need Alka Seltzer",{||alka()} })


   SLOTUSCLEAR()  // !! always use this to clear the menu


  Always use SLOTUSCLEAR() after calling SLOTUSMENU()