SP Event Functions

 RAT_EVENT()    Event handler - inkey() with mouse awareness
 RAT_ERBHD()    Determines if right mouse button is held down
 RAT_ISMOUSE()  Determines mouse usage by RAT_EVENT()
 RAT_ELBHD()    Determines if left mouse button is held down
 RAT_EQMCOL()   Returns mouse column at last press
 RAT_EQMROW()   Returns mouse row at last press
 IFMOUSEHD()    Checks if mouse held down,evals codeblock while it is
 ISMOUSEAT()    Checks for mouse click within passed coordinates
 MBRZCLICK()    Checks for mouse click on current Tbrowse row/col
 MBRZMOVE()     Checks for mouse click at and moves to Tbrowse row/col
 MOUSEHOTAT()   Checks for mouse click from array of hot coordinates
 RAT_LASTEV()   Returns the last event recorded by RAT_EVENT()
 R_ISRATREAD()  Determines if RAT_READ() is current get system

 

SP_MBRZMOVE

MBRZMOVE()

  Short:
  ------
  MBRZMOVE() Checks for mouse click at and moves to Tbrowse row/col

  Returns:
  --------
  <lClicked> => If the mouse clicked on a new Tbrowse Row/Column.

  Syntax:
  -------
  MBRZMOVE(oTBrowse, nMouseRow, nMouseCol,[nTop,nLeft,nBottom,nRight])

  Description:
  ------------
  Determines if the mouse coordinates <nMouseRow> and <nMouseCol>
  are on a new Tbrowse row/column, and causes the Tbrowse cursor to
  move there.

  [nTop,nLeft,nBottom,nRight] determine the Tbrowse 'live' area - the
  area exclusive of headers, footers, seperators etc. MBRZMOVE() can
  determine this on its own, but it is much faster to pass these
  coordinates if you can.

  Examples:
  ---------
  from MCHOICE():

   case nLastKey == K_MOUSELEFT
     do case
     case ISMOUSEAT(nMouseR, nMouseC, nBottom,nRight-3, nBottom, nRight-2)
        oTb:down()
        IFMOUSEHD({||oTb:down()},oTb)
     case MBRZMOVE(oTb,nMouseR, nMouseC,nTop+1,nLeft+1,nBottom-1,nRight-1)
        keyboard chr(K_ENTER)
     case MBRZMOVE(oTb,nMouseR, nMouseC)
        EXIT
     endcase
   endcase

  Source:
  -------
  S_MOOSE.PRG

 

SP_MBRZCLICK

MBRZCLICK()

  Short:
  ------
  MBRZCLICK() Checks for mouse click on current Tbrowse row/col

  Returns:
  --------
  <lClicked> => if the mouse clicked on the current Tbrowse cursor row and
                column.

  Syntax:
  -------
  MBRZCLICK(oTBrowse, nMouseRow, nMouseCol)

  Description:
  ------------
  Determines if the mouse coordinates <nMouseRow> and <nMouseCol>
  are within the area of the current Tbrowse row and column.

  Examples:
  ---------
  from MCHOICE():

   case nLastKey == K_MOUSELEFT
         do case
         case ISMOUSEAT(nMouseR, nMouseC, nBottom,nRight-3, nBottom, nRight-2)
            oTb:down()
            IFMOUSEHD({||oTb:down()},oTb)
         case MBRZMOVE(oTb,nMouseR, nMouseC,nTop+1,nLeft+1,nBottom-1,nRight-1)
            keyboard chr(K_ENTER)
         case MBRZCLICK(oTb,nMouseR, nMouseC)   //<-----here
            EXIT
         endcase
   endcase

  Source:
  -------
  S_MOOSE.PRG

 

SP_ISMOUSEAT

ISMOUSEAT()

  Short:
  ------
  ISMOUSEAT() Checks for mouse click within passed coordinates

  Returns:
  --------
  <lClicked> => true if mouse click occured within the passed
                coordinates

  Syntax:
  -------
  ISMOUSEAT(nMouseRow, nMouseCol, nTop,nLeft,nBottom,nRight)

  Description:
  ------------
  Checks <nMouseRow>, <nMouseCol> against the coordinates
  <nTop>, <nLeft>,<nBottom>,<nRight> and returns True if the
  mouse row and col are within the screen coordinates.

  Examples:
  ---------

  case ISMOUSEAT(nMouseR, nMouseC, nBot+2, nLeft, nBot+2, nLeft+2)
     oTb:up()

  Source:
  -------
  S_MOOSE.PRG

 

SP_IFMOUSEHD

IFMOUSEHD()

  Short:
  ------
  IFMOUSEHD() Checks if mouse held down,evals codeblock while it is

  Returns:
  --------
  NIL

  Syntax:
  -------
  IFMOUSEHD(bBlock, [oTbrowse])

  Description:
  ------------
  You'll often want to hold the left mouse button down on a hot object
  in order to cause an action to repeat rapidly over and over. An
  example would be on an up or down arrow that caused a tbrowse object
  to go up or down. Rather than go click-release-click-release-click..etc,
  you prefer to just hold the mouse down.

  If you detect the mouse has been pressed and you then want to check
  if its held down and perform an action repetetively while it is,
  you can use this function.

  <bBlock> is the code block to be evaluated continuously while the mouse
  is held down. (there is a .01 second delay between iterations).

  [oTbrowse] is an optional Tbrowse object that you wish to be refreshed
  during the evaluation of the block. (otherwise, you could hold the mouse
  button down continuously and not se anything happen. You could have
  your codeblock refresh the Tbrowse, of course. Its just easier this
  way.

  Examples:
  ---------
  // this code is taken from SMALLS(), our lookup table popup

  case ISMOUSEAT(nMouseR, nMouseC, nBot+2, nLeft, nBot+2, nLeft+2)
      oTb:up()
      IFMOUSEHD({||oTb:up()},oTb)
  case ISMOUSEAT(nMouseR, nMouseC, nBot+2, nLeft+3, nBot+2, nLeft+5)
      oTb:down()
      IFMOUSEHD({||oTb:down()},oTb)

  Source:
  -------
  S_MOOSE.PRG