SP_MFIELDSTYPE

MFIELDSTYPE()

  Short:
  ------
  MFIELDSTYPE() Pops up a list of fields of given type(s)

  Returns:
  --------
  <cFieldName> => name of selected field

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

  Description:
  ------------
  <cType> is a string containing 1 or more field TYPE
  symbols:

       C   Character
       N   Numeric
       D   Date
       L   Logical
       M   Memo

  Only fields of this type(s) are presented for the
  picklist. If no fields of this type(s) are present, a "" is returned.

  [cTitle] is a string placed at the top of the popup
  box for a title

  [nTop,nLeft,nBottom,nRight] are the coordinates of
  the box

  Examples:
  ---------
   // this selects memo field to edit

   use customer

   cField := mfieldstype("M")

   if !empty(cField)
      memoedit(FIELDGET(FIELDPOS(cField)),0,0,24,79)
   endif

  Source:
  -------
  S_MFLDT.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_MCHOICE

MCHOICE()

  Short:
  ------
  MCHOICE() Does a boxed, achoice() style popup on an array

  Returns:
  --------
  <expN> Achoice selection

  Syntax:
  -------
  MCHOICE(aOptions,[nTop,nLeft],[nBottom,nRight],[cTitle],[lTrigger],;
                   [nStart],[@nRow],[aSelectable])

  Description:
  ------------
  Provides a box for selection from array <aOptions> of
  character elements.

  [nTop,nLeft] may be specifed to determine the
  starting top and left of the popup box.

  [nBottom,nRight] may be specified to complete the box
  dimensions.

  Default box dimensions are centered on the screen. If the dimensions
  passed are not wide enough to display the mouse hot areas on the
  bottom, the box is widened and centered on the screen.

  [cTitle] is a string to display at the top of the box.

  [lTrigger] determines (yes or no) whether a return is
  to be executed on a first letter match.(default .f.)

  [nStart] optional starting element (default 1)
  [@nRow] optional starting row. Pass by reference to retain value
  between calls.

  [aSelectable] is an array of logicals that determines which items
  are selectable. This array must be the same size as [aOptions], and
  all elements must be either True or False, not NIL. Where an element
  is False, the corresponding element in [aOptions] will be dimmed
  and will emit a BEEP when you attempt to select it.

  Examples:
  ---------
   aMeals   := {"Pizza","Chicken","Chinese"}
   nSelect  := mchoice(aMeals)

   // or box with title
   aMeals   := {"Pizza","Chicken","Chinese"}
   nSelect  := mchoice(aMeals,,,,"Meals")

   // or box with title, first letter match = return and top/left specified
   aMeals   := {"Pizza","Chicken","Chinese"}
   nSelect  := mchoice(aMeals,10,10,,,"Meals",.t.)

   //to retain element and position between calls
   nSelect := 1
   nRow    := 1
   aMeals   := {"Pizza","Chicken","Chinese"}
   while nSelect > 0
     nSelect  := mchoice(aMeals,,,,,"Meals",.t.,nSelect,@nRow)
     // code
   endif

  Notes:
  -------
  Bottom of window adjusts (shrinks) to adjust to array
  size if needed.

  Now uses Tbrowse() instead of ACHOICE().

  Source:
  -------
  S_MCHOI.PRG

 

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_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_LJUST

LJUST()

  Short:
  ------
  LJUST() Left justifies a string

  Returns:
  --------
  <cJustified> => string left justified

  Syntax:
  -------
  LJUST(cTarget)

  Description:
  ------------
  Left justifies <cTarget>

  Examples:
  ---------
   string = "      Superfunction"

   string = LJUST(string)

   // (returns "Superfunction    "

  Source:
  -------
  S_LJUST.PRG

 

SP_LISTER

LISTER()

  Short:
  ------
  LISTER() Build, format,print SIMPLE lists to
  printer,screen,file

  Returns:
  --------
  Nothing

  Syntax:
  -------
  LISTER([aNames,aDesc])

  Description:
  ------------
  A menu driven utility for creation, printing and
  storage of list definitions.

  The user is asked to pick the fields to be included
  on the list. The selected fields, in the order in which
  they will be listed, are shown in the bottom information box.
  The user may select which records are to be included in the list -
  all records, query matches or tagged records.

  The user may select output as PRINTER, SCREEN or
  FILE, and choose the maximum line length to avoid printer
  wraparound.

  The user may save list definitions to PLIST.DBF and
  later restore them.

  Two arrays may be passed - fieldnames [aNames], and
  field descriptions [aDesc] Pass both or none. Normally, field
  names are used as the column headings for the list, but if
  [aDesc] is passed, these descriptions are used in the column
  headings of corresponding fields.

  By default, all fields are used, field names are used
  for descriptions.

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

   LISTER()

  Source:
  -------
  S_LIST.PRG