FT Menus – Prompts

 A_CHOICE()       Psuedo function to simplify FT_ACH2TB()
 FT_ACH2TB()      Replace ACHOICE() with a Tbrowse object & multiple features.
 FT_ADDER()       Pop up a simple calculator
 FT_BLINK()       Display a blinking message on the screen
 FT_BRWSWHL()     Browse an indexed database limited to a while condition
 FT_CLRSEL()      User Selectable Colour Routine
 FT_DISPMSG()     Display a message and optionally waits for a keypress
 FT_FILL()        Declare menu options for FT_MENU1()
 FT_MENU1()       Pulldown menu system
 FT_MENU2()       Vertical lightbar menu
 FT_MENUTO()      Execute light bar menu using prompts created with @...PROMPT
 FT_PENDING()     Display same-line pending messages after a wait.
 FT_PICKDAY()     Picklist of days of week
 FT_PROMPT()      Define a menu item for use with FT_MenuTo()
 FT_SLEEP()       Wait for a specified amount of time
 FT_XBOX()        Display a self-sizing message box and message

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_PICKDAY

FT_PICKDAY()
 Picklist of days of week

 Syntax

      FT_PICKDAY() -> cDayOfWeek

 Arguments

     None

 Returns

     Character string containing day of week

 Description

     This function is ideal if you need the user to select a day.

 Examples

     mday := FT_PICKDAY()

 Source: PICKDAY.PRG

 Author: Greg Lief

 

FT_PENDING

FT_PENDING()
 Display same-line pending messages after a wait.

 Syntax

      FT_PENDING ( <cMsg>, [ <nRow> ], [ <nCol> ], ;
                        [ <nWait> ], [ <cColor> ] ) -> NIL

 Arguments

     <cMsg> is the message string to display.

     <nRow> is an optional screen row for message display, default row 24.

     <nCol> is an optional screen col for message display, default col 0.

     <nWait> is an optional wait (sec) between messages, default 5 sec.

     <cColor> is an optional color string for displayed messages, default
              is white text over red background.

 Returns

     NIL

 Description

     A good way to display information messages during the running
     of an application is to send them all to the SAME line on the
     screen where users are expected to look for them. In order to
     give users a chance to read the current message before the next one
     is displayed we may need to insert a delay after each message.

     FT_PENDING() function displays messages by keeping track of
     the time of the last message and providing a delay ONLY if the next
     pending message is issued much too soon after the current one.

 Examples

     FT_PENDING("Message one",20,0,3,"W+/G") // Displays "Message one."
                                             // sets row to 20, col to 0.
                                             // wait to 3 and color to
                                             // bright white over green.
     FT_PENDING("Message two")   // Displays "Message two", after 5 sec.
     FT_PENDING("Message three") // Displays "Message three", after 5 sec.

     Note that default row, col, wait time and color need to be set only
     once in the very first call to FT_PENDING() and only if the internal
     default values are not appropriate.

 Source: PENDING.PRG

 Author: Isa Asudeh

 

FT_MENUTO

FT_MENUTO()
 Execute light bar menu using prompts created with @...PROMPT

 Syntax

      #include "FTMENUTO.CH"

      MENU TO <var> [COLD]

 Arguments

     <var> is the name of the variable to which the result of the menu
     selection should be assigned.

     [COLD] is optional and if specified indicates that trigger characters
     should be treated as "cold," i.e. rather than causing the menu item
     to be selected it only causes the light bar to move to that selection.

 Description

     This enhanced version of MENU TO requires the inclusion of the header
     file FTMENUTO.CH in any source file that uses it.  It may be used in
     place of the standard Clipper MENU TO command.  However, in the
     interests of functionality it is NOT 100% compatible (in particular,
     you should make sure that the target memvar exists before executing
     the menu -- the Clipper version will create a PRIVATE memvar for you
     if it does not already exist, but this version does not).  No whining!
     If compatibility is such a big deal then use the standard Clipper
     command.

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

 Examples

    #include "FTMENUTO.CH"

    // Simple command

    MENU TO memvar

 Header File: FTMENUTO.CH

 Source: MENUTO.PRG

 Author: Ted Means

See Also: @…PROMPT