SP_YNREADER

YNREADER()

  Short:
  ------
  YNREADER() Creates specialized Yes/No get reader block

  Returns:
  --------
  <bReader> => get reader block for logical GET

  Syntax:
  -------
  YNREADER()

  Description:
  ------------
  Creates a reader block that pops up a Yes/No window
  to get the logical value for the current get.

  Implement by using the SEND keyword for your
  @Say..Get.. statements.

  i.e. @10,10 say blah get blahblah SEND reader:=YNREADER()

  Use this on a LOGICAL get only.

  Examples:
  ---------
   // while in the get V1, a Yes/No window pops up for
  logical selection

   v1 := .f.

   @10,10 get v1 send reader := ynreader()

   READ

  Source:
  -------
  S_READRS.PRG

SP_SBREADER

SBREADER()

  Short:
  ------
  SBREADER() Creates specialized spacebar spinner get reader
  block

  Returns:
  --------
  <bReader> => get reader block for GET

  Syntax:
  -------
  SBREADER(aValues)

  Description:
  ------------
  Creates a get reader block that allows space bar to
  rotate values from an array into the current get.

  Implement by using the SEND keyword for your
  @Say..Get.. statements.

  i.e. @10,10 say blah get blahblah SEND ;
                      reader:=SBREADER(aValues)

  <aValues> is an array of values that are of the same
  type and length as the GET.

  Examples:
  ---------
   // while in the get V1, you will be able to use the spacebar to
   // rotate values from the array

   aValues := {"Section 1","Section 2","Section 3"}
   v1 := "Section 1"
   @10,10 get v1 send reader := sbreader(aValues)
   READ

  Source:
  -------
  S_READRS.PRG

 

SP_RRLASTKEY

RRLASTKEY()

  Short:
  ------
  RRLASTKEY()  Retrieve the last key handled by ratapplykey()

  Returns:
  --------
  <nLastKey> => last key handled by ratapplykey()

  Syntax:
  -------
  RRLASTKEY()

  Description:
  ------------
  Returns the last key - including pseudo keys - handled by
  RatApplyKey().

  The [nRmKey]  and [aLmKeys] parameters of RAT_READ() allow
  emulation of keypresses. The [nRmKey] determines what key is
  emulated when the right mouse button is pressed. The [aLmKeys]
  array contains key emulations to be used for a set of screen
  hot areas for left mouse button clicks. In both cases, the
  ascii key code is passed to RatApplyKey() to handle. However,
  the keys ARE NOT STUFFED INTO THE KEYBOARD, and thus are not
  retrievable through LASTKEY(). The reason, by the way, that they
  are not stuffed into the keyboard, is that some keys cannot be
  stuffed with the KEYBOARD command  ( i.e. ALT-F10 or -39 )

  After a number of requests to be able to tell what key was
  pressed last when exiting a read, even when it is an interpreted
  key based on a mouse click, I've added this function. It will return
  the last key handled by RatApplyKey(), even if the key is based on
  a mouse click. If the last event is a mouse event that does not
  translate into a key value, it will return either K_MOUSELEFT for left
  mouse click, or K_MOUSERIGHT for right mouse click.

  Examples:
  ---------
  RAT_READ(getlist,...)
  if RRLASTKEY()==27
    * escape was pressed or mouse right button was pressed

  endif

  Notes:
  -------

  Source:
  -------
  S_RREAD.PRG

See also : RAT_READ()

 

SP_RRJUMP2

RRJUMP2()

  Short:
  ------
  RRJUMP2()  Jump to a new get in a RAT_READ()

  Returns:
  --------
  NIL

  Syntax:
  -------
  RRJUMP2(nNew)

  Description:
  ------------
  While in a RAT_READ(), causes the jump flag to be set to <nNew>, and
  and the current get's exitstate variable to be set to GE_ENTER. This
  causes an exit from the current get, and a jump to get <nNew>.

  Examples:
  ---------
   // in this example, pressing or clicking F3 causes a jump to
   // get # 1, while pressing or clicking F4 causes a jump to
   // get # 5.

   #include "inkey.ch"

   v1 := space(10)
   v2 := space(10)
   v3 := space(10)
   v4 := space(10)
   v5 := space(10)

   setkey(K_F4,{||rrjump2(5)} )
   setkey(K_F3,{||rrjump2(1)} )

   @24,0 say "[F3-Go to First Get]  [F4-Go to Last Get]"

   ahot := {{24,0,24,20,K_F3},{24,23,24,41,K_F4} }

   @10,10 get v1
   @11,10 get v2
   @12,10 get v3
   @13,10 get v4
   @14,10 get v5

   RAT_READ(getlist,1,.T.,27,nil,aHot)

  Notes:
  -------

  Source:
  -------
  S_RREAD.PRG

