Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - restoremenu() restore a saved menu http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 restoremenu()       Restore a saved menu
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   proc restoremenu extern
   param value _MENU pMenu

 Arguments
   pMenu is a saved menu object returned from savemenu().

 Return
   None.

 Description
   This procedure restores a menu saved by the savemenu() function.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   // Save a menu prior to initiating another menu.
   
   vardef
      _MENU pMenu
      uint  uSel
   enddef
   
   proc ExitConfirm
   pMenu := savemenu()
   @ 3, 20 prompt "Resume"
   @ 4, 20 prompt "Quit"
   menu to uSel
   if uSel == 1
      restoremenu( pMenu )
      @ 3, 20 clear to 4, 40
   else
      quit
   endif
   endproc
   
   proc Test_restoremenu
   vardef
      uint uChoice
   enddef
   clear
   cursor( .f. )
   @ 1,  0 prompt "Add"
   @ 1, 10 prompt "Edit"
   @ 1, 20 prompt "Quit"
   uChoice := 0
   do while .t.
      wait
      menu to uChoice save
      wait
      do case
      case uChoice == 1
         @ 10, 0 ?? uChoice
      case uChoice == 2
         @ 10, 0 ?? uChoice
      case uChoice == 3
         ExitConfirm()
      endcase
   enddo
   endproc

   proc main
   Test_restoremenu()
   endproc

See Also: menu to prompt savemenu()

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