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 - menusetactive() set the active flag of a prompt http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 menusetactive()     Set the active flag of a prompt
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   func logical menusetactive extern
   param value _MENU   pMenu, ;
         value int     iId, ;
         value logical lActive, ;
         value logical lShow

 Arguments
   pMenu   is the pointer to a previously created menu system. If 0, the
           default menu will be used.
   iId     is the id number of the prompt.
   lActive is the new status of the active flag.
   lShow   controls if the prompt shall be re-displayed.

 Return
   A logical indicating the success of this function:

   .t. - The specified prompt could be set active/inactive.
   .f. - a) While de-activating the specified prompt, no other active prompt
            was found to become current.
         b) The passed menu pointer was invalid.
         c) The passed id was invalid.

 Description
   This function is used to set the active status of a prompt to the value
   passed in the lActive argument. In case the lShow argument is .t., the
   prompt will be re-displayed with the color attribute according to its
   new state.

   Special care must be taken in case that all available prompts in a
   menu become deactivated, as in this case none of the prompts is
   selectable any more.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   proc Test_menusetactive
   vardef
      _MENU pMenu
   enddef
   
   clear
   
   menusethot( .t. )
   pMenu := menunew()
   
   menupromptnew( pMenu, 2, 10, " Option 1 ", 1, .t., .t. )
   menupromptnew( pMenu, 3, 10, " Option 2 ", 2, .t., .t. )
   menupromptnew( pMenu, 4, 10, " Option 3 ", 3, .t., .t. )
   menupromptnew( pMenu, 5, 10, " Option 4 ", 4, .t., .t. )
   
   menusetactive( pMenu, 3, .f., .t. ) // inactivate and redisplay
   
   @ 10, 0
   ? menuisactive( pMenu, 1 )   // Prints .T.
   ? menuisactive( pMenu, 2 )   // Prints .T.
   ? menuisactive( pMenu, 3 )   // Prints .F.
   ? menuisactive( pMenu, 4 )   // Prints .T.
   
   menuclear( pMenu )
   
   endproc

   proc main
   Test_menusetactive()
   endproc

See Also: menuisactive() menusetcurrent()

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