[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
The maximum number of options that may appear in a popup created with
PROMPT FIELD in FoxPro is 32,767. If the database has more records than
this, an alert "Popup too big, first nnnnn entries shown" is displayed.
In the Extended Version of FoxPro, there is no limit to the number of
entries that may appear in a popup created with PROMPT FIELD.
PROMPT FILES [LIKE <skel>]
Creates popup that displays all available files. The file
specification skeleton <skel> supports wild card characters.
For example, to create a menu popup that displays database files from
the default drive and directory, include the clause PROMPT FILES LIKE
*.DBF. You may create a menu popup that displays files on other drives
and directories by including a drive specification, a directory
specification or both. For example, to create a menu popup that
displays program files from a directory called PROGRAMS on drive A,
include the clause PROMPT FILES LIKE A:\PROGRAMS\*.PRG.
PROMPT STRUCTURE
Places database structure into popup. When the popup is activated the
work area containing the database is selected.
RELATIVE
Controls order that options are inserted in popup. If a menu popup is
created without the RELATIVE clause, an option will be positioned in a
popup in an order dictated by the option's bar number (as specified in
its DEFINE BAR command). Space in the popup will be reserved for
options that have yet to be defined. For example, if the first and
third options are defined (DEFINE BAR 1 OF <popup name>, DEFINE BAR 3 OF
<popup name>) and the popup is activated, a blank line reserved for the
second option is placed in the popup.
If a menu popup is created with the RELATIVE clause, the options will
appear in the popup in the order they are defined. Space in the popup
is not reserved for options that have yet to be defined. Defining a
popup with the RELATIVE clause also lets you make use of the BEFORE and
AFTER clauses in the DEFINE BAR command - options can be placed in a
menu popup relative to other options. If a popup is created without the
RELATIVE clause, a BEFORE or AFTER clause in a DEFINE BAR command will
cause a syntax error.
SCROLL
Places scroll bar to right of popup. The scroll bar is only displayed
when the menu popup has more options than can fit into the popup, or if
the popup is too long to fit in the screen or active window.
SHADOW
Places shadow behind popup. The SET SHADOWS command can be used to
display or remove the popup's shadow.
TITLE <expC4>
Specifies TITLE that appears centered in top border of popup.
COLOR SCHEME <expN>
| COLOR <color pair list>
Overrides default color settings. By default the colors of menu popups
created with DEFINE POPUP are controlled by color scheme 2, Usr Menus.
You can specify the color of all elements of a popup directly, or a
popup can draw its colors from another specified color scheme.
+---------------------------------+
| Program Examples |
+---------------------------------+
*** DEFINE POPUP EXAMPLE ***
CLEAR
SET ESCAPE OFF
DEFINE MENU mainmenu
DEFINE PAD invoice OF mainmenu PROMPT ' \<Invoices ' AT 2,00
DEFINE PAD cust OF mainmenu PROMPT ' \<Customers ' AT 2,20
ON PAD invoice OF mainmenu ACTIVATE POPUP invpop
ON PAD cust OF mainmenu ACTIVATE POPUP custpop
DEFINE POPUP invpop FROM 4,1
DEFINE BAR 1 OF invpop PROMPT '\<The invoice stack'
DEFINE BAR 2 OF invpop PROMPT '\<Print one or more invoices'
DEFINE BAR 3 OF invpop PROMPT '\<Show me what my sales are'
ON SELECTION POPUP invpop DO tmenu WITH POPUP(), PROMPT()
DEFINE POPUP custpop FROM 4,14
DEFINE BAR 1 OF custpop PROMPT '\<Look at the Customer info'
DEFINE BAR 2 OF custpop PROMPT 'L\<ist my customers'
DEFINE BAR 3 OF custpop PROMPT '\<Make customer labels'
DEFINE BAR 4 OF custpop PROMPT '\<The Customer Ledger'
ON SELECTION POPUP custpop DO tmenu WITH POPUP(), PROMPT()
ACTIVATE MENU mainmenu
PROCEDURE tmenu
PARAMETER mpopup, mprompt
WAIT WINDOW 'Selected prompt of popup '+ mpopup + ' is: ' + mprompt
RETURN
In this example, a menu bar named MAINMENU is defined. Two popups, one
for each menu pad, are created with DEFINE POPUP. When one of the menu
pads is chosen, an ON PAD command ACTIVATEs the corresponding popup.
When an option is chosen from the popup, two values are passed to the
TMENU routine. The TMENU routine then displays a message.In example
below, popup named fruits is created. MULTI is included to create popup
that allows multiple options to be chosen.
Each of four options has different mark character. When options are
chosen from popup, options are marked and routine named YOURCHOICE
displays options chosen.
CLEAR
DEFINE POPUP fruits FROM 5,5 MULTI MARGIN && Create multi-choice popup
DEFINE BAR 1 OF fruits PROMPT '\<Apples' MARK CHR(3) && First option
DEFINE BAR 2 OF fruits PROMPT '\<Bananas' MARK CHR(4)&& Second option
DEFINE BAR 3 OF fruits PROMPT '\<Grapes' MARK CHR(5) && Third option
DEFINE BAR 4 OF fruits PROMPT '\<Lemons' MARK CHR(6) && Fourth option
@ 12,5 SAY 'Your choices:'
ON SELECTION POPUP fruits DO yourchoice && Choice routine
ACTIVATE POPUP fruits
PROCEDURE yourchoice && Executed when choice is made
@ 13,5 CLEAR
FOR count = 1 TO CNTBAR('fruits') && Loop for number of options
IF MRKBAR('fruits', count) = .T. && If option is marked,
? PRMBAR('fruits', count) AT 5 && display option prompt
ENDIF
NEXT
Run examples below and note difference in placement of options in each
popup:
*** RELATIVE Example ***
DEFINE POPUP relatyes RELATIVE FROM 1,1
DEFINE BAR 4 OF relatyes PROMPT '4444
DEFINE BAR 3 OF relatyes PROMPT '3333'
DEFINE BAR 2 OF relatyes PROMPT '2222'
DEFINE BAR 1 OF relatyes PROMPT '1111'
DEFINE BAR 6 OF relatyes PROMPT '6666' BEFORE 4
ACTIVATE POPUP relatyes
*** NON-RELATIVE Example ***
DEFINE POPUP notrelat FROM 1,1
DEFINE BAR 4 OF notrelat PROMPT '4444'
DEFINE BAR 3 OF notrelat PROMPT '3333'
DEFINE BAR 2 OF notrelat PROMPT '2222'
DEFINE BAR 1 OF notrelat PROMPT '1111'
DEFINE BAR 6 OF notrelat PROMPT '6666'
ACTIVATE POPUP notrelat
-----------------------------------
See Also: ACTIVATE POPUP, CNTBAR(), DEFINE BAR, GETBAR(), HIDE POPUP,
MENU - System Menu Names, MOVE POPUP, MRKBAR(), ON BAR, ON SELECTION
BAR, PRMBAR(), RELEASE, SHOW POPUP, SET MARK OF, SET MESSAGE, SIZE POPUP
-----------------------------------
See Also:
ACTIVATE POPUP
CNTBAR()
DEFINE BAR
GETBAR()
HIDE POPUP
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson