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 - mousecurstype() define mouse cursor type http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 mousecurstype()     Define mouse cursor type
------------------------------------------------------------------------------
 Declaration
   mouse.hdr

 Syntax
   proc mousecurstype extern
   param value logical lCursorType, ;
         value uint    uScreenMask, ;
         value uint    uCursorMask

 Arguments
   lCursorType is the mouse cursor type to be defined.
   uScreenMask is a screen mask value.
   uCursorMask is a cursor mask value.

 Return
   None.

 Description
   This procedure can be used to define the type of the mouse cursor; it can
   be either a hardware cursor or a software cursor.

   mouse.hdr contains the following #defines for lCursorType:

   #define MC_HARDWARE .t.
   #define MC_SOFTWARE .f.

   Depending on the lCursorType value, the two other parameters have
   different meanings:

   Hardware cursor:

   This is a block cursor (similar to the normal text cursor). Its shape
   is defined by the two parameters as follows:

   uCursorMask: first scan line (top of cursor)
   uScreenMask: last scan line (bottom of cursor)

   Software-cursor:

   This cursor type adds enhanced functionality. You can define the color
   attribute and the cursor character.

   When the software cursor is positioned on the screen, the cursor and the
   original screen position will be combined in two steps:

   An AND operation will be performed on the character code and the screen
   attribute with uScreenMask. This result will then XORed with uCursorMask.

   Some possibilities to modify the appearence of the mouse cursor include:

   - Display the mouse cursor, always using the same color attribute and a
     specific charater.

   - Always use the same character for the mouse cursor, but use the
     background attribute.

   - Do not modify the character under the cursor, but display a specified
     color attribute.

 Example
   #define EXAMPLE_MOUSE
   #include example.hdr

   proc Test_mousecurstype
   if mouseavail()
      ? "Press left mouse button to proceed"
      // define a software cursor: caret on inverse background
      mouseon()
      mousecurstype( MC_SOFTWARE, 0x774F, 0x7704 )
      mousebuttwpress( MB_LEFT )
      // define a software cursor: display the original character in inverse
      mousecurstype( MC_SOFTWARE, 0x77ff, 0x7700 )
      delay( 2 )
      mousebuttwpress( MB_LEFT )
      mouseoff()
   else
      ? "Mouse is not available"
   endif
   endproc

   proc main
   Test_mousecurstype()
   endproc

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