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 - mouseinarea() determine if the mouse is within an area http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 mouseinarea()       Determine if the mouse is within an area
------------------------------------------------------------------------------
 Declaration
   mouse.hdr

 Syntax
   func logical mouseinarea extern
   param value uint uTop, ;
         value uint uLeft, ;
         value uint uBottom, ;
         value uint uRight

 Arguments
   uTop is the top row of the mouse area.
   uLeft is the leftmost column of the mouse area.
   uBottom is the bottom row of the mouse area.
   uRight is the rightmost column of the mouse area.

 Return
   A logical indicating if the mouse cursor is located within the
   given screen area.

 Description
   This function returns .t. if the mouse cursor is located within the
   specified screen area at the time of the function call.

 Example
   #define EXAMPLE_MOUSE
   #include example.hdr

   proc Test_mouseinarea
   vardef
      uint uButt
   enddef
   if mouseavail()
      clear
      cursor( .f. )
      @ 5, 10 to 10, 20
      @ 7, 11 ?? "Come here"
      mouseon()
      do while .t.
         if mouseinarea( 6, 11, 9, 19 )
            mouseoff()
            @ 7, 11 ?? "Gotcha!!!"
            mouseon()
            mousedefarea( 6, 11, 9, 19 )
            mousebuttwpress( MB_LEFT )
            mouseoff()
            exit
         endif
      enddo
   else
      ? "Mouse is not available"
   endif
   endproc

   proc main
   Test_mouseinarea()
   endproc

See Also: mousedefarea()

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