MOL (Marek Olszewski)

Contributed samples by MOL (Marek Olszewski)

Backup-Restore

Billing System ( definable buttons )

Calculator

Copy To Clipboard

Deactivate menu

Debug Message

Download from www

EAN13 BarCode Generator

Filter in Browse

HMG with MS SQL server

Incremental Search in BROWSE 

Menu like ACHOICE

Moldruk (Print like DOS )

Set Status Bar Item

Send mails via SMTP

Using ProgressBar as a graph

SP_MSG

()

  Short:
  ------
  MSG() Displays up to a 9 line message in a window

  Returns:
  --------
  Nothing

  Syntax:
  -------
  MSG(c1,[c2,c3,c4,c5,c6,c7,c8,c9])

  Description:
  ------------
  Displays in a popup box up to 9 lines of a message
  <c1..c9>.

  Then waits for a keypress or optionally a time-out.
  First parameter can be a number equaling a time-out value in
  seconds

  Examples:
  ---------
   MSG("An error has been detected",;
       "...don't move!")

   MSG("A","B","C","D","E","F")

   MSG(5,"A","B","C","D","E","F")

  Notes:
  -------
  Message is centered on screen in a box
  Once message is displayed, waits for keypress and
  then removes window, restoring screen underneath.
  Or waits for time-out value.

  Source:
  -------
  S_MSG.PRG

 

 

SP_GENVAL

GENVAL()

  Short:
  ------
  GENVAL() Generic VALID clause validation with message

  Returns:
  --------
  <lValid> => logical result of passed condition

  Syntax:
  -------
  GENVAL(expValid,expMessage)

  Description:
  ------------
  Evaluates <expValid>, which is either a bode block or
  a string to be macro expanded, as a logical value. If result is
  False, displays message <expMessage> and waits for a keypress.
  <expMessage> can be a single string, or an array of strings (see
  aMsg() ).

  Examples:
  ---------
   if genval("fcount() < 60",'Too many fields')
       COPY TO TEMP
   endif

   * ...or as a VALID CLAUSE macro'd

   @10,10 get lname VALID ;
     GENVAL("!empty(lname)","Need a last name")

   * ...or as a VALID CLAUSE eval'd

   @10,10 get fname VALID ;
     GENVAL( { || !empty(fname) },"Need a last name")

  Source:
  -------
  S_GENVA.PRG

 

SP_AMSG

AMSG()

  Short:
  ------
  AMSG() Pop up message box for an array of messages

  Returns:
  --------
  Nil

  Syntax:
  -------
  aMsg(aMsgs,[cTitle],[cFooter],[lCenter],[cColor],[nTop,nLeft])

  Description:
  ------------
  Pops up a box to display messages in <aMsgs>. Each
  element of <aMsgs> can be of type Character, Numeric, Date or
  Logical.

  The box is centered in the middle of the screen by
  default.

  [cTitle]  is an optional title string displayed at
  <nTop>,<nLeft+1>

  [cFooter] is an optional footer string displayed at
  <nBottom>, <nLeft+1>. Default footer is "Press a key.."

  [lCenter]  determines center messages in box or not.
  by default, message lines are left justified. Passing True
  causes messages to be centered.

  [cColor] is the color of the popup box. By default,
  is sls_popcol()

  [nTop,nLeft] are optional TOP/LEFT dimensions for the
  box. Default is centered on the screen, and big enough to hold
  all of the message lines.

  Examples:
  ---------

  aArray := {"Attention:","all items are on sale for",1.99,;
     "today only",date()}

  amsg(aArray,"Sale",nil,.t.)

  Notes:
  -------
  If there are more message lines than will fit in the
  box, up/down arrows will scroll the messages.

  See MSG()

  Source:
  -------
  S_AMSG.PRG

 

FT_PROMPT

