home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / CLIPPER / NFTROFF / 11.TR < prev    next >
Text File  |  1993-12-01  |  63KB  |  2,987 lines

  1. .de }n
  2. .bp
  3. .sp .5i
  4. ..
  5. .wh -.8i }n
  6. .sp .5i
  7. .po -.4i
  8. .ll 7.5i
  9. .ps 9
  10. .vs 9
  11. .in 0i
  12. .ta 1.63265i
  13. .sp 2
  14. .ne 20
  15. .ps +3
  16. .vs +3
  17. @\.\.\.PROMPT    Define a menu item for use with MENU TO
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fB@\.\.\.PROMPT
  25. Define a menu item for use with MENU TO
  26. .in 0i
  27. .br
  28. \l'6.24i'
  29. .br
  30. .sp
  31. .in 0.08i
  32. \fBSyntax
  33. .sp
  34. .in 0.4i
  35. .br
  36. \fB#include "FTMENUTO\.CH"
  37. .in 0i
  38. .br
  39. \fB
  40. .in 0.4i
  41. .ta 4.96i
  42. .br
  43. \fB@ <nRow>, <nCol> PROMPT <cMenuItem>    ;
  44. .br
  45. .ta
  46. .in 2.32i
  47. .ta 3.04i
  48. .br
  49. \fB[ PROMPTCOLOR <cPromptColor> ]    ;
  50. .br
  51. .ta
  52. .ta 3.04i
  53. .br
  54. \fB[ MESSAGE <cItemMessage> ]    ;
  55. .br
  56. .ta
  57. .ta 3.04i
  58. .br
  59. \fB[ MSGROW <nMessageRow> ]    ;
  60. .br
  61. .ta
  62. .ta 3.04i
  63. .br
  64. \fB[ MSGCOL <nMessageCol> ]    ;
  65. .br
  66. .ta
  67. .ta 3.04i
  68. .br
  69. \fB[ MSGCOLOR <cMsgColor> ]    ;
  70. .br
  71. .ta
  72. .ta 3.04i
  73. .br
  74. \fB[ HOTKEY <nHotKeyPosition> ]    ;
  75. .br
  76. .ta
  77. .ta 3.04i
  78. .br
  79. \fB[ HOTKEYCOLOR <cHotKeyColor> ]    ;
  80. .br
  81. .ta
  82. .ta 3.04i
  83. .br
  84. \fB[ BARCOLOR <cBarColor> ]    ;
  85. .br
  86. .ta
  87. .ta 3.04i
  88. .br
  89. \fB[ BARHOTKEYCOLOR <cBarHotKeyColor> ]    ;
  90. .br
  91. .ta
  92. .ta 3.04i
  93. .br
  94. \fB[ UP <nUp> ]    ;
  95. .br
  96. .ta
  97. .ta 3.04i
  98. .br
  99. \fB[ DOWN <nDown> ]    ;
  100. .br
  101. .ta
  102. .ta 3.04i
  103. .br
  104. \fB[ RIGHT <nRight> ]    ;
  105. .br
  106. .ta
  107. .br
  108. \fB[ LEFT <nLeft> ]
  109. .sp
  110. .in 0.08i
  111. \fBArguments
  112. .sp
  113. .in 0.4i
  114. \fB<nRow>\fR is the row at which the prompt is to appear\.
  115. .sp
  116. \fB<nCol>\fR is the column at which the prompt will appear\.
  117. .sp
  118. \fB<cMenuItem>\fR is the menu item to display\.
  119. .sp
  120. \fB<cPromptColor>\fR is optional and is the color attribute of the
  121. prompt\. If not specified, the default is the current
  122. standard color as supplied by the SetColor() function\.
  123. .sp
  124. \fB<cItemMessage>\fR is optional and is the message associated with
  125. the prompt\. If not specified, then no message will be displayed\.
  126. .sp
  127. \fB<nMessageRow>\fR is optional and is the row at which the
  128. message, if any, will appear\.  If not specified, the default
  129. is the current setting of the SET MESSAGE TO command\.
  130. .sp
  131. \fB<nMessageCol>\fR is optional and is the column at which the
  132. message, if any, will appear\.  If not specified, the default
  133. is either zero or centered, depending on the current setting
  134. of the CENTER option of the SET MESSAGE TO command\.
  135. .sp
  136. \fB<cMsgColor>\fR is optional and is the color attribute of
  137. the message\. If not specified, the default is the current
  138. standard color as reported by the SetColor() function\.
  139. .sp
  140. \fB<nHotKeyPosition>\fR is optional and is the position within the
  141. prompt string where the hotkey is located\.  If not
  142. specified, the default is one\.
  143. .sp
  144. \fB<cHotKeyColor>\fR is optional and is the color attribute of the
  145. hotkey character\.  If not specified, the default is the same
  146. color as the rest of the prompt\.
  147. .sp
  148. \fB<cBarColor>\fR is optional and is the color attribute of
  149. the light bar when it is positioned on this prompt\.  If not
  150. specified, the default is the current enhanced color setting
  151. as returned by the SetColor() function\.
  152. .sp
  153. \fB<cBarHotKeyColor>\fR is optional and is the color
  154. attribute of the hotkey when the light bar is positioned on
  155. this prompt\.  If not specified, the default is the same
  156. color as the rest of the light bar\.
  157. .sp
  158. \fB<nUp>\fR is optional and specifies which prompt becomes active
  159. when the up arrow key is pressed\.  If not specified, the
  160. default is the previous prompt\.  The current setting of SET
  161. WRAP TO is obeyed\.
  162. .sp
  163. \fB<nDown>\fR is optional and specifies which prompt becomes
  164. active when the down arrow key is pressed\.  If not
  165. specified, the default is the next prompt\.  The current
  166. setting of SET WRAP TO is obeyed\.
  167. .sp
  168. \fB<nRight>\fR is optional and specifies which prompt becomes
  169. active when the right arrow key is pressed\.  If not
  170. specified, the default is the next prompt\.  The current
  171. setting of SET WRAP TO is obeyed\.
  172. .sp
  173. \fB<nLeft>\fR is optional and specifies which prompt becomes
  174. active when the left arrow is pressed\.  If not specified,
  175. the default is the previous prompt\.  The current setting of
  176. SET WRAP TO is obeyed\.
  177. .sp
  178. .in 0.08i
  179. \fBDescription
  180. .sp
  181. .in 0.4i
  182. This enhanced version of @\.\.\.PROMPT requires the inclusion of
  183. the header file FTMENUTO\.CH in any source file that uses it\.
  184. It is compatible with, and may be used in place of, the standard
  185. Clipper @\.\.\.PROMPT command\.
  186. .sp
  187. Clipper\'s @\.\.\.PROMPT and MENU TO commands are fine as far as
  188. they go\.  But many times you need more flexibility\.  As
  189. you\'ll no doubt notice if you read the argument list, this
  190. function is almost completely flexible\. You can adjust
  191. locations and colors for every part of the prompt and its
  192. associated message\.  In addition, since you can control the
  193. effect of the arrow keys, you can allow both horizontal and
  194. vertical movement, or even disable certain arrow keys if you
  195. so desire\.
  196. .sp
  197. Note that this command can also be called using function-style
  198. syntax\.  See the entry for FT_PROMPT() for further details\.
  199. .sp
  200. Also note that this command calls an internal routine called
  201. __FTPROMPT()\. __FTPROMPT() was written in assembler\.  Check
  202. the file TMENU\.ASM if you\'re interested in seeing the
  203. assembler source code\.
  204. .sp
  205. All the examples below use the command version\.  If you\'re
  206. interested in seeing the function version, compile the
  207. examples with the /P switch and then examine the resulting
  208. \.PPO file\.
  209. .sp
  210. .in 0.08i
  211. \fBExamples
  212. .sp
  213. .in 0.32i
  214. .br
  215. #include "FTMENUTO\.CH"
  216. .br
  217. // Simple prompt
  218. .br
  219. @ 1, 1 PROMPT "Menu choice #1"
  220. .sp
  221. .br
  222. // Prompt with color
  223. .br
  224. @ 3, 1 PROMPT "Menu choice #2" PROMPTCOLOR W+/R
  225. .sp
  226. .br
  227. // Prompt with a message
  228. .br
  229. @ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch"
  230. .sp
  231. .br
  232. // Prompt with pinpoint message control
  233. .br
  234. @ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ;
  235. .in 1.52i
  236. .br
  237. MSGROW 22 MSGCOL 4 MSGCOLOR GR+/N
  238. .sp
  239. .in 0.32i
  240. .br
  241. // Prompt with a unique lightbar color
  242. .br
  243. @ 9, 1 PROMPT "Menu choice #5" BARCOLOR BG+/W
  244. .sp
  245. .br
  246. // Prompt with a hotkey ("#" character)
  247. .br
  248. @11, 1 PROMPT "Menu choice #6" HOTKEY 13
  249. .sp
  250. .br
  251. // Prompt with pinpoint hotkey control
  252. .br
  253. @13, 1 PROMPT "Menu Choice #7" HOTKEY 13 ;
  254. .in 1.52i
  255. .br
  256. HOTKEYCOLOR R+/BG BARHOTKEYCOLOR G+/N
  257. .sp
  258. .in 0.32i
  259. .br
  260. // Prompt with right and left arrow keys disabled
  261. .br
  262. @15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8
  263. .sp
  264. .in 0.08i
  265. \fBHeader File:\fR FTMENUTO\.CH
  266. .sp
  267. \fBSource:\fR ATPROMPT\.PRG
  268. .sp
  269. \fBAuthor:\fR Ted Means
  270. .in 0i
  271. .sp
  272. .in 1.5i
  273. .ti -1.5i
  274. .ta 1.5i
  275. .ft B
  276. See Also:    
  277. .ft R
  278. MENU TO
  279. , FT_PROMPT()
  280. , FT_MENUTO()
  281. .ta 1.63265i
  282. .in 0i
  283. .sp 2
  284. .ne 20
  285. .ps +3
  286. .vs +3
  287. FT_ACH2TB()    Replace ACHOICE() with a Tbrowse object
  288. .br
  289. .ta
  290. .in 0.08i
  291. .ps -3
  292. .vs -3
  293. .sp 2
  294. \fBFT_ACH2TB()
  295. Replace ACHOICE() with a Tbrowse object
  296. .in 0i
  297. .br
  298. \l'6.24i'
  299. .br
  300. .sp
  301. .in 0.08i
  302. \fBSyntax
  303. .sp
  304. .in 0.4i
  305. .ta 5.92i
  306. .br
  307. \fBFT_Ach2tb( <nToprow>,<nTopcol> [, <nBotrow> ][, <nBotcol> ],<aArray>,    ;
  308. .br
  309. .ta
  310. .in 0.88i
  311. .ta 5.68i
  312. .br
  313. \fB[ <cBoxtype> ],[ <cBoxcolor> ],[ <cBoxtitle> ],[ <nTitlePos> ],    ;
  314. .br
  315. .ta
  316. .ta 5.68i
  317. .br
  318. \fB[ <cUselcolor> ],[ <cTitlecolor> ],[ <cBarcolor> ],[ <cHkcolor> ],    ;
  319. .br
  320. .ta
  321. .ta 5.68i
  322. .br
  323. \fB[ <cShadow> ],[ <lExecute> ],[ <nMsgrow> ],[ <nMsgcol> ],    ;
  324. .br
  325. .ta
  326. .ta 5.28i
  327. .br
  328. \fB[ <cMsgcolor> ],[cElevbar],[cEbarcolor],[ <cEbarside> ],    ;
  329. .br
  330. .ta
  331. .ta 5.76i
  332. .br
  333. \fB[ <cNoSelcolor> ],[ <cTagch> ],[ <nStartelem> ],[ <lRestscrn> ],    ;
  334. .br
  335. .ta
  336. .br
  337. \fB[ <nTimeout> ],[ <bUserfunc> ] )
  338. .in 0.48i
  339. .br
  340. \fB-> nOption
  341. .sp
  342. .in 0.08i
  343. \fBArguments
  344. .sp
  345. .in 0.16i
  346. .ta 0.96i
  347. \fB<nToprow>\fR    is the top row of the box to be drawn\.  Required\.
  348. .br
  349. .ta
  350. .sp
  351. .ta 0.96i
  352. \fB<nTopcol>\fR    is the top column of the box to be drawn\.  Required\.
  353. .br
  354. .ta
  355. .sp
  356. .ta 0.96i
  357. \fB<nBotrow>\fR    is the bottom row of the box to be drawn\.  The default is
  358. .br
  359. .ta
  360. .in 0.4i
  361. \fB<nToprow>+Len(\fR<aArray>)+1 or maxrow()-2, whichever is less\.
  362. .sp
  363. .in 0.16i
  364. .ta 0.96i
  365. \fB<nBotcol>\fR    is the bottom column of the box to be drawn\.  The default
  366. .br
  367. .ta
  368. .in 0.4i
  369. is \fB<nTopcol>+width of the widest element in \fR<aArray>+2\.
  370. .sp
  371. .in 0.16i
  372. .ta 0.96i
  373. \fB<aArray>\fR    is the array of options to present to the user\.  Each
  374. .br
  375. .ta
  376. .in 0.4i
  377. element can hold as many as five subelements, or as few as one\.
  378. Required\.  Additional documentation below, in "Description\."
  379. .sp
  380. .in 0.16i
  381. \fB<cBoxtype>\fR is the type of box to draw\.  Uses DispBox()\.  The
  382. .in 0.4i
  383. default is a double-line box\.
  384. .sp
  385. .in 0.16i
  386. \fB<cBoxcolor>\fR is the color with which to draw the box\.  The default is
  387. .in 0.4i
  388. Setcolor()\.
  389. .sp
  390. .in 0.16i
  391. \fB<cBoxtitle>\fR is title of the box drawn on \fB<nToprow>\.  The default is
  392. .in 0.4i
  393. no title\.
  394. .sp
  395. .in 0.16i
  396. .ta 1.04i
  397. \fB<nTitlepos>\fR    is the starting column position (to the right of
  398. .br
  399. .ta
  400. .in 0.4i
  401. \fB<nTopcol>) at which to draw \fR<cBoxtitle>\.  The default is 1\.
  402. .sp
  403. .in 0.16i
  404. \fB<cUselcolor>\fR is the color with which to draw unselected options\.
  405. .in 0.4i
  406. The default is Setcolor()\.
  407. .sp
  408. .in 0.16i
  409. \fB<cTitlecolor>\fR is the color with which to draw the box title\.  The
  410. .in 0.4i
  411. default is yellow on red\.
  412. .sp
  413. .in 0.16i
  414. .ta 1.04i
  415. \fB<cBarcolor>\fR    is the color with which to draw the selection bar\.
  416. .br
  417. .ta
  418. .in 0.4i
  419. The default is yellow on black\.
  420. .sp
  421. .in 0.16i
  422. .ta 0.96i
  423. \fB<cHkcolor>\fR    is the default color with which to draw the hotkeys for
  424. .br
  425. .ta
  426. .in 0.4i
  427. for each option\.  This is used when no hotkey color is supplied
  428. in \fB<aArray>\.  The default is hiwhite on the current background
  429. color\.
  430. .sp
  431. .in 0.16i
  432. .ta 0.96i
  433. \fB<cShadow>\fR    is a character string, either "L" or "R" (for left or
  434. .br
  435. .ta
  436. .in 0.4i
  437. right) to designate the side of the box where a shadow will appear\.
  438. Leave this NIL to avoid drawing a shadow\.  You might also leave
  439. this NIL if you choose to use a \.C or \.ASM shadow function, which
  440. is a good idea\.  Shadoww(), included below, is flat-out SLOW\.
  441. .sp
  442. .in 0.16i
  443. .ta 0.96i
  444. \fB<lExecute>\fR    turn on/off execution of option when first letter is
  445. .br
  446. .ta
  447. .in 0.4i
  448. pressed\.  Rule:  setting in element 5 of each \fB<aArray>\fR subarray
  449. overrides \fB<lExecute>\.  If that element is left NIL, the \fR<lexecute>
  450. setting is used\.  If \fB<lExecute>\fR is not passed and element 5 is NIL,
  451. auto execution is turned ON by default\.
  452. .sp
  453. .in 0.16i
  454. .ta 0.88i
  455. \fB<nMsgrow>\fR    is the row on which to draw a message for each option\.
  456. .br
  457. .ta
  458. .in 0.4i
  459. The default is two rows below the bottom of the box\.
  460. .sp
  461. .in 0.16i
  462. .ta 0.88i
  463. \fB<nMsgcol>\fR    is the column at which to draw a message for each option\.
  464. .br
  465. .ta
  466. .in 0.4i
  467. The default is \fB<nTopcol>\fR +2\.
  468. .sp
  469. .in 0.16i
  470. .ta 1.04i
  471. \fB<cMsgcolor>\fR    is the default color with which to draw messages\.  This
  472. .br
  473. .ta
  474. .in 0.4i
  475. color is used when element 4 of each \fB<aArray>\fR subarray is left NIL\.
  476. The default is Setcolor()\.
  477. .sp
  478. .in 0.16i
  479. .ta 0.96i
  480. \fB<cElevbar>\fR    is the ASCII character to use as the elevator bar drawn
  481. .br
  482. .ta
  483. .in 0.4i
  484. on the box\.  Leave this NIL to draw no elevator bar\.
  485. .sp
  486. .in 0.16i
  487. .ta 1.12i
  488. \fB<cEbarcolor>\fR    is the color with which to draw the elevator bar\.
  489. .br
  490. .ta
  491. .in 0.4i
  492. This is ignored if \fB<cElevbar>\fR is NIL\.
  493. .sp
  494. .in 0.16i
  495. .ta 1.04i
  496. \fB<cEbarside>\fR    is a character string, either "L" or "R" (for left or
  497. .br
  498. .ta
  499. .in 0.4i
  500. right) to designate the side of the box on which to draw the
  501. elevator bar\.  This is ignored if \fB<cElevbar>\fR is NIL\.
  502. .sp
  503. .in 0.16i
  504. .ta 1.2i
  505. \fB<cNoselcolor>\fR    is the color with which to draw unselectable options\.
  506. .br
  507. .ta
  508. .in 0.4i
  509. The default is white on black\.
  510. .sp
  511. .in 0.16i
  512. \fB<cTagchar>\fR is the ASCII character to use to draw tags that would
  513. .in 0.4i
  514. appear to the right of each option\.  The default is DISabled
  515. tagging\.  The default tag is "\(sq\(sq\(sq" (chr(251))\.
  516. .sp
  517. .in 0.16i
  518. .ta 1.12i
  519. \fB<nStartelem>\fR    is the number of the option where the selection bar
  520. .br
  521. .ta
  522. .in 0.4i
  523. will first be placed\.  Leave this NIL to begin at option 1\.
  524. .sp
  525. .in 0.16i
  526. .ta 1.04i
  527. \fB<lRestscrn>\fR    is a logical to designate whether or not the screen
  528. .br
  529. .ta
  530. .in 0.4i
  531. coordinates occupied by the box and/or shadow should be restored
  532. before FT_Ach2tb() returns\.  The default is \.T\.
  533. .sp
  534. .in 0.16i
  535. .ta 0.96i
  536. \fB<nTimeout>\fR    is the number of seconds after which FT_ACH2TB() will
  537. .br
  538. .ta
  539. .in 0.4i
  540. timeout and return to the function/proced\. which called it\.  The
  541. default is 0, or no timeout\.
  542. .sp
  543. .in 0.16i
  544. .ta 1.04i
  545. \fB<bUserfunc>\fR    is a code block containing a function call to be
  546. .br
  547. .ta
  548. .in 0.4i
  549. executed after each key press\.  You need to write just two formal
  550. parameters to allow the run-time passing of the key pressed and the
  551. current element number, e\.g\.:
  552. .sp
  553. { | nKey, nElemnum | Myfunc( nKey, nElemnum [, xAnythingelse ] ) }
  554. .sp
  555. Unlimited extra parameters may be passed\.  Of course, make certain
  556. to also write \'receptors\' for them in \'Myfunc()\' itself\.\.\.as in the
  557. above example\.  The default is NO user function\.
  558. .sp
  559. .in 0.08i
  560. \fBReturns
  561. .sp
  562. .in 0.4i
  563. the number of the selected option, or 0 if [Esc] is pressed\.
  564. .sp
  565. .in 0.08i
  566. \fBDescription
  567. .sp
  568. .in 0.4i
  569. FT_Ach2tb() is a greatly enhanced, fully featured replacement for
  570. Achoice(), based on a Tbrowse object\.  Each element of <aArray> needs
  571. to be composed as follows:
  572. .sp
  573. .in 0.72i
  574. .ta 0.72i 1.2i 2.24i
  575. Option    ,    Message    , HotKeyPos, HotKeyColor, Selectable
  576. .br
  577. .ta
  578. .in 0.4i
  579. .ta 3.04i 3.44i 3.76i 4.48i 4.88i 5.52i
  580. { "Utilities","System Utilities",    3    ,    "+gr/b"    ,    \.T\.    }
  581. .br
  582. .ta
  583. .sp
  584. All elements except for the first, the option itself, are optional\.
  585. IF \'Message\' is NIL, no message is displayed\.  \'HotKeyPos\' is the
  586. position within \'Option\' of the hotkey\.  In the example above, the
  587. hotkey for \'Utilities\' is the first \'i\', i\.e\., at position 3\.  The
  588. default is 1\.  \'HotKeyColor\' is the color to use for the hotkey
  589. .ta 2.72i
  590. display\.  The default is hiwhite    on the current background color\.
  591. .br
  592. .ta
  593. \'Selectable\' is a logical indicating whether or not that option can
  594. be selected\.  The default is \.T\.
  595. .sp
  596. The A_CHOICE() UDC in FT_ACH2T\.CH makes using FT_ACH2TB() a breeze\.
  597. The myriad of parameters can be written in any order\.  Only <nToprow>,
  598. <nTopcol>, and <aArray> are required\.  See the example below\.
  599. .sp
  600. There may be some confusion over \'unselected\' and \'unselectable\'
  601. options\.  The former refers to any option not currently covered
  602. by the selection bar\.  The latter refers to options you have
  603. designated unselectable in subelement 5 of <aArray>, i\.e\., by
  604. writing \.F\.
  605. .sp
  606. To enable tagging, pass any ASCII character as <cTagchar>\.  To
  607. tag/untag all options, press [SPACE]\.  To tag/untag individual
  608. options, press [+] and [-] respectively\.  To test for the tagged
  609. status of an option, use the WAS_TAGGED() UDC in FT_ACH2T\.CH\. To
  610. check the entire array for tags, use Aeval() in conjunction with
  611. Was_Tagged() as in the example below\.  When tagging is enabled, the
  612. string "Tags" will be written across the bottom row of the box in
  613. hiwhite on the current background color\.
  614. .sp
  615. Because FT_ACH2TB() takes over the [SPACE], [+], and [-] keys, it saves
  616. any SET KEY procedures you might have set them to, and restores same
  617. on returning\.  Any other procedures you might have SET KEYs to will
  618. fly when FT_ACH2TB() is called\.\.\.thanks to the INKEY() replacement,
  619. SKINKEY()\.
  620. .sp
  621. The piece de resistance of FT_ACH2TB() is its ability to execute
  622. a user function designed entirely by you\.  It is called after each
  623. keypress, and because it is completely open-ended, extends the
  624. the reach of FT_ACH2TB() to the limits of Clipper\.  See the docu-
  625. mentation under <bUserfunc> above\.
  626. .sp
  627. Test compile:  CLIPPER ft_ach2t /n/w/m/dFT_TEST
  628. .ta 0.96i
  629. Test link    :  RTLINK fi ft_ach2t /pll:base50
  630. .br
  631. .ta
  632. .sp
  633. .sp
  634. .in 0.08i
  635. \fBExamples
  636. .sp
  637. .in 0.4i
  638. .br
  639. nOpt := A_CHOICE( 7,9 ARRAY:t_array USERFUNC:{|a,b| UserFunc(a,b,any1)};
  640. .in 1.04i
  641. .ta 1.44i 2.72i 5.04i
  642. .br
  643. BOXTYPE:B_SINGLE    BOXTITLE:title    SHADOW:"R" TAGCHAR:chr(17)    ;
  644. .br
  645. .ta
  646. .ta 5.04i
  647. .br
  648. REST_SCREEN:\.F\. AUTOEXEC:\.F\. MES_COLOR:MSG_COLOR ELEVBAR:"\(sq"    ;
  649. .br
  650. .ta
  651. .br
  652. NOSELCOLOR:"bg/n")
  653. .sp
  654. .in 0.4i
  655. .br
  656. Check only the RETURNed element:
  657. .br
  658. IF Was_Tagged(chr(17),t_array,nOpt); MoreProcessing(); END
  659. .sp
  660. .br
  661. Check entire \'t_array\':
  662. .br
  663. Aeval( t_array,{|e,n| IF( Was_Tagged(chr(17),t_array,n ), ;
  664. .in 2.48i
  665. .br
  666. MoreProcessing(t_array),NIL ) } )
  667. .sp
  668. .in 0.08i
  669. \fBHeader File:\fR FT_ACH2T\.CH
  670. .sp
  671. \fBSource:\fR ACH2TB\.PRG
  672. .sp
  673. \fBAuthor:\fR Steve Kolterman
  674. .in 0i
  675. .ta 1.63265i
  676. .sp 2
  677. .ne 20
  678. .ps +3
  679. .vs +3
  680. FT_ADDER()    Pop up a simple calculator
  681. .br
  682. .ta
  683. .in 0.08i
  684. .ps -3
  685. .vs -3
  686. .sp 2
  687. \fBFT_ADDER()
  688. Pop up a simple calculator
  689. .in 0i
  690. .br
  691. \l'6.24i'
  692. .br
  693. .sp
  694. .in 0.08i
  695. \fBSyntax
  696. .sp
  697. .in 0.48i
  698. \fBFT_Adder()
  699. .sp
  700. .in 0.08i
  701. \fBArguments
  702. .sp
  703. .in 0.48i
  704. None
  705. .sp
  706. .in 0.08i
  707. \fBReturns
  708. .sp
  709. .in 0.48i
  710. NIL \.\.\.\. but optionally places Total of calculation in active
  711. .in 1.2i
  712. Get variable using oGet:VARPUT()
  713. .sp
  714. .in 0.08i
  715. \fBDescription
  716. .sp
  717. .in 0.48i
  718. PopAdder() gives you an adding machine inside your Clipper 5\.01
  719. application\. It has the basic functions add, subtract, multiply,
  720. and divide\. You may move it from one side of the screen to the
  721. other\. It even displays a scrollable tape, if you want it\.
  722. .sp
  723. .sp
  724. The Help screen below gives a brief description of the operation
  725. of the adder\.
  726. .sp
  727. .sp
  728. .in 1.44i
  729. .br
  730. \(sq
  731. .br
  732. \l'0.56i'
  733. .br
  734.  INSTRUCTIONS 
  735. .br
  736. \l'0.56i'
  737. .br
  738. \(sq
  739. .ta 0i 2.32i
  740. .br
  741.     \(br    \(br
  742. .br
  743. .ta
  744. .ta 0i 2.32i
  745. .br
  746.     \(br All number keys as usual    \(br
  747. .br
  748. .ta
  749. .ta 0i 2.32i
  750. .br
  751.     \(br <+> <-> keys as usual    \(br
  752. .br
  753. .ta
  754. .ta 0i 2.32i
  755. .br
  756.     \(br <SPACE>
  757. .br
  758. \l'0.24i'
  759. .br
  760. shift <+> to <*>     \(br
  761. .br
  762. .ta
  763. .ta 0i 0.8i 2.32i
  764. .br
  765.     \(br    \(sq
  766. .br
  767. \l'0.08i'
  768. .br
  769. shift <-> to </>     \(br
  770. .br
  771. .ta
  772. .ta 0i 0.24i 0.8i 2.32i
  773. .br
  774.     \(br    <D>    change decimal pt\.     \(br
  775. .br
  776. .ta
  777. .ta 0i 0.24i 0.8i 2.32i
  778. .br
  779.     \(br    <M>    move ADDER    \(br
  780. .br
  781. .ta
  782. .ta 0i 0.24i 0.8i 2.32i
  783. .br
  784.     \(br    <T>    display tape    \(br
  785. .br
  786. .ta
  787. .ta 0i 0.24i 0.8i 2.32i
  788. .br
  789.     \(br    <S>    scroll tape disp\.      \(br
  790. .br
  791. .ta
  792. .ta 0i 2.32i
  793. .br
  794.     \(br <DEL>
  795. .br
  796. \l'0.4i'
  797. .br
  798. 1st Clear entry    \(br
  799. .br
  800. .ta
  801. .ta 0i 0.8i 2.32i
  802. .br
  803.     \(br    \(sq
  804. .br
  805. \l'0.08i'
  806. .br
  807. 2nd Clear ADDER    \(br
  808. .br
  809. .ta
  810. .ta 0i 0.8i 2.32i
  811. .br
  812.     \(br <ESC>    to Quit    \(br
  813. .br
  814. .ta
  815. .ta 0i 0.8i 2.32i
  816. .br
  817.     \(br <F10>    to Return Total    \(br
  818. .br
  819. .ta
  820. .ta 0i 0.96i 2.32i
  821. .br
  822.     \(br    to program    \(br
  823. .br
  824. .ta
  825. .ta 0i 2.32i
  826. .br
  827.     \(br    \(br
  828. .br
  829. .ta
  830. .br
  831. \(sq
  832. .br
  833. \l'0.32i'
  834. .br
  835.  Any Key to Continue 
  836. .br
  837. \l'0.24i'
  838. .br
  839. \(sq
  840. .sp
  841. .sp
  842. .sp
  843. .in 0.48i
  844. A couple of notes about the adder:
  845. .sp
  846. .sp
  847. 1\.) It was designed to be used on an Enhanced keyboard with
  848. .in 0.8i
  849. separate <DELETE> key\. <DELETE> is used to clear the adder\.
  850. However, it will still work on a Standard keyboard\.
  851. .sp
  852. .in 0.48i
  853. 2\.) It uses the <SPACE> bar to shift from Add/Subtract
  854. .in 0.8i
  855. mode to Multiply/Divide\. That means the <+> and <-> keys
  856. become the <*> and </> keys\.
  857. .sp
  858. .in 0.48i
  859. 3\.) You do not have to display the tape\. You may turn it on
  860. .in 0.8i
  861. at any time by pressing <T>\. You may SCROLL back through
  862. the tape once there are more than 16 entries in the
  863. adder, by pressing <S>\.
  864. .sp
  865. .in 0.48i
  866. 4\.) To Quit the Adder just press <ESC>\. To return your Total
  867. .in 0.8i
  868. to the application press <F10>\. The adder will place the
  869. Total in the active GET variable using oGet:VarPut()\. The
  870. adder will only return a Total to a numerical GET!
  871. .sp
  872. .in 0.48i
  873. 5\.) There are many support functions that you might find
  874. .in 0.8i
  875. interesting\. They are part of my personal library, but
  876. are necessary to the operation of the adder\.
  877. You might want to pull these out to reduce the overall
  878. size of the adder\. Many are worth at least a little
  879. time studying\.
  880. .sp
  881. .in 0.48i
  882. 6\.) To make FT_Adder a Hot key from inside your application
  883. .in 0.8i
  884. at the beginning of your application add the line:
  885. .sp
  886. .in 1.36i
  887. .ta 1.36i
  888. SET KEY K_ALT_A    TO FT_Adder
  889. .br
  890. .ta
  891. .sp
  892. .in 0.8i
  893. This will make <ALT-A> a key "Hot" and permit you to
  894. Pop - Up the adder from anywhere in the application\.
  895. .sp
  896. .in 0.48i
  897. 7\.) If you use the UDF replacement for INKEY() that Don Caton
  898. .in 0.8i
  899. posted on Nanforum (see FT_SINKEY()), you can even have
  900. active hotkeys in an INKEY()\.
  901. .sp
  902. .sp
  903. .sp
  904. .sp
  905. .sp
  906. .in 0.08i
  907. \fBExamples
  908. .sp
  909. .sp
  910. .sp
  911. \fBHeader File:\fR INKEY\.CH, SE
  912. .sp
  913. \fBSource:\fR POPADDER\.PRG
  914. .sp
  915. \fBAuthor:\fR Keith A\. Wire
  916. .in 0i
  917. .ta 1.63265i
  918. .sp 2
  919. .ne 20
  920. .ps +3
  921. .vs +3
  922. FT_BLINK()    Display a blinking message on the screen
  923. .br
  924. .ta
  925. .in 0.08i
  926. .ps -3
  927. .vs -3
  928. .sp 2
  929. \fBFT_BLINK()
  930. Display a blinking message on the screen
  931. .in 0i
  932. .br
  933. \l'6.24i'
  934. .br
  935. .sp
  936. .in 0.08i
  937. \fBSyntax
  938. .sp
  939. .in 0.4i
  940. \fBFT_BLINK( <cMsg>, [ <nRow> ], [ <nCol> ] ) -> NIL
  941. .sp
  942. .in 0.08i
  943. \fBArguments
  944. .sp
  945. .in 0.4i
  946. \fB<cMsg>\fR is the string to blink\.
  947. .sp
  948. \fB<nRow>\fR is an optional screen row for @\.\.\.SAY, default current\.
  949. .sp
  950. \fB<nCol>\fR is an optional screen col for @\.\.\.say, default current\.
  951. .sp
  952. .in 0.08i
  953. \fBReturns
  954. .sp
  955. .in 0.4i
  956. NIL
  957. .sp
  958. .in 0.08i
  959. \fBDescription
  960. .sp
  961. .in 0.4i
  962. A quick way to blink a msg on screen in the CURRENT colors\.
  963. Restores colors on return\.
  964. .sp
  965. .in 0.08i
  966. \fBExamples
  967. .sp
  968. .in 0.4i
  969. .ta 2.24i
  970. .br
  971. FT_BLINK( "WAIT", 5, 10 )    // Blinks "WAIT" in current colors @ 5,10
  972. .br
  973. .ta
  974. .sp
  975. .br
  976. @5,10 SAY "WAIT - Printing Report"
  977. .ta 2.24i 2.56i
  978. .br
  979. FT_BLINK( "\.\.\." )    //    Blink "\.\.\." after wait message\.\.\.
  980. .br
  981. .ta
  982. .sp
  983. .in 0.08i
  984. \fBSource:\fR BLINK\.PRG
  985. .sp
  986. \fBAuthor:\fR Terry Hackett
  987. .in 0i
  988. .ta 1.63265i
  989. .sp 2
  990. .ne 20
  991. .ps +3
  992. .vs +3
  993. FT_BRWSWHL()    Browse an indexed database limited to a while condition
  994. .br
  995. .ta
  996. .in 0.08i
  997. .ps -3
  998. .vs -3
  999. .sp 2
  1000. \fBFT_BRWSWHL()
  1001. Browse an indexed database limited to a while condition
  1002. .in 0i
  1003. .br
  1004. \l'6.24i'
  1005. .br
  1006. .sp
  1007. .in 0.08i
  1008. \fBSyntax
  1009. .sp
  1010. .in 0.4i
  1011. .ta 4.96i
  1012. .br
  1013. \fBFT_BRWSWHL( <aFields>, <bWhileCond>, <cKey>,    ;
  1014. .br
  1015. .ta
  1016. .in 1.36i
  1017. .br
  1018. \fB[ <nFreeze> ], [ <lSaveScrn> ], [ <cColorList> ], ;
  1019. .ta 4i
  1020. .br
  1021. \fB[ <cColorShadow> ], [ <nTop> ], [ <nLeft> ],    ;
  1022. .br
  1023. .ta
  1024. .br
  1025. \fB[ <nBottom> ], [ <nRight> ] -> nRecno
  1026. .sp
  1027. .in 0.08i
  1028. \fBArguments
  1029. .sp
  1030. .in 0.4i
  1031. \fB<aFields>\fR is array of field blocks of fields you want to display\.
  1032. .in 0.64i
  1033. Example to set up last name and first name in array:
  1034. .br
  1035. aFields := {}
  1036. .ta 3.68i
  1037. .br
  1038. AADD(aFields, {"Last Name" , {||Names->Last}    } )
  1039. .br
  1040. .ta
  1041. .br
  1042. AADD(aFields, {"First Name", {||Names->First} } )
  1043. .sp
  1044. .in 0.4i
  1045. \fB<bWhileCond>\fR is the limiting WHILE condition as a block\.
  1046. .in 0.64i
  1047. .br
  1048. Example 1: { ||Names->Last == "JONES" }
  1049. .ta 5.2i
  1050. .br
  1051. Example 2: { ||Names->Last == "JONES" \.AND\. Names->First == "A"    }
  1052. .br
  1053. .ta
  1054. .sp
  1055. .in 0.4i
  1056. \fB<cKey>\fR is the key to find top condition of WHILE\.
  1057. .in 0.64i
  1058. .ta 0.56i 1.68i
  1059. .br
  1060. cLast    := "JONES    "
  1061. .br
  1062. .ta
  1063. .br
  1064. cFirst := "A"
  1065. .br
  1066. Example 1: cKey := cLast
  1067. .br
  1068. Example 2: cKey := cLast + cFirst
  1069. .sp
  1070. .in 0.4i
  1071. \fB<nFreeze>\fR is number of fields to freeze in TBrowse\.  Defaults
  1072. to 0 if not passed\.
  1073. .sp
  1074. \fB<lSaveScrn>\fR is a logical indicating whether or not you want to
  1075. save the screen from the calling program\.  Defaults to \.T\. if
  1076. not passed\.
  1077. .sp
  1078. \fB<cColorList>\fR is a list of colors for the TBrowse columns\.
  1079. The 1st color is used as SAY/TBrowse Background and the
  1080. 3rd and 4th colors are used as part of column:defColor := {3, 4}
  1081. .sp
  1082. Thus if you pass a cColorList, you MUST pass at least 4 colors\.
  1083. Defaults to "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R" if not passed\.
  1084. .sp
  1085. \fB<cColorShad>\fR is the color of the TBrowse box shadow\.  Defaults
  1086. to "N/N" if not passed\.
  1087. .sp
  1088. \fB<nTop>\fR, \fB<nLeft>\fR, \fB<nBottom>\fR, \fB<nRight>\fR are the coordinates of
  1089. the area to display the TBrowse in\.  Defaults to 2, 2,
  1090. MAXROW() - 2, MAXCOL() - 2 with shadowed box, i\.e\. full screen\.
  1091. .sp
  1092. .in 0.08i
  1093. \fBReturns
  1094. .sp
  1095. .in 0.4i
  1096. nRecno is the number of the record selected by the <Enter> key\.
  1097. 0 is returned if there are either no records matching the WHILE
  1098. condition or an <Esc> is pressed instead of an <Enter>
  1099. .sp
  1100. .in 0.08i
  1101. \fBDescription
  1102. .sp
  1103. .in 0.4i
  1104. This is a demonstration of TBrowse with a WHILE condition for an
  1105. indexed database\.
  1106. .sp
  1107. .in 0.08i
  1108. \fBExamples
  1109. .sp
  1110. .in 0.4i
  1111. .br
  1112. * This example will only show those people with last name of "JONES"
  1113. .br
  1114. * in the TBNames\.dbf which contains at least the fields:
  1115. .br
  1116. * Last, First, City AND is indexed on Last + First\.
  1117. .ta 1.36i
  1118. .br
  1119. LOCAL nRecSel    := 0
  1120. .br
  1121. .ta
  1122. .ta 1.36i
  1123. .br
  1124. LOCAL aFields    := {}
  1125. .br
  1126. .ta
  1127. .ta 1.36i
  1128. .br
  1129. LOCAL bWhile    := {||TBNames->Last = "JONES"}
  1130. .br
  1131. .ta
  1132. .ta 1.36i
  1133. .br
  1134. LOCAL cKey    := "JONES"
  1135. .br
  1136. .ta
  1137. .ta 1.36i
  1138. .br
  1139. LOCAL nFreeze    := 1
  1140. .br
  1141. .ta
  1142. .ta 1.36i
  1143. .br
  1144. LOCAL lSaveScrn    := \.t\.
  1145. .br
  1146. .ta
  1147. .br
  1148. LOCAL cColorList := "N/W, N/BG, B/W, B/BG, B/W, B/BG, R/W, B/R"
  1149. .br
  1150. LOCAL cColorShad := "N/N"
  1151. .sp
  1152. .br
  1153. USE TBNames INDEX TBNames NEW // indexed on Last + First
  1154. .sp
  1155. .br
  1156. * Pass Heading as character and Field as Block including Alias
  1157. .br
  1158. * To eliminate the need to use FIELDWBLOCK() function in FT_BRWSWHL()
  1159. .ta 3.84i
  1160. .br
  1161. AADD(aFields, {"Last Name" , {||TBNames->Last}    } )
  1162. .br
  1163. .ta
  1164. .br
  1165. AADD(aFields, {"First Name", {||TBNames->First} } )
  1166. .ta 2.16i 3.84i
  1167. .br
  1168. AADD(aFields, {"City"    , {||TBNames->City}    } )
  1169. .br
  1170. .ta
  1171. .sp
  1172. .br
  1173. IF FT_BRWSWHL( aFields, bWhile, cKey, nFreeze, lSaveScrn, ;
  1174. .in 0.64i
  1175. .br
  1176. cColorList, cColorShad, 3, 6, MaxRow() - 2, MaxCol() - 6) == 0
  1177. .br
  1178. ? "Sorry, NO Records Were Selected"
  1179. .in 0.4i
  1180. .br
  1181. ELSE
  1182. .in 0.64i
  1183. .br
  1184. ? "You Selected: " + TBNames->Last +" "+ ;
  1185. .in 0.88i
  1186. .br
  1187. TBNames->First +" "+ TBNames->City
  1188. .in 0.4i
  1189. .br
  1190. ENDIF
  1191. .sp
  1192. .in 0.08i
  1193. \fBSource:\fR TBWHILE\.PRG
  1194. .sp
  1195. \fBAuthor:\fR Jim Orlowski
  1196. .in 0i
  1197. .ta 1.63265i
  1198. .sp 2
  1199. .ne 20
  1200. .ps +3
  1201. .vs +3
  1202. FT_CLRSEL()    User Selectable Colour Routine
  1203. .br
  1204. .ta
  1205. .in 0.08i
  1206. .ps -3
  1207. .vs -3
  1208. .sp 2
  1209. \fBFT_CLRSEL()
  1210. User Selectable Colour Routine
  1211. .in 0i
  1212. .br
  1213. \l'6.24i'
  1214. .br
  1215. .sp
  1216. .in 0.08i
  1217. \fBSyntax
  1218. .sp
  1219. .in 0.4i
  1220. .ta 4.4i
  1221. \fBFT_ClrSel( <aClrData>, [ <lClrMode> ], [ <cTestChr> ]    -> aClrData
  1222. .br
  1223. .ta
  1224. .sp
  1225. .in 0.08i
  1226. \fBArguments
  1227. .sp
  1228. .sp
  1229. .in 0.4i
  1230. \fB<aClrData>\fR is an array of subarrays, with each subarray containing
  1231. .in 0.64i
  1232. information about the colour settings\.
  1233. .sp
  1234. The subarray has the following structure:
  1235. .sp
  1236. .in 0.72i
  1237. .ta 0.4i 1.12i
  1238. [1]    cName    is the name of this colour setting i\.e\. "Pick List"
  1239. .br
  1240. .ta
  1241. .in 1.36i
  1242. Maximum length is 20 bytes
  1243. .sp
  1244. .in 0.72i
  1245. .ta 0.4i 1.12i
  1246. [2]    cClrStr    is the current colour string
  1247. .br
  1248. .ta
  1249. .in 1.36i
  1250. Default is "W/N,N/W,N/N,N/N,N/W"
  1251. .sp
  1252. If Setting type is "M" (Menu) the colours are\.\.\.
  1253. .in 1.6i
  1254. .br
  1255. 1\.  Prompt Colour
  1256. .br
  1257. 2\.  Message Colour
  1258. .br
  1259. 3\.  HotKey Colour
  1260. .br
  1261. 4\.  LightBar Colour
  1262. .br
  1263. 5\.  LightBar HotKey Colour
  1264. .sp
  1265. .in 1.36i
  1266. Note: While there are many ways to code the individual
  1267. .in 1.6i
  1268. .ta 1.76i
  1269. colour combinations,    they should be in the same
  1270. .br
  1271. .ta
  1272. format that gets returned from SETCOLOR(), so
  1273. the defaults can be found in the colour palette\.
  1274. .sp
  1275. foreground [+] / background [*]
  1276. i\.e\. "GR+/BG*, N/W*, N+/N, , W/N"
  1277. .sp
  1278. .in 0.72i
  1279. .ta 0.4i 0.96i
  1280. [3]    cType    is the type of colour setting
  1281. .br
  1282. .ta
  1283. .in 1.36i
  1284. Default is "W" (Window)
  1285. .sp
  1286. .in 1.6i
  1287. .ta 1.12i
  1288. .br
  1289. T = Title    Only 1 colour element
  1290. .br
  1291. .ta
  1292. .ta 1.12i
  1293. .br
  1294. D = Desktop    Background colour and character
  1295. .br
  1296. .ta
  1297. .ta 1.12i
  1298. .br
  1299. M = Menu    For FT_Menuto() style menus
  1300. .br
  1301. .ta
  1302. .ta 1.12i
  1303. .br
  1304. W = Window    Windows with radio buttons
  1305. .br
  1306. .ta
  1307. .ta 1.12i
  1308. .br
  1309. G = Get    For use with @ SAY\.\.\.
  1310. .br
  1311. .ta
  1312. .ta 1.12i
  1313. .br
  1314. B = Browse    For tBrowse() and *dbEdit()
  1315. .br
  1316. .ta
  1317. .ta 1.12i
  1318. .br
  1319. A = aChoice    Pick-lists etc\.\.\.
  1320. .br
  1321. .ta
  1322. .sp
  1323. .in 1.36i
  1324. W/G/B/A are functionally the same but will provide
  1325. a more appropriate test display\.
  1326. .sp
  1327. .in 0.72i
  1328. .ta 0.4i 1.28i
  1329. [4]    cFillChar    is the character (for desktop background only)
  1330. .br
  1331. .ta
  1332. .in 1.36i
  1333. Default is CHR(177) "\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq\(sq"
  1334. .sp
  1335. .sp
  1336. .in 0.4i
  1337. .ta 1.04i
  1338. \fB<lClrMode>\fR    \.T\.  use colour palette
  1339. .br
  1340. .ta
  1341. .in 1.36i
  1342. \.F\.  use monochrome palette
  1343. .sp
  1344. Default is the ISCOLOR() setting
  1345. .sp
  1346. .in 0.4i
  1347. .ta 0.96i
  1348. \fB<cTestChr>\fR    2 Byte character string for colour test display
  1349. .br
  1350. .ta
  1351. .sp
  1352. .in 1.36i
  1353. .ta 2.72i
  1354. Default is the CHR(254)+CHR(254)    "\(sq\(sq\(sq\(sq\(sq\(sq"
  1355. .br
  1356. .ta
  1357. .sp
  1358. .sp
  1359. .in 0.08i
  1360. \fBReturns
  1361. .sp
  1362. .in 0.4i
  1363. An array identical to the one passed, with new selected colours
  1364. .sp
  1365. .in 0.08i
  1366. \fBDescription
  1367. .sp
  1368. .in 0.56i
  1369. This function allows users to select their own colour combinations
  1370. .in 0.4i
  1371. for all the different types of screen I/O in a typical application\.
  1372. This facilitates an easy implementation of Ted Means\' replacement
  1373. .ta 0.64i
  1374. of the    @\.\.PROMPT/MENU TO found in the NanForum Toolkit\.  If you are
  1375. .br
  1376. .ta
  1377. not using FT_MENUTO(), you can specify "A" for setting type and have
  1378. a normal colour string returned\.
  1379. .sp
  1380. .in 0.08i
  1381. \fBExamples
  1382. .sp
  1383. .in 0.4i
  1384. .ta 1.12i
  1385. .br
  1386. LOCAL aClrs    := {}
  1387. .br
  1388. .ta
  1389. .br
  1390. LOCAL lColour := ISCOLOR()
  1391. .ta 1.12i
  1392. .br
  1393. LOCAL cChr    := CHR(254) + CHR(254)
  1394. .br
  1395. .ta
  1396. .sp
  1397. .br
  1398. SET SCOREBOARD Off
  1399. .ta 1.76i
  1400. .br
  1401. SETBLINK( \.F\. )    // Allow bright backgrounds
  1402. .br
  1403. .ta
  1404. .sp
  1405. .br
  1406. *\.\.\.\. a typical application might have the following different settings
  1407. .ta 0.48i
  1408. .br
  1409. *    normally these would be stored in a \.dbf/\.dbv
  1410. .br
  1411. .ta
  1412. .br
  1413. aClrs := {;
  1414. .in 0.64i
  1415. .ta 1.6i 4.16i
  1416. .br
  1417. { "Desktop",    "N/BG",    "D", "\(sq" }, ;
  1418. .br
  1419. .ta
  1420. .ta 1.6i 4.16i 4.88i
  1421. .br
  1422. { "Title",    "N/W",    "T"    }, ;
  1423. .br
  1424. .ta
  1425. .ta 1.6i 4.16i 4.88i
  1426. .br
  1427. { "Top Menu",    "N/BG,N/W,W+/BG,W+/N,GR+/N",    "M"    }, ;
  1428. .br
  1429. .ta
  1430. .ta 1.6i 4.88i
  1431. .br
  1432. { "Sub Menu",    "W+/N*,GR+/N*,GR+/N*,W+/R,G+/R","M"    }, ;
  1433. .br
  1434. .ta
  1435. .ta 1.6i 2.16i 4.16i 4.88i
  1436. .br
  1437. { "Standard Gets",    "W/B,    W+/N,,, W/N",    "G"    }, ;
  1438. .br
  1439. .ta
  1440. .ta 1.6i 4.16i 4.88i
  1441. .br
  1442. { "Nested Gets",    "N/BG, W+/N,,, W/N",    "G"    }, ;
  1443. .br
  1444. .ta
  1445. .ta 1.6i 2.16i 4.16i 4.88i
  1446. .br
  1447. { "Help",    "N/G,    W+/N,,, W/N",    "W"    }, ;
  1448. .br
  1449. .ta
  1450. .ta 4.16i 4.88i
  1451. .br
  1452. { "Error Messages", "W+/R*,N/GR*,,,N/R*",    "W"    }, ;
  1453. .br
  1454. .ta
  1455. .ta 4.16i 4.88i
  1456. .br
  1457. { "Database Query", "N/BG, N/GR*,,,N+/BG",    "B"    }, ;
  1458. .br
  1459. .ta
  1460. .ta 1.6i 4.16i 4.88i 5.12i
  1461. .br
  1462. { "Pick List",    "N/GR*,W+/B,,, BG/GR*",    "A"    }    ;
  1463. .br
  1464. .ta
  1465. .in 1.12i
  1466. .br
  1467. }
  1468. .sp
  1469. .in 0.32i
  1470. .br
  1471. aClrs := FT_ClrSel( aClrs, lColour, cChr )
  1472. .sp
  1473. .in 0.08i
  1474. \fBSource:\fR CLRSEL\.PRG
  1475. .sp
  1476. \fBAuthor:\fR Dave Adams
  1477. .in 0i
  1478. .ta 1.63265i
  1479. .sp 2
  1480. .ne 20
  1481. .ps +3
  1482. .vs +3
  1483. FT_DISPMSG()    Display a message and optionally waits for a keypress
  1484. .br
  1485. .ta
  1486. .in 0.08i
  1487. .ps -3
  1488. .vs -3
  1489. .sp 2
  1490. \fBFT_DISPMSG()
  1491. Display a message and optionally waits for a keypress
  1492. .in 0i
  1493. .br
  1494. \l'6.24i'
  1495. .br
  1496. .sp
  1497. .in 0.08i
  1498. \fBSyntax
  1499. .sp
  1500. .in 0.4i
  1501. .br
  1502. \fBFT_DISPMSG( <aMessageArray>, [ <cKey2Check> ],
  1503. .in 1.36i
  1504. .br
  1505. \fB[ <nTopBoxRow> ], [ <nLeftBoxColumn> ],
  1506. .br
  1507. \fB[ <cBoxType> ], [ <lShadow> ] ) -> lKeyMatch
  1508. .sp
  1509. .in 0.08i
  1510. \fBArguments
  1511. .sp
  1512. .in 0.4i
  1513. \fB<aMessageArray>\fR is a multidimensional array of messages to be
  1514. displayed and the color attributes for each message\.
  1515. .sp
  1516. The first dimension of the array contains one or more elements,
  1517. each representing one line in the message box, up to the maximum
  1518. number of rows on the screen\.
  1519. .sp
  1520. The second dimension of the array contains a color attribute for
  1521. the corresponding element in dimension one, plus one additional
  1522. element for the color of the box border\.  Dimension two will
  1523. always contain one more element than dimension one\.  If an
  1524. attribute is omitted, the last color selected will be used\.
  1525. .sp
  1526. \fB<Key2Check>\fR is a character string of one or more keys to check
  1527. for\.  If omitted, the message is displayed and control is returned
  1528. to the calling procedure\.  If one character is specified,
  1529. FT_DISPMSG() waits for one keypress, restores the screen and
  1530. returns\.  If multiple characters are specified, FT_DISPMSG()
  1531. remains in a loop until one of the specified keys has been
  1532. pressed, then restores the screen and returns\.
  1533. .sp
  1534. \fB<nTopBoxRow>\fR is the upper row for the message box\.  If omitted, the
  1535. box is centered vertically\.
  1536. .sp
  1537. \fB<nLeftBoxColumn>\fR is the leftmost column for the box\.  If omitted, the
  1538. box is centered horizontally\.
  1539. .sp
  1540. \fB<cBoxType>\fR is a string of characters or a variable for the box
  1541. border\.  See the @\.\.\.BOX command\.  If omitted, a double box is
  1542. drawn\.
  1543. .sp
  1544. \fB<lShadow>\fR is a logical variable\.  If true (\.T\.) or omitted, it
  1545. uses FT_SHADOW() to add a transparent shadow to the box\.  If
  1546. false (\.F\.), the box is drawn without the shadow\.
  1547. .sp
  1548. .in 0.08i
  1549. \fBReturns
  1550. .sp
  1551. .in 0.4i
  1552. If <Key2Check> is not specified, FT_DISPMSG() will return false
  1553. (\.F\.)\.
  1554. .sp
  1555. If <Key2Check> is a one-character string, FT_DISPMSG() will return
  1556. true (\.T\.) if the user presses that key, or false (\.F\.) if any
  1557. other key is pressed\.
  1558. .sp
  1559. If <Key2Check> consists of multiple characters, it will lock the
  1560. user in a loop until one of those keys are pressed and return the
  1561. INKEY() value of the keypress\.
  1562. .sp
  1563. .in 0.08i
  1564. \fBDescription
  1565. .sp
  1566. .in 0.4i
  1567. FT_DISPMSG() is a multi-purpose pop-up for user messages\.
  1568. Multiple lines may be displayed, each with a different attribute\.
  1569. The box will be automatically centered on the screen, or the row
  1570. and/or column can be specified by the programmer\.  It also centers
  1571. each line of the message within the box\.
  1572. .sp
  1573. .in 0.08i
  1574. \fBExamples
  1575. .sp
  1576. .in 0.4i
  1577. The following example displays a simple two-line message
  1578. and returns immediately to the calling routine\.
  1579. .sp
  1580. .in 0.64i
  1581. .ta 4.24i
  1582. .br
  1583. FT_DISPMSG( { { "Printing Report"    , ;
  1584. .br
  1585. .ta
  1586. .in 1.92i
  1587. .ta 2.96i
  1588. .br
  1589. "Press [ESC] To Interrupt" }    , ;
  1590. .br
  1591. .ta
  1592. .in 1.76i
  1593. .br
  1594. { "W+/B*", "W/B", "GR+/B" } } )
  1595. .sp
  1596. .in 0.4i
  1597. The next example displays a message and waits for a key press\.
  1598. .sp
  1599. .in 0.64i
  1600. .ta 4.24i
  1601. .br
  1602. FT_DISPMSG( { { "Press [D] To Confirm Deletion"    , ;
  1603. .br
  1604. .ta
  1605. .in 1.92i
  1606. .ta 2.96i
  1607. .br
  1608. "Or Any Other Key To Abort" }    , ;
  1609. .br
  1610. .ta
  1611. .in 1.76i
  1612. .ta 3.12i
  1613. .br
  1614. { "W+/B", "W+/B", "GR+/B" } }    , ;
  1615. .br
  1616. .ta
  1617. .br
  1618. "D" )
  1619. .sp
  1620. .in 0.4i
  1621. The next example displays a one-line message centered on row 5
  1622. and returns to the calling procedure\.
  1623. .sp
  1624. .in 0.64i
  1625. .ta 3.68i
  1626. .br
  1627. FT_DISPMSG( { { "Please Do Not Interrupt" }    , ;
  1628. .br
  1629. .ta
  1630. .in 1.76i
  1631. .ta 2.48i
  1632. .br
  1633. { "W+/B", "GR+/B" } }    , ;
  1634. .br
  1635. .ta
  1636. .br
  1637. , 5, )
  1638. .sp
  1639. .in 0.08i
  1640. \fBSource:\fR DISPMSG\.PRG
  1641. .sp
  1642. \fBAuthor:\fR Paul Ferrara
  1643. .in 0i
  1644. .ta 1.63265i
  1645. .sp 2
  1646. .ne 20
  1647. .ps +3
  1648. .vs +3
  1649. FT_FILL()    Declare menu options for FT_MENU1()
  1650. .br
  1651. .ta
  1652. .in 0.08i
  1653. .ps -3
  1654. .vs -3
  1655. .sp 2
  1656. \fBFT_FILL()
  1657. Declare menu options for FT_MENU1()
  1658. .in 0i
  1659. .br
  1660. \l'6.24i'
  1661. .br
  1662. .sp
  1663. .in 0.08i
  1664. \fBSyntax
  1665. .sp
  1666. .in 0.4i
  1667. \fBFT_FILL( <aSubArrayName>, <cMenuSelection>, <bFunction>,
  1668. .in 1.12i
  1669. \fB<lSelectable> ) -> NIL
  1670. .sp
  1671. .in 0.08i
  1672. \fBArguments
  1673. .sp
  1674. .in 0.4i
  1675. \fB<aSubArrayName>\fR is a sub-array of \fB<acOptions>\fR in FT_MENU1()
  1676. denoting the group in which to include the selection --
  1677. e\.g\., acOptions[1]
  1678. .sp
  1679. \fB<cMenuSelection>\fR is the character string that will appear on
  1680. the menu\.
  1681. .sp
  1682. \fB<bFunction>\fR is the code block to be executed when that menu
  1683. option is selected\.  i\.e\. {|| MyFunction() } would execute
  1684. the function called MyFunction()\.  {|| \.f\.} would exit the
  1685. .ta 3.68i
  1686. FT_MENU1 and return to the calling routine\.    {|| \.T\.} would
  1687. .br
  1688. .ta
  1689. do nothing\.
  1690. .sp
  1691. \fB<lSelectable>\fR is a logical variable that determines whether
  1692. the corresponding menu option is selectable or not\.
  1693. .sp
  1694. .in 0.08i
  1695. \fBReturns
  1696. .sp
  1697. .in 0.4i
  1698. NIL
  1699. .sp
  1700. .in 0.08i
  1701. \fBDescription
  1702. .sp
  1703. .in 0.4i
  1704. FT_FILL() is a function used to set up the menu options prior
  1705. to calling FT_MENU1()\.
  1706. .sp
  1707. .in 0.08i
  1708. \fBExamples
  1709. .sp
  1710. .in 0.16i
  1711. FT_FILL( aOptions[1], \'A\. Execute A Dummy Procedure\' , {|| fubar()}, \.t\. )
  1712. .sp
  1713. The above would be added to the sub-menu associated with the first menu
  1714. bar item, would execute the function FUBAR() when that option was
  1715. selected, and would be selectable\.
  1716. .sp
  1717. .sp
  1718. .ta 4.24i 5.52i
  1719. FT_FILL( aOptions[3], \'B\. Enter Daily Charges\'    , {|| \.t\.},    \.f\. )
  1720. .br
  1721. .ta
  1722. .sp
  1723. The above would be added to the sub-menu associated with the third menu
  1724. bar item, and would be unselectable\.
  1725. .sp
  1726. .sp
  1727. .ta 5.52i
  1728. FT_FILL( aOptions[2], \'C\. Enter Payments On Accounts\', {|| \.t\.},    \.t\. )
  1729. .br
  1730. .ta
  1731. .sp
  1732. The above would be added to the sub-menu associated with the second menu
  1733. bar item, and would be selectable, but would do nothing when selected\.
  1734. .sp
  1735. .sp
  1736. .ta 4.24i 5.52i
  1737. FT_FILL( aOptions[4], \'C\. Exit\'    , {|| \.f\.},    \.t\. )
  1738. .br
  1739. .ta
  1740. .sp
  1741. The above would be added to the sub-menu associated with the fourth menu
  1742. bar item, and would be selectable, and would exit FT_MENU1() when chosen\.
  1743. .sp
  1744. .in 0.08i
  1745. \fBSource:\fR MENU1\.PRG
  1746. .sp
  1747. \fBAuthor:\fR Paul Ferrara
  1748. .in 0i
  1749. .sp
  1750. .in 1.5i
  1751. .ti -1.5i
  1752. .ta 1.5i
  1753. .ft B
  1754. See Also:    
  1755. .ft R
  1756. FT_MENU1()
  1757. .ta 1.63265i
  1758. .in 0i
  1759. .sp 2
  1760. .ne 20
  1761. .ps +3
  1762. .vs +3
  1763. FT_MENU1()    Pulldown menu system
  1764. .br
  1765. .ta
  1766. .in 0.08i
  1767. .ps -3
  1768. .vs -3
  1769. .sp 2
  1770. \fBFT_MENU1()
  1771. Pulldown menu system
  1772. .in 0i
  1773. .br
  1774. \l'6.24i'
  1775. .br
  1776. .sp
  1777. .in 0.08i
  1778. \fBSyntax
  1779. .sp
  1780. .in 0.4i
  1781. \fBFT_MENU1( <acBarNames>, <acOptions>, <acAction>,
  1782. .in 1.2i
  1783. \fB<acColors> [, <nTopRow> ], [ <lShadow> ] ) -> NIL
  1784. .sp
  1785. .in 0.08i
  1786. \fBArguments
  1787. .sp
  1788. .in 0.4i
  1789. \fB<acBarNames>\fR is a character array containing the names to appear
  1790. on the menu bar\.
  1791. .sp
  1792. \fB<acOptions>\fR is a multi-dimensional array with one element for each
  1793. selection to appear on the pulldown menus\.
  1794. .sp
  1795. \fB<acColors>\fR is an array containing the colors for the menu groups\.
  1796. .sp
  1797. \fB<nTopRow>\fR is a numeric value that determines the row for the menu
  1798. bar\.  If omitted, it defaults to 0\.
  1799. .sp
  1800. \fB<lShadow>\fR is a logical variable\.  If true (\.T\.) or omitted, it
  1801. uses FT_SHADOW() to add a transparent shadow to the each
  1802. pulldown menu\.  If false (\.F\.), the menu is drawn without
  1803. the shadow\.
  1804. .sp
  1805. All arguments except nTopRow and lShadow are required\.
  1806. .sp
  1807. .in 0.08i
  1808. \fBReturns
  1809. .sp
  1810. .in 0.4i
  1811. NIL
  1812. .sp
  1813. .in 0.08i
  1814. \fBDescription
  1815. .sp
  1816. .in 0.4i
  1817. FT_MENU1() is a function that displays a pulldown menu for each item
  1818. on the menu bar and executes the corresponding function for the item
  1819. selected\.  When a called function returns false, FT_MENU1 returns
  1820. control to the calling program\.
  1821. .sp
  1822. Valid keystrokes and their corresponding actions:
  1823. .sp
  1824. .ta 1.36i 1.6i
  1825. Home    -    Activates Pulldown for first item on the menu bar
  1826. .br
  1827. .ta
  1828. .ta 1.36i 1.6i
  1829. End    -    Activates Pulldown for last item on the menu bar
  1830. .br
  1831. .ta
  1832. .ta 1.36i 1.6i
  1833. Left Arrow    -    Activates next Pulldown to the left
  1834. .br
  1835. .ta
  1836. .ta 1.36i 1.6i
  1837. Right Arrow    -    Activates next Pulldown to the right
  1838. .br
  1839. .ta
  1840. .ta 1.36i 1.6i
  1841. Tab    -    Same as Right Arrow
  1842. .br
  1843. .ta
  1844. .ta 1.36i 1.6i
  1845. Shift-Tab    -    Same as Left Arrow
  1846. .br
  1847. .ta
  1848. .ta 1.36i 1.6i
  1849. Page Up    -    Top item on current Pulldown menu
  1850. .br
  1851. .ta
  1852. .ta 1.36i 1.6i
  1853. Page Down    -    Bottom item on current Pulldown menu
  1854. .br
  1855. .ta
  1856. .ta 1.36i 1.6i
  1857. Enter    -    Selects current item
  1858. .br
  1859. .ta
  1860. .ta 1.36i 1.6i
  1861. Alpha Character    -    Moves to closest match and selects
  1862. .br
  1863. .ta
  1864. .ta 1.36i 1.6i
  1865. Alt-<Key>    -    Moves to corresponding menu bar item
  1866. .br
  1867. .ta
  1868. .ta 1.36i 1.6i
  1869. Escape    -    Prompts for confirmation and either returns to
  1870. .br
  1871. .ta
  1872. .in 2i
  1873. the calling routine or resumes
  1874. .sp
  1875. .in 0.08i
  1876. \fBExamples
  1877. .sp
  1878. .in 0.4i
  1879. .br
  1880. // Declare arrays
  1881. .ta 1.2i
  1882. .br
  1883. LOCAL aColors    := {}
  1884. .br
  1885. .ta
  1886. .ta 1.2i
  1887. .br
  1888. LOCAL aBar    := { " ENTER/EDIT ", " REPORTS ", " DISPLAY " }
  1889. .br
  1890. .ta
  1891. .sp
  1892. .br
  1893. // Include the following two lines of code in your program, as is\.
  1894. .br
  1895. // The first creates aOptions with the same length as aBar\.  The
  1896. .br
  1897. // second assigns a three-element array to each element of aOptions\.
  1898. .br
  1899. LOCAL aOptions[ LEN( aBar ) ]
  1900. .br
  1901. AEVAL( aBar, { |x,i| aOptions[i] := { {},{},{} } } )
  1902. .sp
  1903. .br
  1904. // fill color array
  1905. .br
  1906. // Box Border, Menu Options, Menu Bar, Current Selection, Unselected
  1907. .br
  1908. aColors := IF( lColor, {"W+/G", "N/G", "N/G", "N/W", "N+/G"}, ;
  1909. .in 2.24i
  1910. .br
  1911. {"W+/N", "W+/N", "W/N", "N/W","W/N"} )
  1912. .sp
  1913. .in 0.16i
  1914. .br
  1915. // array for first pulldown menu
  1916. .br
  1917. FT_FILL( aOptions[1], \'A\. Execute A Dummy Procedure\' , {|| fubar()}, \.t\. )
  1918. .ta 4.24i 5.52i
  1919. .br
  1920. FT_FILL( aOptions[1], \'B\. Enter Daily Charges\'    , {|| \.t\.},    \.f\. )
  1921. .br
  1922. .ta
  1923. .ta 5.52i
  1924. .br
  1925. FT_FILL( aOptions[1], \'C\. Enter Payments On Accounts\', {|| \.t\.},    \.t\. )
  1926. .br
  1927. .ta
  1928. .sp
  1929. .br
  1930. // array for second pulldown menu
  1931. .ta 4.24i 5.52i
  1932. .br
  1933. FT_FILL( aOptions[2], \'A\. Print Member List\'    , {|| \.t\.},    \.t\. )
  1934. .br
  1935. .ta
  1936. .ta 5.52i
  1937. .br
  1938. FT_FILL( aOptions[2], \'B\. Print Active Auto Charges\' , {|| \.t\.},    \.t\. )
  1939. .br
  1940. .ta
  1941. .sp
  1942. .br
  1943. // array for third pulldown menu
  1944. .ta 5.52i
  1945. .br
  1946. FT_FILL( aOptions[3], \'A\. Transaction Totals Display\', {|| \.t\.},    \.t\. )
  1947. .br
  1948. .ta
  1949. .ta 4.24i 5.52i
  1950. .br
  1951. FT_FILL( aOptions[3], \'B\. Display Invoice Totals\'    , {|| \.t\.},    \.t\. )
  1952. .br
  1953. .ta
  1954. .ta 4.24i 5.52i
  1955. .br
  1956. FT_FILL( aOptions[3], \'C\. Exit To DOS\'    , {|| \.f\.},    \.t\. )
  1957. .br
  1958. .ta
  1959. .sp
  1960. .in 0.4i
  1961. Call FT_FILL() once for each item on each pulldown menu, passing it
  1962. three parameters:
  1963. .sp
  1964. .in 0.64i
  1965. FT_FILL( <cMenuSelection>, <bCodeBlock>, <lSelectable>
  1966. .sp
  1967. .in 0.4i
  1968. <cMenuSelection> is a character string which will be displayed on
  1969. .in 0.48i
  1970. the pulldown menu\.
  1971. .sp
  1972. .in 0.4i
  1973. <bCodeBlock> should contain one of the following:
  1974. .sp
  1975. .in 0.64i
  1976. A function name to execute, which in turn should return \.T\. or \.F\.
  1977. FT_MENU1 WILL RETURN CONTROL TO THE CALLING PROGRAM IF \.F\. IS
  1978. RETURNED OR CONTINUE IF \.T\. IS RETURNED\.
  1979. .sp
  1980. \.F\. WHICH WILL CAUSE FT_MENU1 TO RETURN CONTROL TO THE CALLING
  1981. PROGRAM\.
  1982. .sp
  1983. \.T\. WHICH WILL DO NOTHING\.  THIS ALLOWS THE DEVELOPER TO DESIGN A
  1984. SKELETON MENU STRUCTURE PRIOR TO COMPLETING ALL OF THE SUBROUTINES\.
  1985. .sp
  1986. .in 0.4i
  1987. .br
  1988. // CALL FT_MENU1
  1989. .br
  1990. FT_MENU1( aBar, aOptions, aColors, 0 )
  1991. .sp
  1992. NOTE: FT_MENU1() disables Alt-C and Alt-D in order to make them
  1993. .in 0.88i
  1994. available for the menu bar\.  It enables Alt-D and resets
  1995. Alt-C to its previous state prior to calling each function\.
  1996. .sp
  1997. .in 0.08i
  1998. \fBSource:\fR MENU1\.PRG
  1999. .sp
  2000. \fBAuthor:\fR Paul Ferrara
  2001. .in 0i
  2002. .sp
  2003. .in 1.5i
  2004. .ti -1.5i
  2005. .ta 1.5i
  2006. .ft B
  2007. See Also:    
  2008. .ft R
  2009. FT_FILL()
  2010. .ta 1.63265i
  2011. .in 0i
  2012. .sp 2
  2013. .ne 20
  2014. .ps +3
  2015. .vs +3
  2016. FT_MENU2()    Vertical lightbar menu
  2017. .br
  2018. .ta
  2019. .in 0.08i
  2020. .ps -3
  2021. .vs -3
  2022. .sp 2
  2023. \fBFT_MENU2()
  2024. Vertical lightbar menu
  2025. .in 0i
  2026. .br
  2027. \l'6.24i'
  2028. .br
  2029. .sp
  2030. .in 0.08i
  2031. \fBSyntax
  2032. .sp
  2033. .in 0.4i
  2034. \fBFT_MENU2( <aMenuarray> [, <cColors> ] ) -> NIL
  2035. .sp
  2036. .in 0.08i
  2037. \fBArguments
  2038. .sp
  2039. .in 0.4i
  2040. \fB<aMenuarray>\fR is an array of menu options, messages, and action
  2041. .in 0.48i
  2042. blocks\.
  2043. .sp
  2044. .in 0.4i
  2045. Each element in this array is a nested array with the structure:
  2046. .sp
  2047. .in 0.64i
  2048. .br
  2049. element[x, 1] = menu option
  2050. .br
  2051. element[x, 2] = message to be displayed when option is highlighted
  2052. .br
  2053. element[x, 3] = code block to be executed when option is selected
  2054. .sp
  2055. .in 0.4i
  2056. \fB<cColors>\fR is a string containing colors for the prompts, in the same
  2057. format as that returned by Set( _SET_COLOR )\.  If not supplied,
  2058. colors default to the current color setting\.
  2059. .sp
  2060. .in 0.08i
  2061. \fBReturns
  2062. .sp
  2063. .in 0.4i
  2064. NIL
  2065. .sp
  2066. .in 0.08i
  2067. \fBDescription
  2068. .sp
  2069. .in 0.4i
  2070. This function greatly simplifies the process of displaying light-bar
  2071. menus\.  All prompts are padded out with spaces so they are the same
  2072. length, a box is drawn around the prompts, the box is automatically
  2073. centered on the screen, and the underlying screen is restored after
  2074. a menu selection has been made\.
  2075. .sp
  2076. Additionally, because you can tie action blocks to each menu
  2077. option, you can save on a lot of DO CASE or IF\.\.ELSEIF code in your
  2078. main program\.  See the test code for a succinct demonstration\.
  2079. .sp
  2080. .in 0.08i
  2081. \fBExamples
  2082. .sp
  2083. .in 0.48i
  2084. .br
  2085. LOCAL mainmenu := ;
  2086. .in 0.8i
  2087. .ta 2.72i 4.72i
  2088. .br
  2089. { { "Data Entry", "Enter data",    { || FT_MENU2(datamenu)    } }, ;
  2090. .br
  2091. .ta
  2092. .in 0.96i
  2093. .ta 1.28i 2.56i 4.56i
  2094. .br
  2095. { "Reports",    "Hard copy",    { || FT_MENU2(repmenu)    } }, ;
  2096. .br
  2097. .ta
  2098. .br
  2099. { "Maintenance","Reindex files",{ || FT_MENU2(maintmenu) } }, ;
  2100. .br
  2101. { "Quit", "See ya later" } }
  2102. .in 0.48i
  2103. .br
  2104. FT_MENU2(mainmenu)
  2105. .sp
  2106. .in 0.08i
  2107. \fBSource:\fR VERTMENU\.PRG
  2108. .sp
  2109. \fBAuthor:\fR Greg Lief
  2110. .in 0i
  2111. .ta 1.63265i
  2112. .sp 2
  2113. .ne 20
  2114. .ps +3
  2115. .vs +3
  2116. FT_MENUTO()    Execute light bar menu using prompts created with FT_PROMPT(
  2117. .br
  2118. .ta
  2119. .in 0.08i
  2120. .ps -3
  2121. .vs -3
  2122. .sp 2
  2123. \fBFT_MENUTO()
  2124. Execute light bar menu using prompts created with FT_PROMPT(
  2125. .in 0i
  2126. .br
  2127. \l'6.24i'
  2128. .br
  2129. .sp
  2130. .in 0.08i
  2131. \fBSyntax
  2132. .sp
  2133. .in 0.4i
  2134. \fBFT_MENUTO( <bVarNameBlock>, <cVarName>, ;
  2135. .in 1.2i
  2136. \fB[ <lNoSnow> ], [ <lKeep> ], [ <lCold> ]) -> nChoice
  2137. .sp
  2138. .in 0.08i
  2139. \fBArguments
  2140. .sp
  2141. .in 0.4i
  2142. \fB<bVarNameBlock>\fR is a "get-set" code block which allows the
  2143. retrieval and assignment of the variable which will receive
  2144. the return value\.  Its initial value is used to determine the
  2145. initial active prompt\.
  2146. .sp
  2147. The code block must be in the form:
  2148. .sp
  2149. .in 0.64i
  2150. {|_1| IIF( _1 == NIL, \fB<var>\fR, \fB<var>\fR := _1 ) }
  2151. .sp
  2152. .in 0.4i
  2153. For example, if the variable to receive the return value is
  2154. named "nChoice", the code block would look like:
  2155. .sp
  2156. .in 0.64i
  2157. {|_1| IIF( _1 == NIL, nChoice, nChoice := _1 ) }
  2158. .sp
  2159. .in 0.4i
  2160. Although it is good practice to always declare your variables,
  2161. the variable to receive the return value does not need to exist
  2162. before calling FT_MENUTO()\.  If it does exist and is a numeric,
  2163. its value will be used to determine the initial prompt\.  If it
  2164. does not exist, the initial prompt will default to the first one\.
  2165. .sp
  2166. If you use this function by way of the MENU TO command along with
  2167. the FTMENUTO\.CH header file, this code block will automatically
  2168. be created for you by the preprocessor\.
  2169. .sp
  2170. \fB<cVarName>\fR is the name of the memvar to which the menu
  2171. choice is returned\.
  2172. .sp
  2173. \fB<lNoSnow>\fR is optional and specifies whether or not to
  2174. implement snow-suppression on CGA monitors\.  The default is
  2175. \.F\., meaning that no snow-suppression will occur\.  This
  2176. option is only meaningful for CGA displays\.
  2177. .sp
  2178. \fB<lKeep>\fR is optional and indicates whether or not to destroy
  2179. the prompt list once the menu has been executed\.  If \.T\.,
  2180. then the prompts will be kept, allowing the menu to be
  2181. executed multiple times without redefining the prompts\.  The
  2182. default is \.F\., meaning the prompts will be destroyed once
  2183. the menu has executed\.
  2184. .sp
  2185. \fB<lCold>\fR is optional and controls the operation of the
  2186. hotkeys\.  If \.T\., then pressing a hotkey will not result in
  2187. a menu selection\.  Instead, it merely changes the active
  2188. prompt\.  This allows more than one prompt to have the same
  2189. hotkey\.  The default is \.F\., meaning the hotkeys will
  2190. function the same way they do in Clipper\.
  2191. .sp
  2192. .in 0.08i
  2193. \fBReturns
  2194. .sp
  2195. .in 0.4i
  2196. A numeric value representing the menu choice selected, or zero
  2197. if the ESC key was used to exit the menu\.
  2198. .sp
  2199. .in 0.08i
  2200. \fBDescription
  2201. .sp
  2202. .in 0.4i
  2203. This function is a replacement for Clipper\'s MENU TO
  2204. command\.  In fact, you may wish to consult TMENU\.CH, which
  2205. contains a user-defined command that closely adheres to
  2206. standard Clipper syntax and makes this function infinitely
  2207. easier to use\.  I strongly recommend using the command
  2208. version because it is complementary to the associated
  2209. @\.\.\.PROMPT command\.
  2210. .sp
  2211. This function is very similar to the Clipper version\.  The
  2212. main differences are that you have more control over hotkey
  2213. operation, and you can keep the prompts alive after the menu
  2214. has executed, if you so desire\.  Please be aware that this
  2215. function does not qualify as a "wait state" and so do not
  2216. expect any wait state-associated activity to occur\.
  2217. Nevertheless, I have included support for any SET KEY
  2218. redirections through the magic of code blocks\.  A loop is
  2219. used to check to every possible INKEY() value to see if it
  2220. has been redirected\. This is necessary because Clipper
  2221. provides no way to check SET KEY status\.  If you\'re
  2222. interested in improving performance, alter the source code
  2223. to receive an array of keys that have been redirected, and
  2224. remove the previously mentioned loop\.  Using the loop does
  2225. make the routine a bit more generic, so it\'s a trade-off\.
  2226. Your call, do as you see fit\.
  2227. .sp
  2228. Note that this function calls an internal routine called
  2229. __FTMENUTO()\. __FTMENUTO() was written in assembler\.  Check
  2230. the file TMENU\.ASM if you\'re interested in seeing the
  2231. assembler source code\.
  2232. .sp
  2233. All the examples below use the command version\.  If you\'re
  2234. interested in seeing the function version, compile the
  2235. examples with the /P switch and then examine the resulting
  2236. \.PPO file\.
  2237. .sp
  2238. .in 0.08i
  2239. \fBExamples
  2240. .sp
  2241. .in 0.32i
  2242. .br
  2243. #include "FTMENUTO\.CH"
  2244. .br
  2245. // Simple command
  2246. .br
  2247. MENU TO memvar
  2248. .sp
  2249. .br
  2250. // Implement snow-checking for CGA
  2251. .br
  2252. MENU TO memvar NOSNOW
  2253. .sp
  2254. .br
  2255. // Keep the prompts alive when finished
  2256. .br
  2257. MENU TO memvar KEEP
  2258. .sp
  2259. .br
  2260. // Use "cold" hotkeys
  2261. .br
  2262. MENU TO memvar COLD
  2263. .sp
  2264. .in 0.08i
  2265. \fBSource:\fR MENUTO\.PRG
  2266. .sp
  2267. \fBAuthor:\fR Ted Means
  2268. .in 0i
  2269. .sp
  2270. .in 1.5i
  2271. .ti -1.5i
  2272. .ta 1.5i
  2273. .ft B
  2274. See Also:    
  2275. .ft R
  2276. FT_PROMPT()
  2277. .ta 1.63265i
  2278. .in 0i
  2279. .sp 2
  2280. .ne 20
  2281. .ps +3
  2282. .vs +3
  2283. FT_PENDING()    Display same-line pending messages after a wait\.
  2284. .br
  2285. .ta
  2286. .in 0.08i
  2287. .ps -3
  2288. .vs -3
  2289. .sp 2
  2290. \fBFT_PENDING()
  2291. Display same-line pending messages after a wait\.
  2292. .in 0i
  2293. .br
  2294. \l'6.24i'
  2295. .br
  2296. .sp
  2297. .in 0.08i
  2298. \fBSyntax
  2299. .sp
  2300. .in 0.4i
  2301. \fBFT_PENDING ( <cMsg>, [ <nRow> ], [ <nCol> ], ;
  2302. .in 1.84i
  2303. \fB[ <nWait> ], [ <cColor> ] ) -> NIL
  2304. .sp
  2305. .in 0.08i
  2306. \fBArguments
  2307. .sp
  2308. .in 0.4i
  2309. \fB<cMsg>\fR is the message string to display\.
  2310. .sp
  2311. \fB<nRow>\fR is an optional screen row for message display, default row 24\.
  2312. .sp
  2313. \fB<nCol>\fR is an optional screen col for message display, default col 0\.
  2314. .sp
  2315. \fB<nWait>\fR is an optional wait (sec) between messages, default 5 sec\.
  2316. .sp
  2317. \fB<cColor>\fR is an optional color string for displayed messages, default
  2318. .in 1.12i
  2319. is white text over red background\.
  2320. .sp
  2321. .in 0.08i
  2322. \fBReturns
  2323. .sp
  2324. .in 0.4i
  2325. NIL
  2326. .sp
  2327. .in 0.08i
  2328. \fBDescription
  2329. .sp
  2330. .in 0.4i
  2331. A good way to display information messages during the running
  2332. of an application is to send them all to the SAME line on the
  2333. screen where users are expected to look for them\. In order to
  2334. give users a chance to read the current message before the next one
  2335. is displayed we may need to insert a delay after each message\.
  2336. .sp
  2337. FT_PENDING() function displays messages by keeping track of
  2338. the time of the last message and providing a delay ONLY if the next
  2339. pending message is issued much too soon after the current one\.
  2340. .sp
  2341. .sp
  2342. .in 0.08i
  2343. \fBExamples
  2344. .sp
  2345. .in 0.4i
  2346. .br
  2347. FT_PENDING("Message one",20,0,3,"W+/G") // Displays "Message one\."
  2348. .in 3.6i
  2349. .br
  2350. // sets row to 20, col to 0\.
  2351. .br
  2352. // wait to 3 and color to
  2353. .br
  2354. // bright white over green\.
  2355. .in 0.4i
  2356. .ta 2.24i
  2357. .br
  2358. FT_PENDING("Message two")    // Displays "Message two", after 5 sec\.
  2359. .br
  2360. .ta
  2361. .br
  2362. FT_PENDING("Message three") // Displays "Message three", after 5 sec\.
  2363. .sp
  2364. .sp
  2365. Note that default row, col, wait time and color need to be set only
  2366. once in the very first call to FT_PENDING() and only if the internal
  2367. default values are not appropriate\.
  2368. .sp
  2369. .sp
  2370. .in 0.08i
  2371. \fBSource:\fR PENDING\.PRG
  2372. .sp
  2373. \fBAuthor:\fR Isa Asudeh
  2374. .in 0i
  2375. .ta 1.63265i
  2376. .sp 2
  2377. .ne 20
  2378. .ps +3
  2379. .vs +3
  2380. FT_PICKDAY()    Picklist of days of week
  2381. .br
  2382. .ta
  2383. .in 0.08i
  2384. .ps -3
  2385. .vs -3
  2386. .sp 2
  2387. \fBFT_PICKDAY()
  2388. Picklist of days of week
  2389. .in 0i
  2390. .br
  2391. \l'6.24i'
  2392. .br
  2393. .sp
  2394. .in 0.08i
  2395. \fBSyntax
  2396. .sp
  2397. .in 0.4i
  2398. \fBFT_PICKDAY() -> cDayOfWeek
  2399. .sp
  2400. .in 0.08i
  2401. \fBArguments
  2402. .sp
  2403. .in 0.4i
  2404. None
  2405. .sp
  2406. .in 0.08i
  2407. \fBReturns
  2408. .sp
  2409. .in 0.4i
  2410. Character string containing day of week
  2411. .sp
  2412. .in 0.08i
  2413. \fBDescription
  2414. .sp
  2415. .in 0.4i
  2416. This function is ideal if you need the user to select a day\.
  2417. .sp
  2418. .in 0.08i
  2419. \fBExamples
  2420. .sp
  2421. .in 0.4i
  2422. mday := FT_PICKDAY()
  2423. .sp
  2424. .in 0.08i
  2425. \fBSource:\fR PICKDAY\.PRG
  2426. .sp
  2427. \fBAuthor:\fR Greg Lief
  2428. .in 0i
  2429. .ta 1.63265i
  2430. .sp 2
  2431. .ne 20
  2432. .ps +3
  2433. .vs +3
  2434. FT_PROMPT()    Define a menu item for use with FT_MENUTO()
  2435. .br
  2436. .ta
  2437. .in 0.08i
  2438. .ps -3
  2439. .vs -3
  2440. .sp 2
  2441. \fBFT_PROMPT()
  2442. Define a menu item for use with FT_MENUTO()
  2443. .in 0i
  2444. .br
  2445. \l'6.24i'
  2446. .br
  2447. .sp
  2448. .in 0.08i
  2449. \fBSyntax
  2450. .sp
  2451. .in 0.4i
  2452. .ta 3.12i
  2453. .br
  2454. \fBFT_PROMPT( <nPromptRow>,    ;
  2455. .br
  2456. .ta
  2457. .in 1.28i
  2458. .ta 2.24i
  2459. .br
  2460. \fB<nPromptCol>,    ;
  2461. .br
  2462. .ta
  2463. .ta 2.24i
  2464. .br
  2465. \fB<cPrompt>,    ;
  2466. .br
  2467. .ta
  2468. .in 1.12i
  2469. .ta 2.4i
  2470. .br
  2471. \fB[ <cPromptColor> ],    ;
  2472. .br
  2473. .ta
  2474. .ta 2.4i
  2475. .br
  2476. \fB[ <nMessageRow> ],    ;
  2477. .br
  2478. .ta
  2479. .ta 2.4i
  2480. .br
  2481. \fB[ <nMessageCol> ],    ;
  2482. .br
  2483. .ta
  2484. .ta 2.4i
  2485. .br
  2486. \fB[ <cMessage> ],    ;
  2487. .br
  2488. .ta
  2489. .ta 2.4i
  2490. .br
  2491. \fB[ <cMessageColor> ],    ;
  2492. .br
  2493. .ta
  2494. .ta 2.4i
  2495. .br
  2496. \fB[ <nHotKeyPosition> ],    ;
  2497. .br
  2498. .ta
  2499. .ta 2.4i
  2500. .br
  2501. \fB[ <cHotKeyColor> ],    ;
  2502. .br
  2503. .ta
  2504. .ta 2.4i
  2505. .br
  2506. \fB[ <cLightBarColor> ],    ;
  2507. .br
  2508. .ta
  2509. .ta 2.4i
  2510. .br
  2511. \fB[ <cLightBarHotKeyColor> ],    ;
  2512. .br
  2513. .ta
  2514. .ta 2.4i
  2515. .br
  2516. \fB[ <nUp> ],    ;
  2517. .br
  2518. .ta
  2519. .ta 2.4i
  2520. .br
  2521. \fB[ <nDown> ],    ;
  2522. .br
  2523. .ta
  2524. .ta 2.4i
  2525. .br
  2526. \fB[ <nRight> ],    ;
  2527. .br
  2528. .ta
  2529. .ta 1.84i
  2530. .br
  2531. \fB[ <nLeft> ] )    -> NIL
  2532. .br
  2533. .ta
  2534. .in 0i
  2535. .br
  2536. \fB
  2537. .sp
  2538. .in 0.08i
  2539. \fBArguments
  2540. .sp
  2541. .in 0.4i
  2542. \fB<nPromptRow>\fR is the row at which the prompt is to appear\.
  2543. .sp
  2544. \fB<nPromptCol>\fR is the column at which the prompt will appear\.
  2545. .sp
  2546. \fB<cPrompt>\fR is the prompt\'s text\.
  2547. .sp
  2548. \fB<cPromptColor>\fR is optional and is the color attribute of the
  2549. prompt\. If not specified, the default is the current
  2550. standard color as supplied by the SetColor() function\.
  2551. .sp
  2552. \fB<nMessageRow>\fR is optional and is the row at which the
  2553. message, if any, will appear\.  If not specified, the default
  2554. is the current setting of the SET MESSAGE TO command\.
  2555. .sp
  2556. \fB<nMessageCol>\fR is optional and is the column at which the
  2557. message, if any, will appear\.  If not specified, the default
  2558. either zero or centered, depending on the current setting of
  2559. the CENTER option of the SET MESSAGE TO command\.
  2560. .sp
  2561. \fB<cMessage>\fR is optional and is the message associated with
  2562. the prompt\. If not specified, then no message will be displayed\.
  2563. .sp
  2564. \fB<cMessageColor>\fR is optional and is the color attribute of
  2565. the message\. If not specified, the default is the current
  2566. standard color as reported by the SetColor() function\.
  2567. .sp
  2568. \fB<nHotKeyPosition>\fR is optional and is the position within the
  2569. prompt string where the hotkey is located\.  If not
  2570. specified, the default is 1\.
  2571. .sp
  2572. \fB<cHotKeyColor>\fR is optional and is the color attribute of the
  2573. hotkey character\.  If not specified, the default is the same
  2574. color as the rest of the prompt\.
  2575. .sp
  2576. \fB<cLightBarColor>\fR is optional and is the color attribute of
  2577. the light bar when it is positioned on this prompt\.  If not
  2578. specified, the default is the current enhanced color setting
  2579. as returned by the SetColor() function\.
  2580. .sp
  2581. \fB<cLightBarHotKeyColor>\fR is optional and is the color
  2582. attribute of the hotkey when the light bar is positioned on
  2583. this prompt\.  If not specified, the default is the same
  2584. color as the rest of the light bar\.
  2585. .sp
  2586. \fB<nUp>\fR is optional and specifies which prompt becomes active
  2587. when the up arrow key is pressed\.  If not specified, the
  2588. default is the previous prompt\.  The current setting of SET
  2589. WRAP TO is obeyed\.
  2590. .sp
  2591. \fB<nDown>\fR is optional and specifies which prompt becomes
  2592. active when the down arrow key is pressed\.  If not
  2593. specified, the default is the next prompt\.  The current
  2594. setting of SET WRAP TO is obeyed\.
  2595. .sp
  2596. \fB<nRight>\fR is optional and specifies which prompt becomes
  2597. active when the right arrow key is pressed\.  If not
  2598. specified, the default is the next prompt\.  The current
  2599. setting of SET WRAP TO is obeyed\.
  2600. .sp
  2601. \fB<nLeft>\fR is optional and specifies which prompt becomes
  2602. active when the left arrow is pressed\.  If not specified,
  2603. the default is the previous prompt\.  The current setting of
  2604. SET WRAP TO is obeyed\.
  2605. .sp
  2606. .in 0.08i
  2607. \fBReturns
  2608. .sp
  2609. .in 0.4i
  2610. NIL
  2611. .sp
  2612. .in 0.08i
  2613. \fBDescription
  2614. .sp
  2615. .in 0.4i
  2616. This function is a replacement for Clipper\'s @\.\.\.PROMPT
  2617. command\.  In fact, you may wish to consult FTMENUTO\.CH, which
  2618. contains a user-defined command that closely adheres to
  2619. standard Clipper syntax and makes this function infinitely
  2620. easier to use\.  I strongly recommend using the command
  2621. version because the large number of possible arguments makes
  2622. the function version too prone to error\.
  2623. .sp
  2624. Clipper\'s @\.\.\.PROMPT and MENU TO commands are fine as far as
  2625. they go\.  But many times you need more flexibility\.  As
  2626. you\'ll no doubt notice if you read the argument list, this
  2627. function is almost completely flexible\. You can adjust
  2628. locations and colors for every part of the prompt and its
  2629. associated message\.  In addition, since you can control the
  2630. effect of the arrow keys, you can allow both horizontal and
  2631. vertical movement, or even disable certain arrow keys if you
  2632. so desire\.
  2633. .sp
  2634. Note that this function calls an internal routine called
  2635. __FTPROMPT()\. __FTPROMPT() was written in assembler\.  Check
  2636. the file TMENU\.ASM if you\'re interested in seeing the
  2637. assembler source code\.
  2638. .sp
  2639. All the examples below use the command version\.  If you\'re
  2640. interested in seeing the function version, compile the
  2641. examples with the /P switch and then examine the resulting
  2642. \.PPO file\.
  2643. .sp
  2644. .in 0.08i
  2645. \fBExamples
  2646. .sp
  2647. .in 0.32i
  2648. .br
  2649. #include "FTMENUTO\.CH"
  2650. .br
  2651. // Simple prompt
  2652. .br
  2653. @ 1, 1 PROMPT "Menu choice #1"
  2654. .sp
  2655. .br
  2656. // Prompt with color
  2657. .br
  2658. @ 3, 1 PROMPT "Menu choice #2" PROMPTCOLOR W+/R
  2659. .sp
  2660. .br
  2661. // Prompt with a message
  2662. .br
  2663. @ 5, 1 PROMPT "Menu choice #3" MESSAGE "Go to lunch"
  2664. .sp
  2665. .br
  2666. // Prompt with pinpoint message control
  2667. .br
  2668. @ 7, 1 PROMPT "Menu choice #4" MESSAGE "Drop Dead" ;
  2669. .in 1.52i
  2670. .br
  2671. MSGROW 22 MSGCOL 4 MSGCOLOR GR+/N
  2672. .sp
  2673. .in 0.32i
  2674. .br
  2675. // Prompt with a unique lightbar color
  2676. .br
  2677. @ 9, 1 PROMPT "Menu choice #5" BARCOLOR BG+/W
  2678. .sp
  2679. .br
  2680. // Prompt with a hotkey ("#" character)
  2681. .br
  2682. @11, 1 PROMPT "Menu choice #6" HOTKEY 13
  2683. .sp
  2684. .br
  2685. // Prompt with pinpoint hotkey control
  2686. .br
  2687. @13, 1 PROMPT "Menu Choice #7" HOTKEY 13 ;
  2688. .in 1.52i
  2689. .br
  2690. HOTKEYCOLOR R+/BG BARHOTKEYCOLOR G+/N
  2691. .sp
  2692. .in 0.32i
  2693. .br
  2694. // Prompt with right and left arrow keys disabled
  2695. .br
  2696. @15, 1 PROMPT "Menu Choice #8" RIGHT 8 LEFT 8
  2697. .sp
  2698. .in 0.08i
  2699. \fBSource:\fR ATPROMPT\.PRG
  2700. .sp
  2701. \fBAuthor:\fR Ted Means
  2702. .in 0i
  2703. .sp
  2704. .in 1.5i
  2705. .ti -1.5i
  2706. .ta 1.5i
  2707. .ft B
  2708. See Also:    
  2709. .ft R
  2710. MENU TO
  2711. , @\.\.\.PROMPT
  2712. , FT_MENUTO()
  2713. .ta 1.63265i
  2714. .in 0i
  2715. .sp 2
  2716. .ne 20
  2717. .ps +3
  2718. .vs +3
  2719. FT_XBOX()    Display a self-sizing message box and message
  2720. .br
  2721. .ta
  2722. .in 0.08i
  2723. .ps -3
  2724. .vs -3
  2725. .sp 2
  2726. \fBFT_XBOX()
  2727. Display a self-sizing message box and message
  2728. .in 0i
  2729. .br
  2730. \l'6.24i'
  2731. .br
  2732. .sp
  2733. .in 0.08i
  2734. \fBSyntax
  2735. .sp
  2736. .in 0.4i
  2737. .ta 4.8i
  2738. .br
  2739. \fBFT_XBOX( [ <cJustType> ], [ <cRetWait> ], [ <cBorType> ],    ;
  2740. .br
  2741. .ta
  2742. .in 1.12i
  2743. .br
  2744. \fB[ <cBorColor> ], [ <cBoxColor> ], [ <nStartRow> ], ;
  2745. .ta 2.24i 4.08i
  2746. .br
  2747. \fB[ <nStartCol> ], <cLine1>,    <cLine2>, <cLine3>,    ;
  2748. .br
  2749. .ta
  2750. .br
  2751. \fB<cLine4>, <cLine5>, <cLine6>, <cLine7>, <cLine8> ) -> NIL
  2752. .sp
  2753. .in 0.08i
  2754. \fBArguments
  2755. .sp
  2756. .in 0.4i
  2757. \fB<cJustType>\fR is a character indicating the type of text justification\.
  2758. "L" or "l" will cause the text to be left-justified in the box\.
  2759. Centered text is the default\.
  2760. .sp
  2761. \fB<cRetWait>\fR is a character which determines if the function will wait
  2762. for a keypress after displaying the box\.  "W" or "w" will cause the
  2763. function to wait for a keypress before returning control to the
  2764. calling routine\.  Not waiting is the default
  2765. .sp
  2766. \fB<cBorType>\fR is a character which determines whether a single or double
  2767. border will be displayed\.  "D" or "d" will cause a double border to
  2768. be displayed\.  A single border is the default\.
  2769. .sp
  2770. \fB<cBorColor>\fR is a character string denoting the border color\.  \'N/W\' is
  2771. the default if this parameter is not a string\.
  2772. .sp
  2773. \fB<cBoxColor>\fR is a character string denoting the text color\.  \'W/N\' is
  2774. the default if this parameter is not a string\.
  2775. .sp
  2776. \fB<nStartRow>\fR is a number denoting the starting row\.  If \'99\' is passed,
  2777. the box is centered vertically\.  If necessary, nStartRow is decreased
  2778. so the entire box can be displayed\.
  2779. .sp
  2780. \fB<nStartCol>\fR is a number denoting the starting column\.  If \'99\' is passed,
  2781. the box is centered horizontally\.  If necessary, nStartCol is decreased
  2782. so the entire box can be displayed\.
  2783. .sp
  2784. \fB<cLine1>\fR thru \fB<cLine8>\fR are 1 to 8 character strings to be displayed\.
  2785. They are truncated to fit on the screen if necessary\.
  2786. .sp
  2787. .in 0.08i
  2788. \fBReturns
  2789. .sp
  2790. .in 0.4i
  2791. NIL
  2792. .sp
  2793. .in 0.08i
  2794. \fBDescription
  2795. .sp
  2796. .in 0.4i
  2797. FT_XBOX() allows the programmer to display a message box on the screen
  2798. without needing to calculate the dimensions of the box\.  Only the upper
  2799. left corner needs to be defined\.  The function will calculate the lower
  2800. right corner based on the number and length of strings passed\.
  2801. .sp
  2802. A maximum of eight strings can be displayed\.  If a string is too long
  2803. to fit on the screen it is truncated\.
  2804. .sp
  2805. The first seven parameters are optional\.  The default settings are:
  2806. .in 0.64i
  2807. Lines of text are centered\.
  2808. Control is returned to the calling routine immediately\.
  2809. A single line border is painted\.
  2810. The border is black on white\.
  2811. The text is white on black\.
  2812. The box is centered both vertically and horizontally\.
  2813. .sp
  2814. .in 0.4i
  2815. WARNING:  Shadowing is achieved by a call to FT_SHADOW(), an assembly
  2816. .in 1.2i
  2817. routine not found in this \.PRG\.  In order to use XBOX,
  2818. SHADOW\.OBJ must also be present somewhere (if you are using
  2819. NANFOR\.LIB, then it is)\.
  2820. .sp
  2821. .in 0.08i
  2822. \fBExamples
  2823. .sp
  2824. .in 0.4i
  2825. The following displays a two-line box with default settings:
  2826. .sp
  2827. .in 0.56i
  2828. FT_XBOX(,,,,,,,\'This is a test\',\'of the XBOX() function\')
  2829. .sp
  2830. .in 0.4i
  2831. The following uses all optional parameters and displays a three-line
  2832. box\.  The box is left-justified with a double border\.  It has a yellow
  2833. on red border and white on blue text\.  The function will wait for a
  2834. keypress before returning control to the calling routine\.
  2835. .sp
  2836. .in 0.56i
  2837. .br
  2838. FT_XBOX(\'L\',\'W\',\'D\',\'GR+/R\',\'W/B\',5,10,\'It is so nice\',;
  2839. .in 1.84i
  2840. .br
  2841. \'to not have to do the messy chore\',;
  2842. .br
  2843. \'of calculating the box size!\')
  2844. .sp
  2845. .in 0.08i
  2846. \fBSource:\fR XBOX\.PRG
  2847. .sp
  2848. \fBAuthor:\fR Don Opperthauser
  2849. .in 0i
  2850. .ta 1.63265i
  2851. .sp 2
  2852. .ne 20
  2853. .ps +3
  2854. .vs +3
  2855. MENU TO    Execute light bar menu using prompts created with @\.\.\.PROMPT
  2856. .br
  2857. .ta
  2858. .in 0.08i
  2859. .ps -3
  2860. .vs -3
  2861. .sp 2
  2862. \fBMENU TO
  2863. Execute light bar menu using prompts created with @\.\.\.PROMPT
  2864. .in 0i
  2865. .br
  2866. \l'6.24i'
  2867. .br
  2868. .sp
  2869. .in 0.08i
  2870. \fBSyntax
  2871. .sp
  2872. .in 0.4i
  2873. .br
  2874. \fB#include "FTMENUTO\.CH"
  2875. .in 0i
  2876. .br
  2877. \fB
  2878. .in 0.4i
  2879. .br
  2880. \fBMENU TO <var> [NOSNOW] [KEEP] [COLD]
  2881. .sp
  2882. .in 0.08i
  2883. \fBArguments
  2884. .sp
  2885. .in 0.4i
  2886. \fB<var>\fR is the name of the variable to assign the result of the
  2887. menu selection\.
  2888. .sp
  2889. \fBNOSNOW\fR implements snow-suppression on CGA monitors\.  If not
  2890. specified, no snow-suppression will occur\.  This option is only
  2891. meaningful for CGA displays\.
  2892. .sp
  2893. \fBKEEP\fR causes the prompt list to be retained after the menu
  2894. has been executed, allowing the menu to be executed multiple
  2895. times without redefining the prompts\.  If not specified, the
  2896. prompts will be destroyed once the menu has executed\.
  2897. .sp
  2898. \fBCOLD\fR suppresses automatic menu termination when a prompt\'s
  2899. hotkey is pressed\.  If this clause is present, pressing
  2900. a prompt\'s hotkey will move the highlight to the proper menu
  2901. selection but will not terminate the menu\.  If not present,
  2902. pressing a hot key will terminate the menu, as it does in the
  2903. standard Clipper MENU TO command\.
  2904. .sp
  2905. .in 0.08i
  2906. \fBDescription
  2907. .sp
  2908. .in 0.4i
  2909. This enhanced version of MENU TO requires the inclusion of
  2910. the header file FTMENUTO\.CH in any source file that uses it\.
  2911. It is compatible with, and may be used in place of, the standard
  2912. Clipper MENU TO command\.
  2913. .sp
  2914. This command is very similar to the Clipper version\.  The
  2915. main differences are that you have more control over hotkey
  2916. operation, and you can keep the prompts alive after the menu
  2917. has executed, if you so desire\.  Please be aware that this
  2918. function does not qualify as a "wait state" and so do not
  2919. expect any wait state-associated activity to occur\.
  2920. Nevertheless, I have included support for any SET KEY
  2921. redirections through the magic of code blocks\.  A loop is
  2922. used to check to every possible INKEY() value to see if it
  2923. has been redirected\. This is necessary because Clipper
  2924. provides no way to check SET KEY status\.  If you\'re
  2925. interested in improving performance, alter the source code
  2926. to receive an array of keys that have been redirected, and
  2927. remove the previously mentioned loop\.  Using the loop does
  2928. make the routine a bit more generic, so it\'s a trade-off\.
  2929. Your call, do as you see fit\.
  2930. .sp
  2931. Note that this command can also be called using function-style
  2932. syntax\.  See the entry for FT_MENUTO() for further details\.
  2933. .sp
  2934. Also note that this command calls an internal routine called
  2935. __FTMENUTO()\. __FTMENUTO() was written in assembler\.  Check
  2936. the file TMENU\.ASM if you\'re interested in seeing the
  2937. assembler source code\.
  2938. .sp
  2939. Header file: FTMENUTO\.CH
  2940. .sp
  2941. .in 0.08i
  2942. \fBExamples
  2943. .sp
  2944. .in 0.32i
  2945. .ta 2.08i
  2946. .br
  2947. #include "FTMENUTO\.CH"    // NECESSARY!
  2948. .br
  2949. .ta
  2950. .br
  2951. // Simple command
  2952. .br
  2953. MENU TO memvar
  2954. .sp
  2955. .br
  2956. // Implement snow-checking for CGA
  2957. .br
  2958. MENU TO memvar NOSNOW
  2959. .sp
  2960. .br
  2961. // Keep the prompts alive when finished
  2962. .br
  2963. MENU TO memvar KEEP
  2964. .sp
  2965. .br
  2966. // Use "cold" hotkeys
  2967. .br
  2968. MENU TO memvar COLD
  2969. .sp
  2970. .in 0.08i
  2971. \fBHeader File:\fR FTMENUTO\.CH
  2972. .sp
  2973. \fBSource:\fR MENUTO\.PRG
  2974. .sp
  2975. \fBAuthor:\fR Ted Means
  2976. .in 0i
  2977. .sp
  2978. .in 1.5i
  2979. .ti -1.5i
  2980. .ta 1.5i
  2981. .ft B
  2982. See Also:    
  2983. .ft R
  2984. @\.\.\.PROMPT
  2985. , FT_MENUTO()
  2986. , FT_PROMPT()
  2987.