home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
CLIPPER
/
NFTROFF
/
11.TR
< prev
next >
Wrap
Text File
|
1993-12-01
|
63KB
|
2,987 lines
.de }n
.bp
.sp .5i
..
.wh -.8i }n
.sp .5i
.po -.4i
.ll 7.5i
.ps 9
.vs 9
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
@\.\.\.PROMPT Define a menu item for use with MENU TO
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fB@\.\.\.PROMPT
Define a menu item for use with MENU TO
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.br
\fB#include "FTMENUTO\.CH"
.in 0i
.br
\fB
.in 0.4i
.ta 4.96i
.br
\fB@ <nRow>, <nCol> PROMPT <cMenuItem> ;
.br
.ta
.in 2.32i
.ta 3.04i
.br
\fB[ PROMPTCOLOR <cPromptColor> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ MESSAGE <cItemMessage> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ MSGROW <nMessageRow> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ MSGCOL <nMessageCol> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ MSGCOLOR <cMsgColor> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ HOTKEY <nHotKeyPosition> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ HOTKEYCOLOR <cHotKeyColor> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ BARCOLOR <cBarColor> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ BARHOTKEYCOLOR <cBarHotKeyColor> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ UP <nUp> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ DOWN <nDown> ] ;
.br
.ta
.ta 3.04i
.br
\fB[ RIGHT <nRight> ] ;
.br
.ta
.br
\fB[ LEFT <nLeft> ]
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<nRow>\fR is the row at which the prompt is to appear\.
.sp
\fB<nCol>\fR is the column at which the prompt will appear\.
.sp
\fB<cMenuItem>\fR is the menu item to display\.
.sp
\fB<cPromptColor>\fR is optional and is the color attribute of the
prompt\. If not specified, the default is the current
standard color as supplied by the SetColor() function\.
.sp
\fB<cItemMessage>\fR is optional and is the message associated with
the prompt\. If not specified, then no message will be displayed\.
.sp
\fB<nMessageRow>\fR 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\.
.sp
\fB<nMessageCol>\fR 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\.
.sp
\fB<cMsgColor>\fR is optional and is the color attribute of
the message\. If not specified, the default is the current
standard color as reported by the SetColor() function\.
.sp
\fB<nHotKeyPosition>\fR is optional and is the position within the
prompt string where the hotkey is located\. If not
specified, the default is one\.
.sp
\fB<cHotKeyColor>\fR is optional and is the color attribute of the
hotkey character\. If not specified, the default is the same
color as the rest of the prompt\.
.sp
\fB<cBarColor>\fR is optional and is the color attribute of
the light bar when it is positioned on this prompt\. If not
specified, the default is the current enhanced color setting
as returned by the SetColor() function\.
.sp
\fB<cBarHotKeyColor>\fR is optional and is the color
attribute of the hotkey when the light bar is positioned on
this prompt\. If not specified, the default is the same
color as the rest of the light bar\.
.sp
\fB<nUp>\fR 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\.
.sp
\fB<nDown>\fR 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\.
.sp
\fB<nRight>\fR 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\.
.sp
\fB<nLeft>\fR 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\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This enhanced version of @\.\.\.PROMPT requires the inclusion of
the header file FTMENUTO\.CH in any source file that uses it\.
It is compatible with, and may be used in place of, the standard
Clipper @\.\.\.PROMPT command\.
.sp
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\.
.sp
Note that this command can also be called using function-style
syntax\. See the entry for FT_PROMPT() for further details\.
.sp
Also note that this command calls an internal routine called
__FTPROMPT()\. __FTPROMPT() was written in assembler\. Check
the file TMENU\.ASM if you\'re interested in seeing the
assembler source code\.
.sp
All the examples below use the command version\. If you\'re
interested in seeing the function version, compile the
examples with the /P switch and then examine the resulting
\.PPO file\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.32i
.br
#include "FTMENUTO\.CH"
.br
// Simple prompt
.br
@ 1, 1 PROMPT "Menu choice #1"
.sp
.br
// Prompt with color
.br
@ 3, 1 PROMPT "Menu choice #2" PROMPTCOLOR W+/R
.sp
.br
// Prompt with a message
.br
@ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch"
.sp
.br
// Prompt with pinpoint message control
.br
@ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ;
.in 1.52i
.br
MSGROW 22 MSGCOL 4 MSGCOLOR GR+/N
.sp
.in 0.32i
.br
// Prompt with a unique lightbar color
.br
@ 9, 1 PROMPT "Menu choice #5" BARCOLOR BG+/W
.sp
.br
// Prompt with a hotkey ("#" character)
.br
@11, 1 PROMPT "Menu choice #6" HOTKEY 13
.sp
.br
// Prompt with pinpoint hotkey control
.br
@13, 1 PROMPT "Menu Choice #7" HOTKEY 13 ;
.in 1.52i
.br
HOTKEYCOLOR R+/BG BARHOTKEYCOLOR G+/N
.sp
.in 0.32i
.br
// Prompt with right and left arrow keys disabled
.br
@15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8
.sp
.in 0.08i
\fBHeader File:\fR FTMENUTO\.CH
.sp
\fBSource:\fR ATPROMPT\.PRG
.sp
\fBAuthor:\fR Ted Means
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
MENU TO
, FT_PROMPT()
, FT_MENUTO()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ACH2TB() Replace ACHOICE() with a Tbrowse object
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ACH2TB()
Replace ACHOICE() with a Tbrowse object
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.ta 5.92i
.br
\fBFT_Ach2tb( <nToprow>,<nTopcol> [, <nBotrow> ][, <nBotcol> ],<aArray>, ;
.br
.ta
.in 0.88i
.ta 5.68i
.br
\fB[ <cBoxtype> ],[ <cBoxcolor> ],[ <cBoxtitle> ],[ <nTitlePos> ], ;
.br
.ta
.ta 5.68i
.br
\fB[ <cUselcolor> ],[ <cTitlecolor> ],[ <cBarcolor> ],[ <cHkcolor> ], ;
.br
.ta
.ta 5.68i
.br
\fB[ <cShadow> ],[ <lExecute> ],[ <nMsgrow> ],[ <nMsgcol> ], ;
.br
.ta
.ta 5.28i
.br
\fB[ <cMsgcolor> ],[cElevbar],[cEbarcolor],[ <cEbarside> ], ;
.br
.ta
.ta 5.76i
.br
\fB[ <cNoSelcolor> ],[ <cTagch> ],[ <nStartelem> ],[ <lRestscrn> ], ;
.br
.ta
.br
\fB[ <nTimeout> ],[ <bUserfunc> ] )
.in 0.48i
.br
\fB-> nOption
.sp
.in 0.08i
\fBArguments
.sp
.in 0.16i
.ta 0.96i
\fB<nToprow>\fR is the top row of the box to be drawn\. Required\.
.br
.ta
.sp
.ta 0.96i
\fB<nTopcol>\fR is the top column of the box to be drawn\. Required\.
.br
.ta
.sp
.ta 0.96i
\fB<nBotrow>\fR is the bottom row of the box to be drawn\. The default is
.br
.ta
.in 0.4i
\fB<nToprow>+Len(\fR<aArray>)+1 or maxrow()-2, whichever is less\.
.sp
.in 0.16i
.ta 0.96i
\fB<nBotcol>\fR is the bottom column of the box to be drawn\. The default
.br
.ta
.in 0.4i
is \fB<nTopcol>+width of the widest element in \fR<aArray>+2\.
.sp
.in 0.16i
.ta 0.96i
\fB<aArray>\fR is the array of options to present to the user\. Each
.br
.ta
.in 0.4i
element can hold as many as five subelements, or as few as one\.
Required\. Additional documentation below, in "Description\."
.sp
.in 0.16i
\fB<cBoxtype>\fR is the type of box to draw\. Uses DispBox()\. The
.in 0.4i
default is a double-line box\.
.sp
.in 0.16i
\fB<cBoxcolor>\fR is the color with which to draw the box\. The default is
.in 0.4i
Setcolor()\.
.sp
.in 0.16i
\fB<cBoxtitle>\fR is title of the box drawn on \fB<nToprow>\. The default is
.in 0.4i
no title\.
.sp
.in 0.16i
.ta 1.04i
\fB<nTitlepos>\fR is the starting column position (to the right of
.br
.ta
.in 0.4i
\fB<nTopcol>) at which to draw \fR<cBoxtitle>\. The default is 1\.
.sp
.in 0.16i
\fB<cUselcolor>\fR is the color with which to draw unselected options\.
.in 0.4i
The default is Setcolor()\.
.sp
.in 0.16i
\fB<cTitlecolor>\fR is the color with which to draw the box title\. The
.in 0.4i
default is yellow on red\.
.sp
.in 0.16i
.ta 1.04i
\fB<cBarcolor>\fR is the color with which to draw the selection bar\.
.br
.ta
.in 0.4i
The default is yellow on black\.
.sp
.in 0.16i
.ta 0.96i
\fB<cHkcolor>\fR is the default color with which to draw the hotkeys for
.br
.ta
.in 0.4i
for each option\. This is used when no hotkey color is supplied
in \fB<aArray>\. The default is hiwhite on the current background
color\.
.sp
.in 0.16i
.ta 0.96i
\fB<cShadow>\fR is a character string, either "L" or "R" (for left or
.br
.ta
.in 0.4i
right) to designate the side of the box where a shadow will appear\.
Leave this NIL to avoid drawing a shadow\. You might also leave
this NIL if you choose to use a \.C or \.ASM shadow function, which
is a good idea\. Shadoww(), included below, is flat-out SLOW\.
.sp
.in 0.16i
.ta 0.96i
\fB<lExecute>\fR turn on/off execution of option when first letter is
.br
.ta
.in 0.4i
pressed\. Rule: setting in element 5 of each \fB<aArray>\fR subarray
overrides \fB<lExecute>\. If that element is left NIL, the \fR<lexecute>
setting is used\. If \fB<lExecute>\fR is not passed and element 5 is NIL,
auto execution is turned ON by default\.
.sp
.in 0.16i
.ta 0.88i
\fB<nMsgrow>\fR is the row on which to draw a message for each option\.
.br
.ta
.in 0.4i
The default is two rows below the bottom of the box\.
.sp
.in 0.16i
.ta 0.88i
\fB<nMsgcol>\fR is the column at which to draw a message for each option\.
.br
.ta
.in 0.4i
The default is \fB<nTopcol>\fR +2\.
.sp
.in 0.16i
.ta 1.04i
\fB<cMsgcolor>\fR is the default color with which to draw messages\. This
.br
.ta
.in 0.4i
color is used when element 4 of each \fB<aArray>\fR subarray is left NIL\.
The default is Setcolor()\.
.sp
.in 0.16i
.ta 0.96i
\fB<cElevbar>\fR is the ASCII character to use as the elevator bar drawn
.br
.ta
.in 0.4i
on the box\. Leave this NIL to draw no elevator bar\.
.sp
.in 0.16i
.ta 1.12i
\fB<cEbarcolor>\fR is the color with which to draw the elevator bar\.
.br
.ta
.in 0.4i
This is ignored if \fB<cElevbar>\fR is NIL\.
.sp
.in 0.16i
.ta 1.04i
\fB<cEbarside>\fR is a character string, either "L" or "R" (for left or
.br
.ta
.in 0.4i
right) to designate the side of the box on which to draw the
elevator bar\. This is ignored if \fB<cElevbar>\fR is NIL\.
.sp
.in 0.16i
.ta 1.2i
\fB<cNoselcolor>\fR is the color with which to draw unselectable options\.
.br
.ta
.in 0.4i
The default is white on black\.
.sp
.in 0.16i
\fB<cTagchar>\fR is the ASCII character to use to draw tags that would
.in 0.4i
appear to the right of each option\. The default is DISabled
tagging\. The default tag is "\(sq\(sq\(sq" (chr(251))\.
.sp
.in 0.16i
.ta 1.12i
\fB<nStartelem>\fR is the number of the option where the selection bar
.br
.ta
.in 0.4i
will first be placed\. Leave this NIL to begin at option 1\.
.sp
.in 0.16i
.ta 1.04i
\fB<lRestscrn>\fR is a logical to designate whether or not the screen
.br
.ta
.in 0.4i
coordinates occupied by the box and/or shadow should be restored
before FT_Ach2tb() returns\. The default is \.T\.
.sp
.in 0.16i
.ta 0.96i
\fB<nTimeout>\fR is the number of seconds after which FT_ACH2TB() will
.br
.ta
.in 0.4i
timeout and return to the function/proced\. which called it\. The
default is 0, or no timeout\.
.sp
.in 0.16i
.ta 1.04i
\fB<bUserfunc>\fR is a code block containing a function call to be
.br
.ta
.in 0.4i
executed after each key press\. You need to write just two formal
parameters to allow the run-time passing of the key pressed and the
current element number, e\.g\.:
.sp
{ | nKey, nElemnum | Myfunc( nKey, nElemnum [, xAnythingelse ] ) }
.sp
Unlimited extra parameters may be passed\. Of course, make certain
to also write \'receptors\' for them in \'Myfunc()\' itself\.\.\.as in the
above example\. The default is NO user function\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
the number of the selected option, or 0 if [Esc] is pressed\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_Ach2tb() is a greatly enhanced, fully featured replacement for
Achoice(), based on a Tbrowse object\. Each element of <aArray> needs
to be composed as follows:
.sp
.in 0.72i
.ta 0.72i 1.2i 2.24i
Option , Message , HotKeyPos, HotKeyColor, Selectable
.br
.ta
.in 0.4i
.ta 3.04i 3.44i 3.76i 4.48i 4.88i 5.52i
{ "Utilities","System Utilities", 3 , "+gr/b" , \.T\. }
.br
.ta
.sp
All elements except for the first, the option itself, are optional\.
IF \'Message\' is NIL, no message is displayed\. \'HotKeyPos\' is the
position within \'Option\' of the hotkey\. In the example above, the
hotkey for \'Utilities\' is the first \'i\', i\.e\., at position 3\. The
default is 1\. \'HotKeyColor\' is the color to use for the hotkey
.ta 2.72i
display\. The default is hiwhite on the current background color\.
.br
.ta
\'Selectable\' is a logical indicating whether or not that option can
be selected\. The default is \.T\.
.sp
The A_CHOICE() UDC in FT_ACH2T\.CH makes using FT_ACH2TB() a breeze\.
The myriad of parameters can be written in any order\. Only <nToprow>,
<nTopcol>, and <aArray> are required\. See the example below\.
.sp
There may be some confusion over \'unselected\' and \'unselectable\'
options\. The former refers to any option not currently covered
by the selection bar\. The latter refers to options you have
designated unselectable in subelement 5 of <aArray>, i\.e\., by
writing \.F\.
.sp
To enable tagging, pass any ASCII character as <cTagchar>\. To
tag/untag all options, press [SPACE]\. To tag/untag individual
options, press [+] and [-] respectively\. To test for the tagged
status of an option, use the WAS_TAGGED() UDC in FT_ACH2T\.CH\. To
check the entire array for tags, use Aeval() in conjunction with
Was_Tagged() as in the example below\. When tagging is enabled, the
string "Tags" will be written across the bottom row of the box in
hiwhite on the current background color\.
.sp
Because FT_ACH2TB() takes over the [SPACE], [+], and [-] keys, it saves
any SET KEY procedures you might have set them to, and restores same
on returning\. Any other procedures you might have SET KEYs to will
fly when FT_ACH2TB() is called\.\.\.thanks to the INKEY() replacement,
SKINKEY()\.
.sp
The piece de resistance of FT_ACH2TB() is its ability to execute
a user function designed entirely by you\. It is called after each
keypress, and because it is completely open-ended, extends the
the reach of FT_ACH2TB() to the limits of Clipper\. See the docu-
mentation under <bUserfunc> above\.
.sp
Test compile: CLIPPER ft_ach2t /n/w/m/dFT_TEST
.ta 0.96i
Test link : RTLINK fi ft_ach2t /pll:base50
.br
.ta
.sp
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
nOpt := A_CHOICE( 7,9 ARRAY:t_array USERFUNC:{|a,b| UserFunc(a,b,any1)};
.in 1.04i
.ta 1.44i 2.72i 5.04i
.br
BOXTYPE:B_SINGLE BOXTITLE:title SHADOW:"R" TAGCHAR:chr(17) ;
.br
.ta
.ta 5.04i
.br
REST_SCREEN:\.F\. AUTOEXEC:\.F\. MES_COLOR:MSG_COLOR ELEVBAR:"\(sq" ;
.br
.ta
.br
NOSELCOLOR:"bg/n")
.sp
.in 0.4i
.br
Check only the RETURNed element:
.br
IF Was_Tagged(chr(17),t_array,nOpt); MoreProcessing(); END
.sp
.br
Check entire \'t_array\':
.br
Aeval( t_array,{|e,n| IF( Was_Tagged(chr(17),t_array,n ), ;
.in 2.48i
.br
MoreProcessing(t_array),NIL ) } )
.sp
.in 0.08i
\fBHeader File:\fR FT_ACH2T\.CH
.sp
\fBSource:\fR ACH2TB\.PRG
.sp
\fBAuthor:\fR Steve Kolterman
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_ADDER() Pop up a simple calculator
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_ADDER()
Pop up a simple calculator
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.48i
\fBFT_Adder()
.sp
.in 0.08i
\fBArguments
.sp
.in 0.48i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.48i
NIL \.\.\.\. but optionally places Total of calculation in active
.in 1.2i
Get variable using oGet:VARPUT()
.sp
.in 0.08i
\fBDescription
.sp
.in 0.48i
PopAdder() gives you an adding machine inside your Clipper 5\.01
application\. It has the basic functions add, subtract, multiply,
and divide\. You may move it from one side of the screen to the
other\. It even displays a scrollable tape, if you want it\.
.sp
.sp
The Help screen below gives a brief description of the operation
of the adder\.
.sp
.sp
.in 1.44i
.br
\(sq
.br
\l'0.56i'
.br
INSTRUCTIONS
.br
\l'0.56i'
.br
\(sq
.ta 0i 2.32i
.br
\(br \(br
.br
.ta
.ta 0i 2.32i
.br
\(br All number keys as usual \(br
.br
.ta
.ta 0i 2.32i
.br
\(br <+> <-> keys as usual \(br
.br
.ta
.ta 0i 2.32i
.br
\(br <SPACE>
.br
\l'0.24i'
.br
shift <+> to <*> \(br
.br
.ta
.ta 0i 0.8i 2.32i
.br
\(br \(sq
.br
\l'0.08i'
.br
shift <-> to </> \(br
.br
.ta
.ta 0i 0.24i 0.8i 2.32i
.br
\(br <D> change decimal pt\. \(br
.br
.ta
.ta 0i 0.24i 0.8i 2.32i
.br
\(br <M> move ADDER \(br
.br
.ta
.ta 0i 0.24i 0.8i 2.32i
.br
\(br <T> display tape \(br
.br
.ta
.ta 0i 0.24i 0.8i 2.32i
.br
\(br <S> scroll tape disp\. \(br
.br
.ta
.ta 0i 2.32i
.br
\(br <DEL>
.br
\l'0.4i'
.br
1st Clear entry \(br
.br
.ta
.ta 0i 0.8i 2.32i
.br
\(br \(sq
.br
\l'0.08i'
.br
2nd Clear ADDER \(br
.br
.ta
.ta 0i 0.8i 2.32i
.br
\(br <ESC> to Quit \(br
.br
.ta
.ta 0i 0.8i 2.32i
.br
\(br <F10> to Return Total \(br
.br
.ta
.ta 0i 0.96i 2.32i
.br
\(br to program \(br
.br
.ta
.ta 0i 2.32i
.br
\(br \(br
.br
.ta
.br
\(sq
.br
\l'0.32i'
.br
Any Key to Continue
.br
\l'0.24i'
.br
\(sq
.sp
.sp
.sp
.in 0.48i
A couple of notes about the adder:
.sp
.sp
1\.) It was designed to be used on an Enhanced keyboard with
.in 0.8i
separate <DELETE> key\. <DELETE> is used to clear the adder\.
However, it will still work on a Standard keyboard\.
.sp
.in 0.48i
2\.) It uses the <SPACE> bar to shift from Add/Subtract
.in 0.8i
mode to Multiply/Divide\. That means the <+> and <-> keys
become the <*> and </> keys\.
.sp
.in 0.48i
3\.) You do not have to display the tape\. You may turn it on
.in 0.8i
at any time by pressing <T>\. You may SCROLL back through
the tape once there are more than 16 entries in the
adder, by pressing <S>\.
.sp
.in 0.48i
4\.) To Quit the Adder just press <ESC>\. To return your Total
.in 0.8i
to the application press <F10>\. The adder will place the
Total in the active GET variable using oGet:VarPut()\. The
adder will only return a Total to a numerical GET!
.sp
.in 0.48i
5\.) There are many support functions that you might find
.in 0.8i
interesting\. They are part of my personal library, but
are necessary to the operation of the adder\.
You might want to pull these out to reduce the overall
size of the adder\. Many are worth at least a little
time studying\.
.sp
.in 0.48i
6\.) To make FT_Adder a Hot key from inside your application
.in 0.8i
at the beginning of your application add the line:
.sp
.in 1.36i
.ta 1.36i
SET KEY K_ALT_A TO FT_Adder
.br
.ta
.sp
.in 0.8i
This will make <ALT-A> a key "Hot" and permit you to
Pop - Up the adder from anywhere in the application\.
.sp
.in 0.48i
7\.) If you use the UDF replacement for INKEY() that Don Caton
.in 0.8i
posted on Nanforum (see FT_SINKEY()), you can even have
active hotkeys in an INKEY()\.
.sp
.sp
.sp
.sp
.sp
.in 0.08i
\fBExamples
.sp
.sp
.sp
\fBHeader File:\fR INKEY\.CH, SE
.sp
\fBSource:\fR POPADDER\.PRG
.sp
\fBAuthor:\fR Keith A\. Wire
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BLINK() Display a blinking message on the screen
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BLINK()
Display a blinking message on the screen
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BLINK( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cMsg>\fR is the string to blink\.
.sp
\fB<nRow>\fR is an optional screen row for @\.\.\.SAY, default current\.
.sp
\fB<nCol>\fR is an optional screen col for @\.\.\.say, default current\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
A quick way to blink a msg on screen in the CURRENT colors\.
Restores colors on return\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.ta 2.24i
.br
FT_BLINK( "WAIT", 5, 10 ) // Blinks "WAIT" in current colors @ 5,10
.br
.ta
.sp
.br
@5,10 SAY "WAIT - Printing Report"
.ta 2.24i 2.56i
.br
FT_BLINK( "\.\.\." ) // Blink "\.\.\." after wait message\.\.\.
.br
.ta
.sp
.in 0.08i
\fBSource:\fR BLINK\.PRG
.sp
\fBAuthor:\fR Terry Hackett
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BRWSWHL() Browse an indexed database limited to a while condition
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BRWSWHL()
Browse an indexed database limited to a while condition
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.ta 4.96i
.br
\fBFT_BRWSWHL( <aFields>, <bWhileCond>, <cKey>, ;
.br
.ta
.in 1.36i
.br
\fB[ <nFreeze> ], [ <lSaveScrn> ], [ <cColorList> ], ;
.ta 4i
.br
\fB[ <cColorShadow> ], [ <nTop> ], [ <nLeft> ], ;
.br
.ta
.br
\fB[ <nBottom> ], [ <nRight> ] -> nRecno
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<aFields>\fR is array of field blocks of fields you want to display\.
.in 0.64i
Example to set up last name and first name in array:
.br
aFields := {}
.ta 3.68i
.br
AADD(aFields, {"Last Name" , {||Names->Last} } )
.br
.ta
.br
AADD(aFields, {"First Name", {||Names->First} } )
.sp
.in 0.4i
\fB<bWhileCond>\fR is the limiting WHILE condition as a block\.
.in 0.64i
.br
Example 1: { ||Names->Last == "JONES" }
.ta 5.2i
.br
Example 2: { ||Names->Last == "JONES" \.AND\. Names->First == "A" }
.br
.ta
.sp
.in 0.4i
\fB<cKey>\fR is the key to find top condition of WHILE\.
.in 0.64i
.ta 0.56i 1.68i
.br
cLast := "JONES "
.br
.ta
.br
cFirst := "A"
.br
Example 1: cKey := cLast
.br
Example 2: cKey := cLast + cFirst
.sp
.in 0.4i
\fB<nFreeze>\fR is number of fields to freeze in TBrowse\. Defaults
to 0 if not passed\.
.sp
\fB<lSaveScrn>\fR is a logical indicating whether or not you want to
save the screen from the calling program\. Defaults to \.T\. if
not passed\.
.sp
\fB<cColorList>\fR is a list of colors for the TBrowse columns\.
The 1st color is used as SAY/TBrowse Background and the
3rd and 4th colors are used as part of column:defColor := {3, 4}
.sp
Thus if you pass a cColorList, you MUST pass at least 4 colors\.
Defaults to "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R" if not passed\.
.sp
\fB<cColorShad>\fR is the color of the TBrowse box shadow\. Defaults
to "N/N" if not passed\.
.sp
\fB<nTop>\fR, \fB<nLeft>\fR, \fB<nBottom>\fR, \fB<nRight>\fR are the coordinates of
the area to display the TBrowse in\. Defaults to 2, 2,
MAXROW() - 2, MAXCOL() - 2 with shadowed box, i\.e\. full screen\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
nRecno is the number of the record selected by the <Enter> key\.
0 is returned if there are either no records matching the WHILE
condition or an <Esc> is pressed instead of an <Enter>
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This is a demonstration of TBrowse with a WHILE condition for an
indexed database\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
* This example will only show those people with last name of "JONES"
.br
* in the TBNames\.dbf which contains at least the fields:
.br
* Last, First, City AND is indexed on Last + First\.
.ta 1.36i
.br
LOCAL nRecSel := 0
.br
.ta
.ta 1.36i
.br
LOCAL aFields := {}
.br
.ta
.ta 1.36i
.br
LOCAL bWhile := {||TBNames->Last = "JONES"}
.br
.ta
.ta 1.36i
.br
LOCAL cKey := "JONES"
.br
.ta
.ta 1.36i
.br
LOCAL nFreeze := 1
.br
.ta
.ta 1.36i
.br
LOCAL lSaveScrn := \.t\.
.br
.ta
.br
LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R"
.br
LOCAL cColorShad := "N/N"
.sp
.br
USE TBNames INDEX TBNames NEW // indexed on Last + First
.sp
.br
* Pass Heading as character and Field as Block including Alias
.br
* To eliminate the need to use FIELDWBLOCK() function in FT_BRWSWHL()
.ta 3.84i
.br
AADD(aFields, {"Last Name" , {||TBNames->Last} } )
.br
.ta
.br
AADD(aFields, {"First Name", {||TBNames->First} } )
.ta 2.16i 3.84i
.br
AADD(aFields, {"City" , {||TBNames->City} } )
.br
.ta
.sp
.br
IF FT_BRWSWHL( aFields, bWhile, cKey, nFreeze, lSaveScrn, ;
.in 0.64i
.br
cColorList, cColorShad, 3, 6, MaxRow() - 2, MaxCol() - 6) == 0
.br
? "Sorry, NO Records Were Selected"
.in 0.4i
.br
ELSE
.in 0.64i
.br
? "You Selected: " + TBNames->Last +" "+ ;
.in 0.88i
.br
TBNames->First +" "+ TBNames->City
.in 0.4i
.br
ENDIF
.sp
.in 0.08i
\fBSource:\fR TBWHILE\.PRG
.sp
\fBAuthor:\fR Jim Orlowski
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_CLRSEL() User Selectable Colour Routine
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_CLRSEL()
User Selectable Colour Routine
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.ta 4.4i
\fBFT_ClrSel( <aClrData>, [ <lClrMode> ], [ <cTestChr> ] -> aClrData
.br
.ta
.sp
.in 0.08i
\fBArguments
.sp
.sp
.in 0.4i
\fB<aClrData>\fR is an array of subarrays, with each subarray containing
.in 0.64i
information about the colour settings\.
.sp
The subarray has the following structure:
.sp
.in 0.72i
.ta 0.4i 1.12i
[1] cName is the name of this colour setting i\.e\. "Pick List"
.br
.ta
.in 1.36i
Maximum length is 20 bytes
.sp
.in 0.72i
.ta 0.4i 1.12i
[2] cClrStr is the current colour string
.br
.ta
.in 1.36i
Default is "W/N,N/W,N/N,N/N,N/W"
.sp
If Setting type is "M" (Menu) the colours are\.\.\.
.in 1.6i
.br
1\. Prompt Colour
.br
2\. Message Colour
.br
3\. HotKey Colour
.br
4\. LightBar Colour
.br
5\. LightBar HotKey Colour
.sp
.in 1.36i
Note: While there are many ways to code the individual
.in 1.6i
.ta 1.76i
colour combinations, they should be in the same
.br
.ta
format that gets returned from SETCOLOR(), so
the defaults can be found in the colour palette\.
.sp
foreground [+] / background [*]
i\.e\. "GR+/BG*, N/W*, N+/N, , W/N"
.sp
.in 0.72i
.ta 0.4i 0.96i
[3] cType is the type of colour setting
.br
.ta
.in 1.36i
Default is "W" (Window)
.sp
.in 1.6i
.ta 1.12i
.br
T = Title Only 1 colour element
.br
.ta
.ta 1.12i
.br
D = Desktop Background colour and character
.br
.ta
.ta 1.12i
.br
M = Menu For FT_Menuto() style menus
.br
.ta
.ta 1.12i
.br
W = Window Windows with radio buttons
.br
.ta
.ta 1.12i
.br
G = Get For use with @ SAY\.\.\.
.br
.ta
.ta 1.12i
.br
B = Browse For tBrowse() and *dbEdit()
.br
.ta
.ta 1.12i
.br
A = aChoice Pick-lists etc\.\.\.
.br
.ta
.sp
.in 1.36i
W/G/B/A are functionally the same but will provide
a more appropriate test display\.
.sp
.in 0.72i
.ta 0.4i 1.28i
[4] cFillChar is the character (for desktop background only)
.br
.ta
.in 1.36i
Default is CHR(177) "\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq"
.sp
.sp
.in 0.4i
.ta 1.04i
\fB<lClrMode>\fR \.T\. use colour palette
.br
.ta
.in 1.36i
\.F\. use monochrome palette
.sp
Default is the ISCOLOR() setting
.sp
.in 0.4i
.ta 0.96i
\fB<cTestChr>\fR 2 Byte character string for colour test display
.br
.ta
.sp
.in 1.36i
.ta 2.72i
Default is the CHR(254)+CHR(254) "\(sq\(sq\(sq\(sq\(sq\(sq"
.br
.ta
.sp
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
An array identical to the one passed, with new selected colours
.sp
.in 0.08i
\fBDescription
.sp
.in 0.56i
This function allows users to select their own colour combinations
.in 0.4i
for all the different types of screen I/O in a typical application\.
This facilitates an easy implementation of Ted Means\' replacement
.ta 0.64i
of the @\.\.PROMPT/MENU TO found in the NanForum Toolkit\. If you are
.br
.ta
not using FT_MENUTO(), you can specify "A" for setting type and have
a normal colour string returned\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.ta 1.12i
.br
LOCAL aClrs := {}
.br
.ta
.br
LOCAL lColour := ISCOLOR()
.ta 1.12i
.br
LOCAL cChr := CHR(254) + CHR(254)
.br
.ta
.sp
.br
SET SCOREBOARD Off
.ta 1.76i
.br
SETBLINK( \.F\. ) // Allow bright backgrounds
.br
.ta
.sp
.br
*\.\.\.\. a typical application might have the following different settings
.ta 0.48i
.br
* normally these would be stored in a \.dbf/\.dbv
.br
.ta
.br
aClrs := {;
.in 0.64i
.ta 1.6i 4.16i
.br
{ "Desktop", "N/BG", "D", "\(sq" }, ;
.br
.ta
.ta 1.6i 4.16i 4.88i
.br
{ "Title", "N/W", "T" }, ;
.br
.ta
.ta 1.6i 4.16i 4.88i
.br
{ "Top Menu", "N/BG,N/W,W+/BG,W+/N,GR+/N", "M" }, ;
.br
.ta
.ta 1.6i 4.88i
.br
{ "Sub Menu", "W+/N*,GR+/N*,GR+/N*,W+/R,G+/R","M" }, ;
.br
.ta
.ta 1.6i 2.16i 4.16i 4.88i
.br
{ "Standard Gets", "W/B, W+/N,,, W/N", "G" }, ;
.br
.ta
.ta 1.6i 4.16i 4.88i
.br
{ "Nested Gets", "N/BG, W+/N,,, W/N", "G" }, ;
.br
.ta
.ta 1.6i 2.16i 4.16i 4.88i
.br
{ "Help", "N/G, W+/N,,, W/N", "W" }, ;
.br
.ta
.ta 4.16i 4.88i
.br
{ "Error Messages", "W+/R*,N/GR*,,,N/R*", "W" }, ;
.br
.ta
.ta 4.16i 4.88i
.br
{ "Database Query", "N/BG, N/GR*,,,N+/BG", "B" }, ;
.br
.ta
.ta 1.6i 4.16i 4.88i 5.12i
.br
{ "Pick List", "N/GR*,W+/B,,, BG/GR*", "A" } ;
.br
.ta
.in 1.12i
.br
}
.sp
.in 0.32i
.br
aClrs := FT_ClrSel( aClrs, lColour, cChr )
.sp
.in 0.08i
\fBSource:\fR CLRSEL\.PRG
.sp
\fBAuthor:\fR Dave Adams
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_DISPMSG() Display a message and optionally waits for a keypress
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_DISPMSG()
Display a message and optionally waits for a keypress
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.br
\fBFT_DISPMSG( <aMessageArray>, [ <cKey2Check> ],
.in 1.36i
.br
\fB[ <nTopBoxRow> ], [ <nLeftBoxColumn> ],
.br
\fB[ <cBoxType> ], [ <lShadow> ] ) -> lKeyMatch
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<aMessageArray>\fR is a multidimensional array of messages to be
displayed and the color attributes for each message\.
.sp
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\.
.sp
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\.
.sp
\fB<Key2Check>\fR 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\.
.sp
\fB<nTopBoxRow>\fR is the upper row for the message box\. If omitted, the
box is centered vertically\.
.sp
\fB<nLeftBoxColumn>\fR is the leftmost column for the box\. If omitted, the
box is centered horizontally\.
.sp
\fB<cBoxType>\fR is a string of characters or a variable for the box
border\. See the @\.\.\.BOX command\. If omitted, a double box is
drawn\.
.sp
\fB<lShadow>\fR 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\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
If <Key2Check> is not specified, FT_DISPMSG() will return false
(\.F\.)\.
.sp
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\.
.sp
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\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
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\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
The following example displays a simple two-line message
and returns immediately to the calling routine\.
.sp
.in 0.64i
.ta 4.24i
.br
FT_DISPMSG( { { "Printing Report" , ;
.br
.ta
.in 1.92i
.ta 2.96i
.br
"Press [ESC] To Interrupt" } , ;
.br
.ta
.in 1.76i
.br
{ "W+/B*", "W/B", "GR+/B" } } )
.sp
.in 0.4i
The next example displays a message and waits for a key press\.
.sp
.in 0.64i
.ta 4.24i
.br
FT_DISPMSG( { { "Press [D] To Confirm Deletion" , ;
.br
.ta
.in 1.92i
.ta 2.96i
.br
"Or Any Other Key To Abort" } , ;
.br
.ta
.in 1.76i
.ta 3.12i
.br
{ "W+/B", "W+/B", "GR+/B" } } , ;
.br
.ta
.br
"D" )
.sp
.in 0.4i
The next example displays a one-line message centered on row 5
and returns to the calling procedure\.
.sp
.in 0.64i
.ta 3.68i
.br
FT_DISPMSG( { { "Please Do Not Interrupt" } , ;
.br
.ta
.in 1.76i
.ta 2.48i
.br
{ "W+/B", "GR+/B" } } , ;
.br
.ta
.br
, 5, )
.sp
.in 0.08i
\fBSource:\fR DISPMSG\.PRG
.sp
\fBAuthor:\fR Paul Ferrara
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_FILL() Declare menu options for FT_MENU1()
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_FILL()
Declare menu options for FT_MENU1()
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_FILL( <aSubArrayName>, <cMenuSelection>, <bFunction>,
.in 1.12i
\fB<lSelectable> ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<aSubArrayName>\fR is a sub-array of \fB<acOptions>\fR in FT_MENU1()
denoting the group in which to include the selection --
e\.g\., acOptions[1]
.sp
\fB<cMenuSelection>\fR is the character string that will appear on
the menu\.
.sp
\fB<bFunction>\fR is the code block to be executed when that menu
option is selected\. i\.e\. {|| MyFunction() } would execute
the function called MyFunction()\. {|| \.f\.} would exit the
.ta 3.68i
FT_MENU1 and return to the calling routine\. {|| \.T\.} would
.br
.ta
do nothing\.
.sp
\fB<lSelectable>\fR is a logical variable that determines whether
the corresponding menu option is selectable or not\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_FILL() is a function used to set up the menu options prior
to calling FT_MENU1()\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.16i
FT_FILL( aOptions[1], \'A\. Execute A Dummy Procedure\' , {|| fubar()}, \.t\. )
.sp
The above would be added to the sub-menu associated with the first menu
bar item, would execute the function FUBAR() when that option was
selected, and would be selectable\.
.sp
.sp
.ta 4.24i 5.52i
FT_FILL( aOptions[3], \'B\. Enter Daily Charges\' , {|| \.t\.}, \.f\. )
.br
.ta
.sp
The above would be added to the sub-menu associated with the third menu
bar item, and would be unselectable\.
.sp
.sp
.ta 5.52i
FT_FILL( aOptions[2], \'C\. Enter Payments On Accounts\', {|| \.t\.}, \.t\. )
.br
.ta
.sp
The above would be added to the sub-menu associated with the second menu
bar item, and would be selectable, but would do nothing when selected\.
.sp
.sp
.ta 4.24i 5.52i
FT_FILL( aOptions[4], \'C\. Exit\' , {|| \.f\.}, \.t\. )
.br
.ta
.sp
The above would be added to the sub-menu associated with the fourth menu
bar item, and would be selectable, and would exit FT_MENU1() when chosen\.
.sp
.in 0.08i
\fBSource:\fR MENU1\.PRG
.sp
\fBAuthor:\fR Paul Ferrara
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_MENU1()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_MENU1() Pulldown menu system
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_MENU1()
Pulldown menu system
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_MENU1( <acBarNames>, <acOptions>, <acAction>,
.in 1.2i
\fB<acColors> [, <nTopRow> ], [ <lShadow> ] ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<acBarNames>\fR is a character array containing the names to appear
on the menu bar\.
.sp
\fB<acOptions>\fR is a multi-dimensional array with one element for each
selection to appear on the pulldown menus\.
.sp
\fB<acColors>\fR is an array containing the colors for the menu groups\.
.sp
\fB<nTopRow>\fR is a numeric value that determines the row for the menu
bar\. If omitted, it defaults to 0\.
.sp
\fB<lShadow>\fR is a logical variable\. If true (\.T\.) or omitted, it
uses FT_SHADOW() to add a transparent shadow to the each
pulldown menu\. If false (\.F\.), the menu is drawn without
the shadow\.
.sp
All arguments except nTopRow and lShadow are required\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_MENU1() is a function that displays a pulldown menu for each item
on the menu bar and executes the corresponding function for the item
selected\. When a called function returns false, FT_MENU1 returns
control to the calling program\.
.sp
Valid keystrokes and their corresponding actions:
.sp
.ta 1.36i 1.6i
Home - Activates Pulldown for first item on the menu bar
.br
.ta
.ta 1.36i 1.6i
End - Activates Pulldown for last item on the menu bar
.br
.ta
.ta 1.36i 1.6i
Left Arrow - Activates next Pulldown to the left
.br
.ta
.ta 1.36i 1.6i
Right Arrow - Activates next Pulldown to the right
.br
.ta
.ta 1.36i 1.6i
Tab - Same as Right Arrow
.br
.ta
.ta 1.36i 1.6i
Shift-Tab - Same as Left Arrow
.br
.ta
.ta 1.36i 1.6i
Page Up - Top item on current Pulldown menu
.br
.ta
.ta 1.36i 1.6i
Page Down - Bottom item on current Pulldown menu
.br
.ta
.ta 1.36i 1.6i
Enter - Selects current item
.br
.ta
.ta 1.36i 1.6i
Alpha Character - Moves to closest match and selects
.br
.ta
.ta 1.36i 1.6i
Alt-<Key> - Moves to corresponding menu bar item
.br
.ta
.ta 1.36i 1.6i
Escape - Prompts for confirmation and either returns to
.br
.ta
.in 2i
the calling routine or resumes
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
// Declare arrays
.ta 1.2i
.br
LOCAL aColors := {}
.br
.ta
.ta 1.2i
.br
LOCAL aBar := { " ENTER/EDIT ", " REPORTS ", " DISPLAY " }
.br
.ta
.sp
.br
// Include the following two lines of code in your program, as is\.
.br
// The first creates aOptions with the same length as aBar\. The
.br
// second assigns a three-element array to each element of aOptions\.
.br
LOCAL aOptions[ LEN( aBar ) ]
.br
AEVAL( aBar, { |x,i| aOptions[i] := { {},{},{} } } )
.sp
.br
// fill color array
.br
// Box Border, Menu Options, Menu Bar, Current Selection, Unselected
.br
aColors := IF( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ;
.in 2.24i
.br
{"W+/N", "W+/N", "W/N", "N/W","W/N"} )
.sp
.in 0.16i
.br
// array for first pulldown menu
.br
FT_FILL( aOptions[1], \'A\. Execute A Dummy Procedure\' , {|| fubar()}, \.t\. )
.ta 4.24i 5.52i
.br
FT_FILL( aOptions[1], \'B\. Enter Daily Charges\' , {|| \.t\.}, \.f\. )
.br
.ta
.ta 5.52i
.br
FT_FILL( aOptions[1], \'C\. Enter Payments On Accounts\', {|| \.t\.}, \.t\. )
.br
.ta
.sp
.br
// array for second pulldown menu
.ta 4.24i 5.52i
.br
FT_FILL( aOptions[2], \'A\. Print Member List\' , {|| \.t\.}, \.t\. )
.br
.ta
.ta 5.52i
.br
FT_FILL( aOptions[2], \'B\. Print Active Auto Charges\' , {|| \.t\.}, \.t\. )
.br
.ta
.sp
.br
// array for third pulldown menu
.ta 5.52i
.br
FT_FILL( aOptions[3], \'A\. Transaction Totals Display\', {|| \.t\.}, \.t\. )
.br
.ta
.ta 4.24i 5.52i
.br
FT_FILL( aOptions[3], \'B\. Display Invoice Totals\' , {|| \.t\.}, \.t\. )
.br
.ta
.ta 4.24i 5.52i
.br
FT_FILL( aOptions[3], \'C\. Exit To DOS\' , {|| \.f\.}, \.t\. )
.br
.ta
.sp
.in 0.4i
Call FT_FILL() once for each item on each pulldown menu, passing it
three parameters:
.sp
.in 0.64i
FT_FILL( <cMenuSelection>, <bCodeBlock>, <lSelectable>
.sp
.in 0.4i
<cMenuSelection> is a character string which will be displayed on
.in 0.48i
the pulldown menu\.
.sp
.in 0.4i
<bCodeBlock> should contain one of the following:
.sp
.in 0.64i
A function name to execute, which in turn should return \.T\. or \.F\.
FT_MENU1 WILL RETURN CONTROL TO THE CALLING PROGRAM IF \.F\. IS
RETURNED OR CONTINUE IF \.T\. IS RETURNED\.
.sp
\.F\. WHICH WILL CAUSE FT_MENU1 TO RETURN CONTROL TO THE CALLING
PROGRAM\.
.sp
\.T\. WHICH WILL DO NOTHING\. THIS ALLOWS THE DEVELOPER TO DESIGN A
SKELETON MENU STRUCTURE PRIOR TO COMPLETING ALL OF THE SUBROUTINES\.
.sp
.in 0.4i
.br
// CALL FT_MENU1
.br
FT_MENU1( aBar, aOptions, aColors, 0 )
.sp
NOTE: FT_MENU1() disables Alt-C and Alt-D in order to make them
.in 0.88i
available for the menu bar\. It enables Alt-D and resets
Alt-C to its previous state prior to calling each function\.
.sp
.in 0.08i
\fBSource:\fR MENU1\.PRG
.sp
\fBAuthor:\fR Paul Ferrara
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_FILL()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_MENU2() Vertical lightbar menu
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_MENU2()
Vertical lightbar menu
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_MENU2( <aMenuarray> [, <cColors> ] ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<aMenuarray>\fR is an array of menu options, messages, and action
.in 0.48i
blocks\.
.sp
.in 0.4i
Each element in this array is a nested array with the structure:
.sp
.in 0.64i
.br
element[x, 1] = menu option
.br
element[x, 2] = message to be displayed when option is highlighted
.br
element[x, 3] = code block to be executed when option is selected
.sp
.in 0.4i
\fB<cColors>\fR is a string containing colors for the prompts, in the same
format as that returned by Set( _SET_COLOR )\. If not supplied,
colors default to the current color setting\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function greatly simplifies the process of displaying light-bar
menus\. All prompts are padded out with spaces so they are the same
length, a box is drawn around the prompts, the box is automatically
centered on the screen, and the underlying screen is restored after
a menu selection has been made\.
.sp
Additionally, because you can tie action blocks to each menu
option, you can save on a lot of DO CASE or IF\.\.ELSEIF code in your
main program\. See the test code for a succinct demonstration\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.48i
.br
LOCAL mainmenu := ;
.in 0.8i
.ta 2.72i 4.72i
.br
{ { "Data Entry", "Enter data", { || FT_MENU2(datamenu) } }, ;
.br
.ta
.in 0.96i
.ta 1.28i 2.56i 4.56i
.br
{ "Reports", "Hard copy", { || FT_MENU2(repmenu) } }, ;
.br
.ta
.br
{ "Maintenance","Reindex files",{ || FT_MENU2(maintmenu) } }, ;
.br
{ "Quit", "See ya later" } }
.in 0.48i
.br
FT_MENU2(mainmenu)
.sp
.in 0.08i
\fBSource:\fR VERTMENU\.PRG
.sp
\fBAuthor:\fR Greg Lief
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_MENUTO() Execute light bar menu using prompts created with FT_PROMPT(
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_MENUTO()
Execute light bar menu using prompts created with FT_PROMPT(
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_MENUTO( <bVarNameBlock>, <cVarName>, ;
.in 1.2i
\fB[ <lNoSnow> ], [ <lKeep> ], [ <lCold> ]) -> nChoice
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<bVarNameBlock>\fR is a "get-set" code block which allows the
retrieval and assignment of the variable which will receive
the return value\. Its initial value is used to determine the
initial active prompt\.
.sp
The code block must be in the form:
.sp
.in 0.64i
{|_1| IIF( _1 == NIL, \fB<var>\fR, \fB<var>\fR := _1 ) }
.sp
.in 0.4i
For example, if the variable to receive the return value is
named "nChoice", the code block would look like:
.sp
.in 0.64i
{|_1| IIF( _1 == NIL, nChoice, nChoice := _1 ) }
.sp
.in 0.4i
Although it is good practice to always declare your variables,
the variable to receive the return value does not need to exist
before calling FT_MENUTO()\. If it does exist and is a numeric,
its value will be used to determine the initial prompt\. If it
does not exist, the initial prompt will default to the first one\.
.sp
If you use this function by way of the MENU TO command along with
the FTMENUTO\.CH header file, this code block will automatically
be created for you by the preprocessor\.
.sp
\fB<cVarName>\fR is the name of the memvar to which the menu
choice is returned\.
.sp
\fB<lNoSnow>\fR is optional and specifies whether or not to
implement snow-suppression on CGA monitors\. The default is
\.F\., meaning that no snow-suppression will occur\. This
option is only meaningful for CGA displays\.
.sp
\fB<lKeep>\fR is optional and indicates whether or not to destroy
the prompt list once the menu has been executed\. If \.T\.,
then the prompts will be kept, allowing the menu to be
executed multiple times without redefining the prompts\. The
default is \.F\., meaning the prompts will be destroyed once
the menu has executed\.
.sp
\fB<lCold>\fR is optional and controls the operation of the
hotkeys\. If \.T\., then pressing a hotkey will not result in
a menu selection\. Instead, it merely changes the active
prompt\. This allows more than one prompt to have the same
hotkey\. The default is \.F\., meaning the hotkeys will
function the same way they do in Clipper\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
A numeric value representing the menu choice selected, or zero
if the ESC key was used to exit the menu\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function is a replacement for Clipper\'s MENU TO
command\. In fact, you may wish to consult TMENU\.CH, which
contains a user-defined command that closely adheres to
standard Clipper syntax and makes this function infinitely
easier to use\. I strongly recommend using the command
version because it is complementary to the associated
@\.\.\.PROMPT command\.
.sp
This function is very similar to the Clipper version\. The
main differences are that you have more control over hotkey
operation, and you can keep the prompts alive after the menu
has executed, if you so desire\. Please be aware that this
function does not qualify as a "wait state" and so do not
expect any wait state-associated activity to occur\.
Nevertheless, I have included support for any SET KEY
redirections through the magic of code blocks\. A loop is
used to check to every possible INKEY() value to see if it
has been redirected\. This is necessary because Clipper
provides no way to check SET KEY status\. If you\'re
interested in improving performance, alter the source code
to receive an array of keys that have been redirected, and
remove the previously mentioned loop\. Using the loop does
make the routine a bit more generic, so it\'s a trade-off\.
Your call, do as you see fit\.
.sp
Note that this function calls an internal routine called
__FTMENUTO()\. __FTMENUTO() was written in assembler\. Check
the file TMENU\.ASM if you\'re interested in seeing the
assembler source code\.
.sp
All the examples below use the command version\. If you\'re
interested in seeing the function version, compile the
examples with the /P switch and then examine the resulting
\.PPO file\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.32i
.br
#include "FTMENUTO\.CH"
.br
// Simple command
.br
MENU TO memvar
.sp
.br
// Implement snow-checking for CGA
.br
MENU TO memvar NOSNOW
.sp
.br
// Keep the prompts alive when finished
.br
MENU TO memvar KEEP
.sp
.br
// Use "cold" hotkeys
.br
MENU TO memvar COLD
.sp
.in 0.08i
\fBSource:\fR MENUTO\.PRG
.sp
\fBAuthor:\fR Ted Means
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_PROMPT()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_PENDING() Display same-line pending messages after a wait\.
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_PENDING()
Display same-line pending messages after a wait\.
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_PENDING ( <cMsg>, [ <nRow> ], [ <nCol> ], ;
.in 1.84i
\fB[ <nWait> ], [ <cColor> ] ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cMsg>\fR is the message string to display\.
.sp
\fB<nRow>\fR is an optional screen row for message display, default row 24\.
.sp
\fB<nCol>\fR is an optional screen col for message display, default col 0\.
.sp
\fB<nWait>\fR is an optional wait (sec) between messages, default 5 sec\.
.sp
\fB<cColor>\fR is an optional color string for displayed messages, default
.in 1.12i
is white text over red background\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
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\.
.sp
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\.
.sp
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
FT_PENDING("Message one",20,0,3,"W+/G") // Displays "Message one\."
.in 3.6i
.br
// sets row to 20, col to 0\.
.br
// wait to 3 and color to
.br
// bright white over green\.
.in 0.4i
.ta 2.24i
.br
FT_PENDING("Message two") // Displays "Message two", after 5 sec\.
.br
.ta
.br
FT_PENDING("Message three") // Displays "Message three", after 5 sec\.
.sp
.sp
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\.
.sp
.sp
.in 0.08i
\fBSource:\fR PENDING\.PRG
.sp
\fBAuthor:\fR Isa Asudeh
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_PICKDAY() Picklist of days of week
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_PICKDAY()
Picklist of days of week
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_PICKDAY() -> cDayOfWeek
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Character string containing day of week
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function is ideal if you need the user to select a day\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
mday := FT_PICKDAY()
.sp
.in 0.08i
\fBSource:\fR PICKDAY\.PRG
.sp
\fBAuthor:\fR Greg Lief
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_PROMPT() Define a menu item for use with FT_MENUTO()
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_PROMPT()
Define a menu item for use with FT_MENUTO()
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.ta 3.12i
.br
\fBFT_PROMPT( <nPromptRow>, ;
.br
.ta
.in 1.28i
.ta 2.24i
.br
\fB<nPromptCol>, ;
.br
.ta
.ta 2.24i
.br
\fB<cPrompt>, ;
.br
.ta
.in 1.12i
.ta 2.4i
.br
\fB[ <cPromptColor> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <nMessageRow> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <nMessageCol> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <cMessage> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <cMessageColor> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <nHotKeyPosition> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <cHotKeyColor> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <cLightBarColor> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <cLightBarHotKeyColor> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <nUp> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <nDown> ], ;
.br
.ta
.ta 2.4i
.br
\fB[ <nRight> ], ;
.br
.ta
.ta 1.84i
.br
\fB[ <nLeft> ] ) -> NIL
.br
.ta
.in 0i
.br
\fB
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<nPromptRow>\fR is the row at which the prompt is to appear\.
.sp
\fB<nPromptCol>\fR is the column at which the prompt will appear\.
.sp
\fB<cPrompt>\fR is the prompt\'s text\.
.sp
\fB<cPromptColor>\fR is optional and is the color attribute of the
prompt\. If not specified, the default is the current
standard color as supplied by the SetColor() function\.
.sp
\fB<nMessageRow>\fR 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\.
.sp
\fB<nMessageCol>\fR is optional and is the column at which the
message, if any, will appear\. If not specified, the default
either zero or centered, depending on the current setting of
the CENTER option of the SET MESSAGE TO command\.
.sp
\fB<cMessage>\fR is optional and is the message associated with
the prompt\. If not specified, then no message will be displayed\.
.sp
\fB<cMessageColor>\fR is optional and is the color attribute of
the message\. If not specified, the default is the current
standard color as reported by the SetColor() function\.
.sp
\fB<nHotKeyPosition>\fR is optional and is the position within the
prompt string where the hotkey is located\. If not
specified, the default is 1\.
.sp
\fB<cHotKeyColor>\fR is optional and is the color attribute of the
hotkey character\. If not specified, the default is the same
color as the rest of the prompt\.
.sp
\fB<cLightBarColor>\fR is optional and is the color attribute of
the light bar when it is positioned on this prompt\. If not
specified, the default is the current enhanced color setting
as returned by the SetColor() function\.
.sp
\fB<cLightBarHotKeyColor>\fR is optional and is the color
attribute of the hotkey when the light bar is positioned on
this prompt\. If not specified, the default is the same
color as the rest of the light bar\.
.sp
\fB<nUp>\fR 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\.
.sp
\fB<nDown>\fR 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\.
.sp
\fB<nRight>\fR 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\.
.sp
\fB<nLeft>\fR 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\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function is a replacement for Clipper\'s @\.\.\.PROMPT
command\. In fact, you may wish to consult FTMENUTO\.CH, which
contains a user-defined command that closely adheres to
standard Clipper syntax and makes this function infinitely
easier to use\. I strongly recommend using the command
version because the large number of possible arguments makes
the function version too prone to error\.
.sp
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\.
.sp
Note that this function calls an internal routine called
__FTPROMPT()\. __FTPROMPT() was written in assembler\. Check
the file TMENU\.ASM if you\'re interested in seeing the
assembler source code\.
.sp
All the examples below use the command version\. If you\'re
interested in seeing the function version, compile the
examples with the /P switch and then examine the resulting
\.PPO file\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.32i
.br
#include "FTMENUTO\.CH"
.br
// Simple prompt
.br
@ 1, 1 PROMPT "Menu choice #1"
.sp
.br
// Prompt with color
.br
@ 3, 1 PROMPT "Menu choice #2" PROMPTCOLOR W+/R
.sp
.br
// Prompt with a message
.br
@ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch"
.sp
.br
// Prompt with pinpoint message control
.br
@ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ;
.in 1.52i
.br
MSGROW 22 MSGCOL 4 MSGCOLOR GR+/N
.sp
.in 0.32i
.br
// Prompt with a unique lightbar color
.br
@ 9, 1 PROMPT "Menu choice #5" BARCOLOR BG+/W
.sp
.br
// Prompt with a hotkey ("#" character)
.br
@11, 1 PROMPT "Menu choice #6" HOTKEY 13
.sp
.br
// Prompt with pinpoint hotkey control
.br
@13, 1 PROMPT "Menu Choice #7" HOTKEY 13 ;
.in 1.52i
.br
HOTKEYCOLOR R+/BG BARHOTKEYCOLOR G+/N
.sp
.in 0.32i
.br
// Prompt with right and left arrow keys disabled
.br
@15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8
.sp
.in 0.08i
\fBSource:\fR ATPROMPT\.PRG
.sp
\fBAuthor:\fR Ted Means
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
MENU TO
, @\.\.\.PROMPT
, FT_MENUTO()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_XBOX() Display a self-sizing message box and message
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_XBOX()
Display a self-sizing message box and message
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.ta 4.8i
.br
\fBFT_XBOX( [ <cJustType> ], [ <cRetWait> ], [ <cBorType> ], ;
.br
.ta
.in 1.12i
.br
\fB[ <cBorColor> ], [ <cBoxColor> ], [ <nStartRow> ], ;
.ta 2.24i 4.08i
.br
\fB[ <nStartCol> ], <cLine1>, <cLine2>, <cLine3>, ;
.br
.ta
.br
\fB<cLine4>, <cLine5>, <cLine6>, <cLine7>, <cLine8> ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cJustType>\fR is a character indicating the type of text justification\.
"L" or "l" will cause the text to be left-justified in the box\.
Centered text is the default\.
.sp
\fB<cRetWait>\fR is a character which determines if the function will wait
for a keypress after displaying the box\. "W" or "w" will cause the
function to wait for a keypress before returning control to the
calling routine\. Not waiting is the default
.sp
\fB<cBorType>\fR is a character which determines whether a single or double
border will be displayed\. "D" or "d" will cause a double border to
be displayed\. A single border is the default\.
.sp
\fB<cBorColor>\fR is a character string denoting the border color\. \'N/W\' is
the default if this parameter is not a string\.
.sp
\fB<cBoxColor>\fR is a character string denoting the text color\. \'W/N\' is
the default if this parameter is not a string\.
.sp
\fB<nStartRow>\fR is a number denoting the starting row\. If \'99\' is passed,
the box is centered vertically\. If necessary, nStartRow is decreased
so the entire box can be displayed\.
.sp
\fB<nStartCol>\fR is a number denoting the starting column\. If \'99\' is passed,
the box is centered horizontally\. If necessary, nStartCol is decreased
so the entire box can be displayed\.
.sp
\fB<cLine1>\fR thru \fB<cLine8>\fR are 1 to 8 character strings to be displayed\.
They are truncated to fit on the screen if necessary\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
FT_XBOX() allows the programmer to display a message box on the screen
without needing to calculate the dimensions of the box\. Only the upper
left corner needs to be defined\. The function will calculate the lower
right corner based on the number and length of strings passed\.
.sp
A maximum of eight strings can be displayed\. If a string is too long
to fit on the screen it is truncated\.
.sp
The first seven parameters are optional\. The default settings are:
.in 0.64i
Lines of text are centered\.
Control is returned to the calling routine immediately\.
A single line border is painted\.
The border is black on white\.
The text is white on black\.
The box is centered both vertically and horizontally\.
.sp
.in 0.4i
WARNING: Shadowing is achieved by a call to FT_SHADOW(), an assembly
.in 1.2i
routine not found in this \.PRG\. In order to use XBOX,
SHADOW\.OBJ must also be present somewhere (if you are using
NANFOR\.LIB, then it is)\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
The following displays a two-line box with default settings:
.sp
.in 0.56i
FT_XBOX(,,,,,,,\'This is a test\',\'of the XBOX() function\')
.sp
.in 0.4i
The following uses all optional parameters and displays a three-line
box\. The box is left-justified with a double border\. It has a yellow
on red border and white on blue text\. The function will wait for a
keypress before returning control to the calling routine\.
.sp
.in 0.56i
.br
FT_XBOX(\'L\',\'W\',\'D\',\'GR+/R\',\'W/B\',5,10,\'It is so nice\',;
.in 1.84i
.br
\'to not have to do the messy chore\',;
.br
\'of calculating the box size!\')
.sp
.in 0.08i
\fBSource:\fR XBOX\.PRG
.sp
\fBAuthor:\fR Don Opperthauser
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
MENU TO Execute light bar menu using prompts created with @\.\.\.PROMPT
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBMENU TO
Execute light bar menu using prompts created with @\.\.\.PROMPT
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.br
\fB#include "FTMENUTO\.CH"
.in 0i
.br
\fB
.in 0.4i
.br
\fBMENU TO <var> [NOSNOW] [KEEP] [COLD]
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<var>\fR is the name of the variable to assign the result of the
menu selection\.
.sp
\fBNOSNOW\fR implements snow-suppression on CGA monitors\. If not
specified, no snow-suppression will occur\. This option is only
meaningful for CGA displays\.
.sp
\fBKEEP\fR causes the prompt list to be retained after the menu
has been executed, allowing the menu to be executed multiple
times without redefining the prompts\. If not specified, the
prompts will be destroyed once the menu has executed\.
.sp
\fBCOLD\fR suppresses automatic menu termination when a prompt\'s
hotkey is pressed\. If this clause is present, pressing
a prompt\'s hotkey will move the highlight to the proper menu
selection but will not terminate the menu\. If not present,
pressing a hot key will terminate the menu, as it does in the
standard Clipper MENU TO command\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This enhanced version of MENU TO requires the inclusion of
the header file FTMENUTO\.CH in any source file that uses it\.
It is compatible with, and may be used in place of, the standard
Clipper MENU TO command\.
.sp
This command is very similar to the Clipper version\. The
main differences are that you have more control over hotkey
operation, and you can keep the prompts alive after the menu
has executed, if you so desire\. Please be aware that this
function does not qualify as a "wait state" and so do not
expect any wait state-associated activity to occur\.
Nevertheless, I have included support for any SET KEY
redirections through the magic of code blocks\. A loop is
used to check to every possible INKEY() value to see if it
has been redirected\. This is necessary because Clipper
provides no way to check SET KEY status\. If you\'re
interested in improving performance, alter the source code
to receive an array of keys that have been redirected, and
remove the previously mentioned loop\. Using the loop does
make the routine a bit more generic, so it\'s a trade-off\.
Your call, do as you see fit\.
.sp
Note that this command can also be called using function-style
syntax\. See the entry for FT_MENUTO() for further details\.
.sp
Also note that this command calls an internal routine called
__FTMENUTO()\. __FTMENUTO() was written in assembler\. Check
the file TMENU\.ASM if you\'re interested in seeing the
assembler source code\.
.sp
Header file: FTMENUTO\.CH
.sp
.in 0.08i
\fBExamples
.sp
.in 0.32i
.ta 2.08i
.br
#include "FTMENUTO\.CH" // NECESSARY!
.br
.ta
.br
// Simple command
.br
MENU TO memvar
.sp
.br
// Implement snow-checking for CGA
.br
MENU TO memvar NOSNOW
.sp
.br
// Keep the prompts alive when finished
.br
MENU TO memvar KEEP
.sp
.br
// Use "cold" hotkeys
.br
MENU TO memvar COLD
.sp
.in 0.08i
\fBHeader File:\fR FTMENUTO\.CH
.sp
\fBSource:\fR MENUTO\.PRG
.sp
\fBAuthor:\fR Ted Means
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
@\.\.\.PROMPT
, FT_MENUTO()
, FT_PROMPT()