FT_PROMPT()
 Define a menu item for use with FT_MenuTo()

 Syntax

      #include "FTMENUTO.CH"

      @ <nRow>, <nCol> PROMPT <cPrompt>                     ;
                       [COLOR <cColor>]                     ;
                       [MESSAGE <cMessage>]                 ;
                       [MSGROW <nMsgRow>]                   ;
                       [MSGCOL <nMsgCol>]                   ;
                       [MSGCOLOR <cMsgColor>]               ;
                       [TRIGGER <nTrigger>]                 ;
                       [TRIGGERCOLOR <cTriggerColor>]       ;
                       [HOME <nHome>]                       ;
                       [END <nEnd>]                         ;
                       [UP <nUp>]                           ;
                       [DOWN <nDown>]                       ;
                       [LEFT <nLeft>]                       ;
                       [RIGHT <nRight>]                     ;
                       [EXECUTE <bExec>]                    ;

 Arguments

     <nRow> is the row at which the prompt is to appear.

     <nCol> is the column at which the prompt will appear.

     <cPrompt> is the menu item string.

     <cColor> is optional and is the color attribute of the prompt.  Note
     that two colors are required; one for the standard setting and one
     for the enhanced setting (i.e. the light bar color).  See the example
     below if this isn't clear.  If <cColor> is not specified then the
     current SetColor() value is used by default.

     <cMessage> is optional and is the message associated with the
     prompt. If not specified, then no message will be displayed.

     <nMsgRow> is optional and is the row at which the message, if any,
     will appear.  If not specified, the default is the current setting
     of the SET MESSAGE TO command.

     <nMsgCol> is optional and is the column at which the message, if
     any, will appear.  If not specified, the default is either zero or
     centered, depending on the current setting of the CENTER option of
     the SET MESSAGE TO command.

     <cMsgColor> is optional and is the color attribute of the message.
     If not specified, the default is the same as the prompt color.

     <nTrigger> is optional and is the position within the prompt string
     where the trigger character is located.  If not specified, the
     default is one.

     <cTriggerColor> is optional and is the color attribute of the trigger
     character.  Note that two colors are required; one for the standard
     setting and one for the enhanced setting (i.e. the light bar color).
     See the example below if this isn't clear.  If <cTriggerColor> is not
     specified then the default is the same color as the rest of the
     prompt.

     <nHome> is optional and specifies which prompt becomes active
     when the home key is pressed.  If not specified, the default is
     the first prompt.

     <nEnd> is optional and specifies which prompt becomes active
     when the end key is pressed.  If not specified, the default is
     the last prompt.

     <nUp> is optional and specifies which prompt becomes active
     when the up arrow key is pressed.  If not specified, the
     default is the previous prompt.  The current setting of SET
     WRAP TO is obeyed.

     <nDown> is optional and specifies which prompt becomes
     active when the down arrow key is pressed.  If not
     specified, the default is the next prompt.  The current
     setting of SET WRAP TO is obeyed.

     <nRight> is optional and specifies which prompt becomes
     active when the right arrow key is pressed.  If not
     specified, the default is the next prompt.  The current
     setting of SET WRAP TO is obeyed.

     <nLeft> is optional and specifies which prompt becomes
     active when the left arrow is pressed.  If not specified,
     the default is the previous prompt.  The current setting of
     SET WRAP TO is obeyed.

     <bExec> is optional and is a code block to evaluate whenever
     the menu item to which it belongs is selected.

 Description

     Clipper's @...PROMPT and MENU TO commands are fine as far as
     they go.  But many times you need more flexibility.  As
     you'll no doubt notice if you read the argument list, this
     function is almost completely flexible. You can adjust
     locations and colors for every part of the prompt and its
     associated message.  In addition, since you can control the
     effect of the arrow keys, you can allow both horizontal and
     vertical movement, or even disable certain arrow keys if you
     so desire.  Support for nested menus is also available, since
     the prompts are stored in stack-based static arrays.

     Note that this command can also be called using function-style
     syntax.  See the entry for FT_PROMPT() for further details.

     This enhanced version of @...PROMPT requires the inclusion of
     the header file FTMENUTO.CH in any source file that uses it.
     It is may be used in place of the standard Clipper @...PROMPT
     command.  However, in the interests of functionality it is NOT
     100% compatible.  No whining!  If compatibility is such a big
     deal then use the standard Clipper commands.

 Examples

    #include "FTMENUTO.CH"

    // Simple prompt
    @ 1, 1 PROMPT "Menu choice #1"

    // Prompt with color
    @ 3, 1 PROMPT "Menu choice #2" COLOR "W+/R,W+/B"

    // Prompt with a message
    @ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch"

    // Prompt with pinpoint message control
    @ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ;
                   MSGROW 22 MSGCOL 4 MSGCOLOR "GR+/N"

    // Prompt with a trigger character ("#" character)
    @11, 1 PROMPT "Menu choice #6" TRIGGER 13

    // Prompt with trigger character color control
    @13, 1 PROMPT "Menu Choice #7" TRIGGER 13 TRIGGERCOLOR "R+/BG,G+/N"

    // Prompt with right and left arrow keys disabled
    @15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8

 Header File: FTMENUTO.CH

 Source: MENUTO.PRG

 Author: Ted Means

 