See also : RAT_READ()

SP_RAT_READ

RAT_READ()

  Short:
  ------
  RAT_READ() Mouseable read

  Returns:
  --------
  Nil

  Syntax:
  -------
  RAT_READ(aGetlist,[nStart],[lWrap],[nRmKey],[bLmouse],[aLmKeys])

  Description:
  ------------
  Set up your gets as normal, with @SAY...GET
  statements.

  The only limitation is that you cannot use a
  user-defined READER block, as RAT_READ() installs a
  user-defined reader block for each get.

  After setting up your @SAY...GET statements, instead
  of issuing a READ, issue a RAT_READ(getlist,...).

  [nStart] is an optional starting get number, which
  defaults to 1.

  [lWrap] determines if going past top or bottom get
  exits the read. Default is True. By sending false, going past top
  will put you at bottom, and going past bottom will put you at top,
  with only CTRL-W exiting the read.

  [nRmKey] is an inkey value that tells RAT_READ() how
  it should interpret a right mouse button click. Default is ESCAPE.

  [bLmouse] (new in 3.5) is a codeblock that is evaluated when there
  is a mouse click and it is not meaningful to RAT_READ().
  It is evaluated as :  eval(bLMouse,mouserow, mousecolumn)

  [aLmKeys] is an array of hot mouse coordinate sub-arrays and their
  key equivalents. For instance, if you have the following for hot
  keys: @24,0 say "[F10=save] [ESC=Cancel]", and you wanted these as
  hot mouse areas, the array would be:
        {   {24,0,24,9,K_F10},  {24,11,24,22,K_ESC}   }
  Clicking the mouse within 24,0,24,9 would be interpreted as pressing
  the F10 key.
  The structure of each sub-array is {nTop,nLeft,nBottom,nRight,nKeyValue}

  Examples:
  ---------
   v1 := space(10)
   v2 := space(10)
   v3 := space(10)
   @10,10 get v1
   @11,10 get v2
   @12,10 get v3

   RAT_READ(getlist,2,.T.,27)

   // read, starting at get # 2, wrapping, and interpreting the right
   // mouse button as chr(27) (escape).

  Notes:
  -------
  This does not replace GETSYS.PRG, but rather parallels it.

  The Clipper GET system, contained in GetSys.Prg and accessed via
  READ contains several exported functions which obtain /handle
  information about the current GET and the current READ.

  In order to implement mouse-aware reads, a modification of
  GetSys.Prg was needed. However....

  I didn't want SuperLib to replace the Clipper Get system
  willy-nilly, as that would presume that you always wanted
  to use _only_ the SuperLib version. So I had to rename all
  of the exported functions in the SuperLib mouseable get
  system. The names are as follows:

   Clipper Get System    SuperLib GetSystem
   ------------------    ------------------
   ReadModal()           Rat_Read()
   GetReader()           RatReader()
   GetApplyKey()         RatApplyKey()
   GetDoSetKey()         RatDoSetKey()
   GetPostValidate()     RatPostValidate()
   GetPreValidate()      RatPreValidate()
   GetActive()           RatActive() ---or--- GetActive()
   ReadKill()            RatKill()
   ReadUpdated()         RatSetUpdated()
   Updated()             RatUpdated()

  So you can call either READ or READMODAL() which accesses the
  Clipper Get System, or call RAT_READ(), which access the
  SuperLib mouseable get system, and they will not tromp on
  one another.

  There still remained one problem, however. Some of the SuperLib
  functions access the above named exported functions, such as
  GetActive(), and of course user-defined get readers need to
  access GetPostValidate(), GetPreValidate(), GetApplyKey() and
  GetDoSetKey(), and possibly others.

  By calling R_ISRATREAD(), you can determine if the current
  read is a RAT_READ or not, and call the regular exported
  read/get functions, or call their equivalent RAT* functions
  as listed above.

  An exception is GETACTIVE(), which may be called while using
  either get system, as RAT_READ() calls GETACTIVE() to update
  the current get, and also saves and restores the active get
  in case there is a prior READ active.

  This R_ISRATREAD() function returns TRUE/FALSE for 'is the current
  read a RAT_READ or a READMODAL (normal) read'. Essentially it tells
  you which GetSystem you are in.

  Thus you can have both RAT_READ() mouse aware reads, and standard
  READMODAL() Clipper reads in the same system, and tell the
  difference between the two.

  User defined readers attached to GETS passed to RAT_READ can
  return a numeric value indicating which get to jump to.

  Source:
  -------
  S_RREAD.PRG

