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 - menufindrc() scan the prompts for a screen location http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 menufindrc()        Scan the prompts for a screen location
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   func uint menufindrc extern
   param value _MENU pMenu, ;
         value uint  uRow, ;
         value uint  uCol

 Arguments
   pMenu is the pointer to a previously created menu system. If 0, the
         default menu will be used.
   uRow  is the screen row.
   uCol  is the screen column.

 Return
   A uint indicating the result of the scan:

       0 - if no match was found, or an invalid menu pointer was passed
     > 0 - the id of the matching prompt

 Description
   Starting with the first prompt, the function scans through all active
   items until an item is found that occupies the screen location passed
   in the uRow and uCol arguments.

   Note that this function does not consider any eventually defined menu
   position offsets. In this case, the cRow, and uCol arguments must be
   adjusted before calling the menufindrc() function.

   The function does not redisplay prompts in case of a match, it is
   handy for mouse-controlled menu handlers.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   proc Test_menufindrc
   vardef
      _MENU pMenu
   enddef
   
   clear
   
   pMenu := menunew()
   
   menupromptnew( pMenu, 5, 5, " Cut   ", 1, .t., .t. )
   menupromptnew( pMenu, 6, 5, " Copy  ", 2, .t., .t. )
   menupromptnew( pMenu, 7, 5, " Paste ", 3, .t., .t. )
   menupromptnew( pMenu, 8, 5, " Quit  ", 4, .t., .t. )
   
   @ 10, 0
   ? menufindrc( pMenu, 6,  9 )   // Prints 2
   ? menufindrc( pMenu, 7,  4 )   // Prints 0
   ? menufindrc( pMenu, 7, 11 )   // Prints 3
   ? menufindrc( pMenu, 7, 12 )   // Prints 0
   ? menufindrc( pMenu, 3, 10 )   // Prints 0
   
   menuclear( pMenu )
   
   endproc

   proc main
   Test_menufindrc()
   endproc

See Also: menufindhot()

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