SP Popup Functions

 TAGMARRAY()    Tag elements in muti-dimensioned array
 STAGFIELDS()   Tag fields
 UNBOX()        Removes a box created by makebox()
 SPOPORDER()    Popup allows user to change viewing (index) order
 SPOPSEEK()     Popup seek based on present index keys
 VIEWMEMOS()    Popup viewing (non-edit mode) of memos
 VERTVIEW()     Pops up a vertical view of the current record
 TAGARRAY()     Tag selected elements of an array
 SGETMANY()     Virtual (scrolling) gets in a popup box
 AMSG()         Pop up message box for an array of messages
 POPUPDIR()     Popup of a given directory for file selection
 POPREAD()      Pops up a box with 1-5 say-get combinations
 POPVDATE()     Pops up a picklist of virtual dates
 POPEX()        Pops up an achoice for a certain filespec
 POPMONTH()     Popup month selection
 POPCOLSEL()    Popup color grid for selecting a single color
 PROGINDEX()    Perform an index with a progress box
 PROGEVAL()     Perform a Database DBEVAL() with a progress box
 POPVYEAR()     Pops up a picklist of virtual years
 PROGCOUNT()    Perform a count with a progress box
 PROGDISP()     Displays progress bar in box created with PROGON()
 PROGOFF()      Removes a progress bar box created by PROGON()
 MESSYN()       Popup YesNo prompt box
 MCHOICE()      Creates a box for an Achoice call
 MFIELDS()      Pops up an selection box for current dbf fields
 GETDATE()      Point and shoot calendar
 MAKEBOX()      Draws a box on the screen with optional shadow,
                returns saved screen
 PLSWAIT()      Pops up a 'Please Wait' window or removes it
 ONE_READ()     Pop-up window with 1-4 Say/Get combinations
 MULTMSGYN()    Multi-line popup message - yes -no
 MFIELDSTYPE()  Pops up a list of fields of given type(s)
 MSG()          Displays up to a 9 line message in a window
 HARDCOPY()     Prints current record or memo fields to printer
 EDITMEMO()     Performs a windowed memoedit() on a memo field
 ASCIITABLE()   Pops up an ASCII table for character selection
 DELREC()       Dialog box to delete/undelete current record
 EDITMEMOV()    Performs a windowed memoedit() on a string
 BROWSE2D()     Popup tbrowse of 2 dimension array (array of arrays)
 SBUNSHADOW()   Removes shadow drawn with SBSHADOW()
 ABORT()        Pops up dialog box asking: Abort  Don't Abort
 SBSHADOW()     Draw a shadow around a box
 PROGON()       Initialize and display a progress bar box
 QUIKREPORT()   Runtime pre-defined report printing module
 P_READY()      Determines if printer is ready, prompts user
 SACHOICE()     Achoice replacement, uses TBROWSE, accepts exception
                codeblock
 S1LABEL()      Prints a single label
 GETCALC()      Pops up a quick 'solar' calculator

 

SP_SACHOICE

SACHOICE()

  Short:
  ------
  SACHOICE() Achoice replacement, uses TBROWSE, codeblock

  Returns:
  --------
  <nSelection> => selection, 0 if none

  Syntax:
  -------
  SACHOICE(nTop,nLeft,nBottom,nRight,aOptions,[bKeyBlock],[nStart],[@nRow],;
           [nMRow, nMCol],[bMouse])

  Description:
  ------------
  This semi-replaces ACHOICE() by using TBROWSE
  instead, and by accepting an exception codeblock instead of a user
  defined function.

  <nTop,nLeft,nBottom,nRight> are the dimensions.

  <aOptions> is the array. It need not be of type
  Character.

  First-letter presses go to the next matching letter
  of the next character-type element.
  Up/down/home/end/pageup/pagedown are used to position the
  cursor. ENTER returns the current selection. Escape returns 0.

  The screen is not saved and restored. This is a
  building block function, like ACHOICE(), so save and restore the
  screen, draw a box around it, etc, as you would ACHOICE().

  [bKeyBlock] a codeblock which will be executed if an
  exception key is received (any key not otherwise meaningful). The
  codeblock will be evaluated and will be passed:

           1. current element #
           2. exception key value
           3. the tbrowse object

  as parameters.

  [nStart] is an optional starting element. Default is 1.
  [@nRow] is an optional starting row. Default is 1. Pass by reference
  to retain value between calls.

  [nMRow, nMCol]  (new in 3.5) Directs sachoice() to draw
  the "[.][.]" for mouse up/down at nMrow, nMCol, and to be aware of mouse
  clicks on these buttons. (the screen under the arrows is saved/restored)

  [bMouse] is a codeblock to evaluate mouse clicks other than those
  meaningful to sachoice(). The codeblock is evaluated as follows:
            eval(bMouse,mouserow, mousecolumn)

  Examples:
  ---------
   USE CUSTOMER

   aFlds       := afieldsx()
   bExcept     := {|e,k|msg("You pressed ",str(k))}
   ?SACHOICE(10,10,20,12,aFlds,bExcept)

   //to retain element and position between calls
   nSelect := 1
   nRow    := 1
   aMeals   := {"Pizza","Chicken","Chinese"}
   while nSelect > 0
     nSelect  := sachoice(10,10,20,20,aMeals,nil,nSelect,@nRow)
     // code
   endif

  Notes:
  -------
  This will be a lot easier to mouse-ize than ACHOICE.
  (or is that RAT-ify..)

  Source:
  -------
  S_ACHOI.PRG