SP_SBCOLS

SBCOLS()

  Short:
  ------
  SBCOLS() Determine number of columns in a box

  Returns:
  --------
  <nCols> => columns in the box

  Syntax:
  -------
  SBCOLS(nLeft,nRight,[lIncludeFrame])

  Description:
  ------------
  The number of columns of a box with left of <nLeft>
  and right of <nRight> is returned. By default, the frame is
  included (the left and the right)

  [lIncludeFrame] by default is True - and all columns
  are counted. If passed as False, only the inside columns are
  counted.

  Examples:
  ---------
   // this example fills a box with "X"'s

   nRows := SBROWS(nTop,nBottom,.f.)
   nCols := SBCOLS(nLeft,nRight,.f.)
   for i = nTop to nRows
     @nTop+i,nLeft say repl("X",nCols)
   next

  Source:
  -------
  S_BOXES.PRG

 

SP_SBCENTER

SBCENTER()

  Short:
  ------
  SBCENTER() Centers box coordinates

  Returns:
  --------
  Nil

  Syntax:
  -------
  SBCENTER(@nTop,@nLeft,@nBottom,@nRight)

  Description:
  ------------
  Dimensions nTop,nLeft,nBottom,nRight are passed by
  reference.

  They are changed by SBCENTER to dimensions that are
  centered on the screen.

  Examples:
  ---------

   nTop    := 0
   nLeft   := 0
   nBottom := nRows+2
   nRight  := nMaxwidth+2

   SBCENTER(@nTop,@nLeft,@nBottom,@nRight)
                  // center the coordinates

   cBox := makebox(nTop,nLeft,nBottom,nRight)

  Source:
  -------
  S_BOXES.PRG

 

SP_PULLDN

PULLDN()

  Short:
  ------
  PULLDN() Pulldown menu creator, handler

  Returns:
  --------
  <nSelection> => Selection in the form menu.prompt
  (i.e. 2.04)

  Syntax:
  -------
  PULLDN(nSelection,aOptions,[aAttributes],[aColumns])

  Description:
  ------------
  Draws a pulldown menu with up to 8 separate boxes.
  Selection process starts with <nSelection>.

  Each element of <aOptions> defines a menu.

  A menu definition is a delimited string in the form:

        "TITLE:prompt:prompt:prompt"

  with up to 99 prompts per string.

  When a selection is made, the number of the selection
  is returned, in the form BOX.OPTION . So option 2 in box 3 would
  come back as 3.02.

  [aAttributes] is a box definition array. It is 7
  elements long and defines the following:

  Element:          1. <lDraw>      Draw top bar box? T/F
                    2. <cBarColor>  Top bar color
                    3. <cBoxColor>  Menu Box color
                    4. <cBoxFrame>  Menu Box frame
                    5. <nShadowPos> Menu Box shadow position
                               (0,1,3,7,9)
                    6. <nShadowAtt> Menu Box shadow attribute
                    7. <nBarRow>    Row to start menu bar

  [aColumns] is an array of title column positions to
  override the internal 'figerin algorithm.

  Examples:
  ---------
   aOptions := { "Datafiles:Use Datafile",;
                 "Indices:Select Indices:Index order",;
                 "Editing:Replacement:Tabular Edit",;
                 "Reporting:Build Query:Print Lists",;
                 "Other:List file:Change Directory",;
                 "Quit" }

   aAttrib := { .t.,;               // draw the top bar box
                'W/B,GR/R,,,W/N',;  // top bar color
                'W/B,N/R,,,W/N',;   // drop box color
                cSingle_frame,;     // drop box frame
                3,;                 // drop box shadow position
                8,;                 // drop box shadow  attribute
                0 }                 // row # of menu bar

   nSel  := 1.01
   do while .t.
       nSel := PULLDN(nSel,aOptions,aAttrib)
       do case
       CASE nSel = 0  && TRAP 0
           nSel = 1.01
       case nSel = 1
       case nSel = 2
       case nSel = 3
       case nSel = 4
       endcase
   enddo

  Warnings:
  ----------
  It takes some work to start all options and titles
  with a first letter that is unique so that first letter selection may
  take place.

  Notes:
  -------
  First letter selection takes place on the following
  priority: next matching element first letter, next matching box
  title first letter.

  Passing a menu array element with title only will
  result in no menu box, with the title being the only selection
  and returning a selection value of <MENU>.1.
  (i.e. a 'Quit' box)

  Source:
  -------
  S_PULLDN.PRG

 

 

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_MULTIMSGYN

