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