See Also : RAT_ELBHD(), RAT_EQMCOL(), RAT_EQMROW(), RAT_ERBHD(), RAT_EVENT(), 
           RAT_ISMOUSE(), RAT_LASTEV(), RAT_MENU2(), RAT_READ()

SP_POPREAD

()

  Short:
  ------
  POPREAD() Pops up a box with 1-5 say-get combinations

  Returns:
  --------
  nothing

  Syntax:
  -------
  POPREAD(lStacked,[nTop,nLeft,cColor],cSay,@expGet,cPicture...)

  Description:
  ------------
  [lStacked]   .t. = GETS are displayed below SAYS,
               .f. = GETS are displayed beside SAYS (default)

  [next 3 params may be option params - see below]

  For 1-5 iterations of  [cSay,@expGet,cPicture]  a
  popup window will display a Say <cSay>, do a Get on the variable
  passed by reference in <@expGet> with a Picture of <cPicture>. A
  read will then be issued.

  If params 2,3 and 4 are passed as Numeric/Numeric/Chr
  then they are evaluated as the top,left and color for the popup
  box.

  [nTop] = top
  [nLeft] = left
  [cColor] = color string

  Examples:
  ---------
   dDate := date()
   cTime := space(8)
   lFun  := .t.

   POPREAD(.t.,"Current Date",@dDATE,"@D",;
       "Current Time",@cTIME,"99:99:99",;
       "Having Fun ?",@lFUN,"Y")

  Notes:
  -------
  This is an intelligent version of ONE_READ. 2nd param
  is passed by reference rather than by name - cutting down
  DRASTICALLY on the macro expansion and greatly simplifying the
  code. To pass by reference, preface the parameter with @.

  Source:
  -------
  S_POPR.PRG

 

 

SP_GENREADER

GENREADER()

  Short:
  ------
  GENREADER() Creates specialized user defined get reader block

  Returns:
  --------
  <bReader> => get reader block for GET

  Syntax:
  -------
  GENREADER(bBlock,lPass)

  Description:
  ------------
  Creates a get reader block that first passes control
  to code block <bBlock> for each keypress. <bBlock> is passed
  the following values:

       1. lastkey() value
       2. proc name
       3. var name
       4. current get value

  If <bBlock> returns any value but a Nil, the get is
  assigned this value. If a Nil is returned, and <lPass> is True,
  then the key is passed to the regular get handler.

  Implement by using the SEND keyword for your
  @Say..Get.. statements.

    @10,10 say blah get blahblah SEND reader:=GENREADER(bBlock,lPass)

  Or simply refer to the last get added with ATAIL(getlist)

    @10,10 say blah get blahlblah
    ATAIL(getlist):reader := GENREADER(bBlock,lPass)

  Examples:
  ---------
   // while in the get V1, you will be able to type 1, 2 or 3
   // to get a value from the array

   aValues := {"Section 1","Section 2","Section 3"}
   bBlock  := ;
        {  | k|  iif( (nAtk:=at(chr(k),"123")) >  0,aValues[nAtk],nil)  }

   v1 := "Section 1"
   @10,10 get v1 send reader := genreader(bBlock)
   READ

  Source:
  -------
  S_READRS.PRG