MULTIMSGYN()

  Short:
  ------
  MULTIMSGYN()          Multi-line popup message - yes -no

  Returns:
  --------
  <lYesNo> => True or False for yes or no

  Syntax:
  -------
  MULTIMSGYN(aMsgs,[cYes,[cNo],[cColor],[cTitle],[lCenter],[nTop,nLeft])

  Description:
  ------------
  Pops up a multi-line message contained in array
  <aMsgs> and prompts for a Yes or No. Returns <lYesNo> based on
  response.

  Each element of the array may be of type CNDL.

  [cYes]  Yes prompt - default is "Yes"

  [cNo]   No prompt - default is "No"

  [cColor]  popup color- default is sls_popcol()

  [cTitle] string to display at box top - default is
  none

  [lCenter]  center the messages in the box (each line
  centered) - default is no - left justified.

  [nTop,nLeft]  popup box top and left. Default is
  centered on the screen.

  Examples:
  ---------
   ?multimsgyn({"Would you really like","to fly?"},"Sure","Nope")
   ?multimsgyn({"Is it ",date()+1,"yet?"},"Sure","Nope",;
         "N/W","There yet")

   ?multimsgyn({"Start with",nStart,"End with",nEnd},;
         nil,nil,,nil,nil,.t.,10,10)

  Source:
  -------
  S_MULMYN.PRG

 

SP_MFIELDS

MFIELDS()

  Short:
  ------
  MFIELDS() Pops up a selection box for current dbf fields

  Returns:
  --------
  <cFieldName> => field name or "" if none selected

  Syntax:
  -------
  Mfields([cTitle],[nTop,nLeft,nBottom,nRight])

  Description:
  ------------
  Popus up a box and presents an selection menu for the
  current dbf fields.

  [cTitle] is a title for the box.

  [nTop...nRight]  are coordinates of the box. Default
  is centered.

  Examples:
  ---------
   cFieldname := MFIELDS()

   // *or

   cFieldname := MFIELDS("Pick a Field")

   //*or

   cFieldname := MFIELDS('Pick a Field',10,10,20,40)

  Source:
  -------
  S_MFLD.PRG

 

SP_MESSYN

MESSYN()

  Short:
  ------
  MESSYN() Popup YesNo prompt box

  Returns:
  --------
  <lYes> => True for yes, False for No

  Syntax:
  -------
  MESSYN(cQuestion,[cYes],[cNo],[nTop],[nLeft])

  Description:
  ------------
  Pops up a box and displays a question <cQuestion>
  and two prompts.

  [cYes] ,[cNo] are optional prompts 1 and 2. Default
  is YES/NO.

  [nTop] and [nLeft] are optional box top and left
  coordinates. Default is centered.

  Examples:
  ---------
   if messyn("Are you done")

   if messyn("Are you done","Not yet","Almost",10,10)

   if messyn("Are you done","Not Yet","Almost")

  Source:
  -------
  S_MESSYN.PRG

 

SP_MENU_V

MENU_V()

  Short:
  ------
  MENU_V() Vertical popup menu from variable # parameters

  Returns:
  --------
  <nSelection> => selection - 0 for no selection

  Syntax:
  -------
  MENU_V(cTitle,cOption1,[cOption2,...cOption16])

  Description:
  ------------
  Creates a popup vertical menu in a centered box,
  using <cTitle> as the title, and performing a menu to on
  <cOption1...cOption16> (variable #)

  <cTitle> may be passed as "" for no title.

  [cOption2..cOption16] are optional

  Examples:
  ---------
   nChoice :=  menu_v("Selection","Edit","Add","Quit")

       -or-

   nChoice :=  menu_v("","Edit","Add","Quit")

  Source:
  -------
  S_MENUV.PRG

 

SP_MAKEBOX

MAKEBOX()

  Short:
  ------
  MAKEBOX() Draws a box on the screen and returns saved screen

  Returns:
  --------
  <cScreen> => string containing underlying screen &
  colors

  Syntax:
  -------
  MAKEBOX(nTop,nLeft,nbottom,nRight,[cColor],[nShadowPos])

  Description:
  ------------
  Draws a box at screen coordinates <nTop..nRight> and
  returns a string containing the underlying screen and previous color.
  Box will explode or not based on the setting of SLS_XPLODE().

  Default color is setcolor(). Default shadow position
  is the setting in SLS_SHADPOS(). These may be passed as
  options . Shadow position [nShadowPos] has allowable values of
  (1,3,7,9,0) to match the corner positions on the numeric keypad.
  0 is no shadow. [cColor] is a valid color string or variable.

  Examples:
  ---------

   cBox := MAKEBOX(5,5,10,10)
   //draws a box at 5,5,10,10. Color is SETCOLOR().
   //shadow position is based on SLS_SHADPOS().

   cBox: = MAKEBOX(5,5,10,10,SLS_POPCOL())
   //draws a box at 5,5,10,10. Color is SLS_POPCOL().
   //shadow position is based on SLS_SHADPOS().

   cBox: = MAKEBOX(5,5,10,10,SLS_POPCOL(),9)
   //draws a box at 5,5,10,10. Color is SLS_POPCOL().
   //shadow position is 9 (upper right hand corner)

  Warnings:
  ----------
  Use only UNBOX() to remove screens stored with
  MAKEBOX().

  Notes:
  -------
  UNBOX() removes the box and restores the underlying
  screen and prior colors.

  The shadow will not be drawn if it would go off the
  edge of the screen.

  Source:
  -------
  S_MAKEB.PRG

 

SP_FILEREAD

FILEREAD()

  Short:
  ------
  FILEREAD() Lists a text file of unlimited size

  Returns:
  --------
  nothing

  Syntax:
  -------
  FILEREAD([nTop,nLeft,nBottom,nRight],[cFileName],[cTitle],;
            [lSearch],[lMark])

  Description:
  ------------
  Lists text file [cFileName] of unlimited size in a
  programmer definable window of dimensions [nTop..nRight]

  Allows up down right left scrolling. Use this for
  reports or output sent to a disk file.

  If [cFileName]  is not passed, a box asks for the
  filespec and then allows a picklist of files of that spec. If
  [cFileName] is passed as a wildcard (i.e. "*.DOC"). a picklist
  of files of that spec is presented.

  If [nTop..nRight] are not passed, a default window of
  dimensions 2,2,22,78 is used.

  [cTitle] is an optional title. This overrides the
  default which is the file name.

  [lSearch] is a switch to allow text searches. Default
  is True

  [lMark] is a switch to allow block marking (with Copy
  to File or Print) Default is True.

  Examples:
  ---------
   REPORT FORM summary TO summary.txt
   FILEREAD(2,2,22,78,"SUMMARY.TXT","Summary File")

  Notes:
  -------
  Fileread() will use SET DEFAULT if no path is
  specified.

  Source:
  -------
  S_FILER.PRG