FT_DISPMSG

()
 Display a message and optionally waits for a keypress

 Syntax

      FT_DISPMSG( <aMessageArray>, [ <cKey2Check> ],
                  [ <nTopBoxRow> ], [ <nLeftBoxColumn> ],
                  [ <cBoxType> ], [ <lShadow> ] ) -> lKeyMatch

 Arguments

     <aMessageArray> is a multidimensional array of messages to be
     displayed and the color attributes for each message.

     The first dimension of the array contains one or more elements,
     each representing one line in the message box, up to the maximum
     number of rows on the screen.

     The second dimension of the array contains a color attribute for
     the corresponding element in dimension one, plus one additional
     element for the color of the box border.  Dimension two will
     always contain one more element than dimension one.  If an
     attribute is omitted, the last color selected will be used.

     <Key2Check> is a character string of one or more keys to check
     for.  If omitted, the message is displayed and control is returned
     to the calling procedure.  If one character is specified,
     FT_DISPMSG() waits for one keypress, restores the screen and
     returns.  If multiple characters are specified, FT_DISPMSG()
     remains in a loop until one of the specified keys has been
     pressed, then restores the screen and returns.

     <nTopBoxRow> is the upper row for the message box.  If omitted, the
     box is centered vertically.

     <nLeftBoxColumn> is the leftmost column for the box.  If omitted, the
     box is centered horizontally.

     <cBoxType> is a string of characters or a variable for the box
     border.  See the @...BOX command.  If omitted, a double box is
     drawn.

     <lShadow> is a logical variable.  If true (.T.) or omitted, it
     uses FT_SHADOW() to add a transparent shadow to the box.  If
     false (.F.), the box is drawn without the shadow.

 Returns

     If <Key2Check> is not specified, FT_DISPMSG() will return false
     (.F.).

     If <Key2Check> is a one-character string, FT_DISPMSG() will return
     true (.T.) if the user presses that key, or false (.F.) if any
     other key is pressed.

     If <Key2Check> consists of multiple characters, it will lock the
     user in a loop until one of those keys are pressed and return the
     INKEY() value of the keypress.

 Description

     FT_DISPMSG() is a multi-purpose pop-up for user messages.
     Multiple lines may be displayed, each with a different attribute.
     The box will be automatically centered on the screen, or the row
     and/or column can be specified by the programmer.  It also centers
     each line of the message within the box.

 Examples

     The following example displays a simple two-line message
     and returns immediately to the calling routine.

        FT_DISPMSG( { { "Printing Report"                    , ;
                        "Press [ESC] To Interrupt" }         , ;
                      { "W+/B*", "W/B", "GR+/B" } } )

     The next example displays a message and waits for a key press.

        FT_DISPMSG( { { "Press [D] To Confirm Deletion"      , ;
                        "Or Any Other Key To Abort" }        , ;
                      { "W+/B", "W+/B", "GR+/B" } }          , ;
                      "D" )

     The next example displays a one-line message centered on row 5
     and returns to the calling procedure.

        FT_DISPMSG( { { "Please Do Not Interrupt" }   , ;
                      { "W+/B", "GR+/B" } }          , ;
                      , 5, )

 Source: DISPMSG.PRG

 Author: Paul Ferrara