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

 

2 responses to “SP_IFMOUSEHD

  1. Pingback: SP Event Functions | Viva Clipper !

  2. Pingback: SP Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.