home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / t / tw21l.exe / DEMO21.PRG < prev    next >
Text File  |  1993-02-06  |  116KB  |  2,755 lines

  1. /*─────────────────────────────────────────────────────────────────────┐
  2. │                                                                      │
  3. │                            DEMO21.PRG                                │
  4. │                                                                      │
  5. │                   Clipper 5.0 Interface Library                      │
  6. │                                                                      │
  7. │      Copyright ( C ) 1993 by Trilateral Systems Development Ltd.     │
  8. │    All Rights Reserved * Version 2.10 * Release Date: Dec 20, 1992   │
  9. │                                                                      │
  10. │                         18  Bond St. South                           │
  11. │                         Dundas, ON, Canada                           │
  12. │                              L9H 3H1                                 │
  13. │                           416-628-5086                               │
  14. │                                                                      │
  15. │     Documented: 02-06-93      at 04:50:02pm                          │
  16. └─────────────────────────────────────────────────────────────────────*/
  17. #include "twinkey.ch"
  18. #include "tsdwin.ch"
  19. #include "demo21.ch"
  20. #include "getexit.ch"
  21.  
  22. #define K_UNDO          K_CTRL_U
  23.  
  24. static lMono := .f., lOKMouse := .f.
  25. /*─────────────────────────────────────────────────────────────────────┐
  26. │ Description: Main Menu for demo21                                    │
  27. │                                                                      │
  28. │ function Main( cCmdLine )                                            │
  29. │                                                                      │
  30. │   Args: cCmdLine (/THIN /M /50 /?)                                   │
  31. └───Created: 02-06-93      at 04:50:11pm   ───────────────────────────*/
  32. function Main( cCmdLine )
  33. local nChoice := 1, nStartRow, nStartCol, nX, lexitRequested := .f.
  34. local aMenu := {}, nexit, nThickness := 2, cClrTemp, aArea :=  { 24, 24 }
  35. local aPrompts := { " «1.» TSDWIN Highlights  ",;
  36.                     " «2.» Window functions   ",;
  37.                     " «3.» Message functions  ",;
  38.                     " «4.» Menu functions     ",;
  39.                     " «5.» Browse Systems     ",;
  40.                     " «6.» Mouse Support      ",;
  41.                     " «7.» Miscellaneous      ",;
  42.                     " «8.» Hardware functions ",;
  43.                     " «9.» Placing an Order   ",;
  44.                     " «Q.» End the Demo       " }
  45. /*
  46. ┌──────────────────────────────────────────────────────────────────────────
  47. │ Set Up Environment
  48. └──────────────────────────────────────────────────────────────────────────
  49. */
  50. set cursor off
  51. set scoreboard off
  52. set wrap on
  53. /*
  54. ┌──────────────────────────────────────────────────────────────────────────
  55. │ Link in the Screen Savers
  56. └──────────────────────────────────────────────────────────────────────────
  57. */
  58. external twSSaveAsc
  59. external twWSaveAsc
  60. set key K_ALT_S to twSSaveAsc
  61. set key K_ALT_W to twWSaveAsc
  62. external twHelp
  63. external twMakeHelp
  64. setkey( K_F1, {|p,l,v| twHelp(p,l,v)} )
  65. setkey( K_ALT_H, {|p,l,v| twMakeHelp(p,l,v)} )
  66. twEvSetTime(5)
  67. twEvTimeOut( {|| twWorm() })
  68.  
  69. setkey( K_ALT_L, {|| ListProcs() })
  70. /*
  71. ┌──────────────────────────────────────────────────────────────────────────
  72. │ Parse the command line
  73. └──────────────────────────────────────────────────────────────────────────
  74. */
  75. lMono := iif( ISCOLOR(), .f. , .t. )
  76. if cCmdLine != nil
  77.     if "/THIN" $ upper( cCmdLine )
  78.         nThickness := 1
  79.     endif
  80.     if "/M" $ upper( cCmdLine )
  81.         lMono := .t.
  82.     endif
  83.     if "/50" $ upper( cCmdLine )
  84.         aArea := { 49, 49 }
  85.         setmode( 50, 80 )
  86.     endif
  87.     if "/?" $ cCmdLine
  88.         cClrTemp := setcolor( iif( !lMono, "gr+/n", "w+/n" ))
  89.         QOUT( "          Usage: demo21 <options>" )
  90.         QOUT( "" )
  91.         setcolor( iif( !lMono, "bg+/n", "w+/n" ))
  92.         QOUT( "     Options: '/THIN' for Thin Shadows." )
  93.         QOUT( "              '/M' for Monochrome" )
  94.         QOUT( "              '/50' for VGA Mode" )
  95.         setcolor( iif( !lMono, "rb+/n", "w+/n" ))
  96.         QOUT( "" )
  97.         QOUT( "              TSDWIN.LIB " )
  98.         QOUT( "     Clipper 5.01 Interface Library" )
  99.         QOUT( "   Trilateral Systems Development Ltd." )
  100.         QOUT( "             416-628-5086" );QOUT( "" );QOUT( "" )
  101.         setcolor( cClrTemp )
  102.         return nil
  103.     endif
  104. endif
  105. /*
  106. ┌──────────────────────────────────────────────────────────────────────────
  107. │ Initialize windows to thick or thin shadows
  108. │ and allow for Monchrome Override if Graphics card installed
  109. │ Save environment and DOS screen
  110. └──────────────────────────────────────────────────────────────────────────
  111. */
  112. twInit( nThickness )
  113. twOpen()
  114. /*
  115. ┌──────────────────────────────────────────────────────────────────────────
  116. │ Initialize the Mouse
  117. └──────────────────────────────────────────────────────────────────────────
  118. */
  119. #ifndef NOMOUSE
  120.     lOKMouse := twMouseInit()
  121. #endif
  122. /*
  123. ┌──────────────────────────────────────────────────────────────────────────
  124. │ Initialize TSDWIN 'meta' variables from the header file.
  125. └──────────────────────────────────────────────────────────────────────────
  126. */
  127. INITGLOBALS
  128. /*
  129. ┌──────────────────────────────────────────────────────────────────────────
  130. │ Initialize TSDWIN Message Systems
  131. └──────────────────────────────────────────────────────────────────────────
  132. */
  133. twAlertInit( , { { CBUTTON, CFBUTTON }, ;
  134.                  { CCHECK,  CFCHECK }, ;
  135.                  { CRADIO,  CFRADIO } } ) // Alert Initialization
  136. twAMsgInit(  , { COLORW, COLORN }, aArea )  // Area Message Initialization
  137. twMsgInit(   , { { COLORE, TCOLOR },;
  138.                  { COLORW, TCOLOR },;
  139.                  { COLORM, TCOLOR },;
  140.                  { COLORW, TCOLOR },;
  141.                  { COLORW, TCOLOR } })      // Messages
  142. /*
  143. ┌──────────────────────────────────────────────────────────────────────────
  144. │ Initialize the TSDWIN Help System
  145. └──────────────────────────────────────────────────────────────────────────
  146. */
  147. twHelpInit( HCOLOR, HFCOLOR, HTCOLOR, DSHADOW, DFRAME, .t., .t. )
  148. /*
  149. ┌──────────────────────────────────────────────────────────────────────────
  150. │ Begin Main Menu
  151. └──────────────────────────────────────────────────────────────────────────
  152. */
  153. setcolor( iif( ! lMono, "n/bg", "n/w" ))
  154. twExplode( .t. )
  155. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  156.  
  157. twExplode( DEXPLODE )
  158. setblink( DBLINK )
  159. twInfoLine( -2, " ", "C", 0 )
  160. twStrSlide( "C", -1, 19, "TSDWIN Interface Library for Clipper 5.01", twStdClr( COLORW ) )
  161. twInfoLine( -2, "«T»rilateral «S»ystems «D»evelopment Ltd.", "C" )
  162. twStrSlide( "L", -1, 1, "F1-twHelp", twStdClr( TCOLOR ) )
  163. twStrSlide( "R", -1, 63, "ALT_H-twMakeHelp", twStdClr( TCOLOR ) )
  164. TSDSetup( lMono )
  165.  
  166. nStartRow := 2;nStartCol := 2
  167.  
  168. for nX := 1 to 10
  169.     twCreateButton( nStartRow, nStartCol, SPACE( 21 ), .t.,, DSHADOW );nStartRow += 2
  170. next
  171.  
  172. twAttrib( .f., "n/w",  2, 28, 20, 75 )
  173. twBox( 2, 28, 20, 75, 1, "n/w" )
  174. twReplicate( 21, 29, "▀", 48, iif( ! lMono, "n/b", "n/w" ))
  175. @ twRow( 2 ), twCol( 76 ) say "▄" COLOR iif( ! lMono, "n/b", "n/w" )
  176. for nX = 1 to 18
  177.     @ twRow( nX + 2 ), twCol( 76 ) say "█" COLOR "n/n"
  178. next
  179.  
  180. do while .t.
  181.  
  182.     nStartRow := 2;nStartCol := 2
  183.     twMenuInit( 2, twRow( 3 ), twCol( 30 ), iif( ! lMono, "n/w,r/w", "n/w,w+/n" ), .t., "n/w,gr+/r,,gr+/w,n/w" )
  184.  
  185.     for nX := 1 to 10
  186.         @ nStartRow, nStartCol WPROMPT aPrompts[ nX ] MESSAGE StoreDesc( nX ) COLOR MENUCLR ;nStartRow += 2
  187.     next
  188.  
  189.     WMENU to nChoice HELPVAR MainMenu
  190.  
  191.     do case
  192.         case nChoice = 1;TSD10000()
  193.         case nChoice = 2;TSD20000()
  194.         case nChoice = 3;TSD30000()
  195.         case nChoice = 4;TSD40000()
  196.         case nChoice = 5;TSD50000()
  197.         case nChoice = 6;TSD60000()
  198.         case nChoice = 7;TSD70000()
  199.         case nChoice = 8;TSD80000()
  200.         case nChoice = 9;TSD90000()
  201.         case nChoice = 10 .or. nChoice = 0 .or. lastkey() = K_ESC
  202.             nexit := AskUser({ "Yes, I'm Finished", "No, Resume the Demo" },;
  203.                      "Are you sure you've seen enough?" )
  204.             if nexit != 2
  205.                 exit
  206.             else
  207.                 nChoice := 1
  208.             endif
  209.     endcase
  210.  
  211. enddo
  212. twAMPop();twAMPop()
  213. twPop();twPop()
  214. setmode( 25, 80 )
  215. cls
  216. return nil
  217. /*─────────────────────────────────────────────────────────────────────┐
  218. │ Description: TSDWIN Highlights (Quick Reference File)                │
  219. │                                                                      │
  220. │ function TSD10000()                                                  │
  221. │                                                                      │
  222. └───Created: 02-06-93      at 04:50:57pm   ───────────────────────────*/
  223. function TSD10000()
  224. twTextFile( FULLSCREEN, "TSWINQRF.DOC", COLORN, ;
  225.            0, DFRAME, COLORFN,, ;
  226.            {|| twTitle( "TSDWIN Quick Reference", "n/w" )})
  227. return nil
  228. /*─────────────────────────────────────────────────────────────────────┐
  229. │ Description: Basic Window Operations                                 │
  230. │                                                                      │
  231. │ function TSD20000()                                                  │
  232. │                                                                      │
  233. └───Created: 02-06-93      at 04:51:23pm   ───────────────────────────*/
  234. function TSD20000()
  235. local nWin1, nWin2, nWin3, nWin4, nWin5, nWin6, nKey := 0
  236. local nCol := 14, nRow := 4, nHandle, nX, nType, xTemp, bK_F1
  237. local aColors := { iif( ! lMono, "gr+/r" ,"n/w" ),;
  238.                    iif( ! lMono, "w+/g" ,"w/n" ),;
  239.                    iif( ! lMono, "n/*gr" ,"w+/n" ),;
  240.                    iif( ! lMono, "r/w" ,"n/w" ),;
  241.                    iif( ! lMono, "n/bg" ,"w/n" ),;
  242.                    iif( ! lMono, "gr+/*b" ,"w+/n" ),;
  243.                    iif( ! lMono, "w+/r" ,"n/w" ),;
  244.                    iif( ! lMono, "rb+/n" ,"w/n" ),;
  245.                    iif( ! lMono, "n/w" ,"w+/n" ),;
  246.                    iif( ! lMono, "g+/bg" ,"n/w" )}
  247.  
  248. nWin1 := twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME, "", COLORFN )
  249. /*
  250. ┌──────────────────────────────────────────────────────────────────────────
  251. │ Shadowing
  252. └──────────────────────────────────────────────────────────────────────────
  253. */
  254. twTitle( padc( "Window Shadows", 30 ), TCOLOR, "T", "C" )
  255. twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
  256. twOpen( 4, 5, 10, 34, COLORM, 1, DFRAME )
  257. twCenter( 3, "Shadow Type 1" )
  258. twOpen( 4, 45, 10, 74, COLORM, 7, DFRAME )
  259. twCenter( 3, "Shadow Type 7" )
  260. twOpen( 14, 5, 20, 34, COLORM, 9, DFRAME )
  261. twCenter( 3, "Shadow Type 9" )
  262. twOpen( 14, 45, 20, 74, COLORM, 3, DFRAME )
  263. twCenter( 3, "Shadow Type 3" )
  264. DemoWait( 3, "Win1" )
  265. BEEPER
  266. UserMsg( { "Remember, You Can Change Your", ;
  267.            "Shadow Thickness with twInit()",;
  268.            "    Try 'demo21 /THIN'" }, 3 )
  269. for nX = 1 to 4
  270.     twPop()
  271. next
  272. /*
  273. ┌──────────────────────────────────────────────────────────────────────────
  274. │ Frames
  275. └──────────────────────────────────────────────────────────────────────────
  276. */
  277. twTitle( padc( "Window and Box Borders", 30 ), TCOLOR, "T", "C" )
  278. twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
  279. twCenter( 2, "Windows and Boxes can have 14 different frames." )
  280. for  nX = 1 to 14
  281.     twFrame( nX );DemoWait( .5 )
  282. next
  283. twFrame( DFRAME )
  284. DemoWait( 1 )
  285. BEEPER
  286. twCenter( 4, "You can also vary the frame colour." )
  287. DemoWait( 1 )
  288. twFrame( 2, iif( !lMono, "gr+/r",  "w/n" ))
  289. DemoWait( 1 )
  290. twFrame( 2, iif( !lMono, "n/bg",   "n/w" ))
  291. DemoWait( 1 )
  292. twFrame( 2, iif( !lMono, "w+/*rb", "w+/n" ))
  293. DemoWait( 1 )
  294. twFrame( DFRAME, COLORFM )
  295. BEEPER
  296. twCenter( 6, "You can also specify separate colours to be used" )
  297. twCenter( 7, "to identify ACTIVE and INACTIVE windows!" )
  298. DemoWait( 2, "Win2" )
  299. UserMsg( "See What I Mean!!",2, 2, 2 )
  300. /*
  301. ┌──────────────────────────────────────────────────────────────────────────
  302. │ Lines
  303. └──────────────────────────────────────────────────────────────────────────
  304. */
  305. nHandle := _twHandle( nWin1 )
  306. twTitle( padc( "Lines and Boxes", 30 ), TCOLOR, "T", "C" )
  307. _twHandle( nHandle )
  308.  
  309. twClear( .f. )
  310. twCenter( 2, "There are a variety of horizontal line options." )
  311.  
  312. for nX = 1 to 11
  313.     nType := padl( STRINT( nX ), 2 )
  314.     twLeft( nX + 3, "            Type  " + nType + ":" )
  315.     twHLine( nX + 3, 23, 24, nX )
  316. next
  317. DemoWait( 3, "Win3" )
  318. twClear( .f. )
  319. twCenter( 2, "And vertical lines as well." )
  320. twCenter( 4, "Types")
  321. twCenter( 5, "  1  2  3  4  5  6  7  8  9 10 11 12" )
  322. for nX = 1 to 12
  323.     twVLine( 7, 14 + 3 * ( nX - 1 ), 8, nX )
  324. next
  325. DemoWait( 3, "Win4" )
  326. /*
  327. ┌──────────────────────────────────────────────────────────────────────────
  328. │ Titles
  329. └──────────────────────────────────────────────────────────────────────────
  330. */
  331. nHandle := _twHandle( nWin1 )
  332. twTitle( padc( "Window Titles", 30 ), TCOLOR, "T", "C" )
  333. _twHandle( nHandle )
  334. twClear( .f.)
  335. twFrame( DFRAME,,, .f. )
  336. twLeft( 3, "  You can center headers." )
  337. DemoWait( 1 )
  338. twTitle( "TSDWIN",, "T", "C" )
  339. DemoWait( 1 )
  340. @ twRow( 3 ), twCol( 27 ) say "Or right and left justify them!"
  341. DemoWait( 1 )
  342. twTitle( "Has",, "T", "L" )
  343. DemoWait( 1 )
  344. twTitle( "Windows",, "T", "R" )
  345. DemoWait( 1 )
  346. twCenter( 5, " You can do the same with footers." )
  347. DemoWait( 1 )
  348. twTitle( "Interface Library",, "B", "C" )
  349. DemoWait( 1 )
  350. twTitle( "For",, "B", "L" )
  351. DemoWait( 1 )
  352. twTitle( "You",, "B", "R" )
  353. DemoWait( 1 )
  354. twCenter( 7, " You can even choose their colour!" )
  355. twTitle( "TSDWIN", aColors[1], "T", "C" )
  356. twTitle( "Has", aColors[2], "T", "L" )
  357. twTitle( "Windows", aColors[3], "T", "R" )
  358. twTitle( "Interface Library", aColors[4], "B", "C" )
  359. twTitle( "For", aColors[5], "B", "L" )
  360. twTitle( "You", aColors[6], "B", "R" )
  361. DemoWait( 1 )
  362. for nX = 1 to 5
  363.     twTitle( "Has", aColors[1], "T", "L" )
  364.     twTitle( "TSDWIN", aColors[2], "T", "C" )
  365.     twTitle( "Windows", aColors[3], "T", "R" )
  366.     twTitle( "You", aColors[4], "B", "R" )
  367.     twTitle( "Interface Library", aColors[5], "B", "C" )
  368.     twTitle( "For", aColors[6], "B", "L" )
  369.     xTemp := aColors[1]
  370.     adel( aColors, 1 )
  371.     aColors[6] := xTemp
  372. next
  373. DemoWait( 2, "Win5" )
  374. twCenter( 9, "Delimiters can be inserted." )
  375. DemoWait( 2 )
  376. for nX = 1 to 5
  377.     twTitle( "Has", aColors[1], "T", "L", "[]" )
  378.     twTitle( "TSDWIN", aColors[2], "T", "C", "" )
  379.     twTitle( "Windows", aColors[3], "T", "R", "**" )
  380.     twTitle( "You", aColors[4], "B", "R", "╣╠" )
  381.     twTitle( "Interface Library", aColors[5], "B", "C", "││" )
  382.     twTitle( "For", aColors[6], "B", "L", "╡╞" )
  383.     xTemp := aColors[1]
  384.     adel( aColors, 1 )
  385.     aColors[6] := xTemp
  386. next
  387. DemoWait( 4, "Win6" )
  388. twFrame( DFRAME,,, .f. )
  389. /*
  390. ┌──────────────────────────────────────────────────────────────────────────
  391. │ Text Formatting
  392. └──────────────────────────────────────────────────────────────────────────
  393. */
  394. nHandle := _twHandle( nWin1 )
  395. twTitle( padc( "Text Formatting", 30 ), TCOLOR, "T", "C" )
  396. _twHandle( nHandle )
  397. twClear( .f. )
  398. twLeft( 2, "It's easy to left justify text." )
  399. DemoWait( .5 )
  400. twCenter( 4, "And center it too!" )
  401. DemoWait( .5 )
  402. twRight( 6, "You can right justify, of Course." )
  403. DemoWait( .5 )
  404. twLeft( 8, " You can replicate any character." )
  405. DemoWait( .5 )
  406. twReplicate( 8, 35, "■", 24 )
  407. DemoWait( .5 )
  408. twCenter( 10, "You can also:" )
  409. DemoWait( .5 )
  410. twSay( 12, 10 + 4, "PUT" )
  411. DemoWait( .1 )
  412. twSay( 13, 12 + 4, "TEXT" )
  413. DemoWait( .1 )
  414. twSay( 14, 14 + 4, "ANYWHERE" )
  415. DemoWait( .1 )
  416. twSay( 15, 12 + 4, "YOU" )
  417. DemoWait( .1 )
  418. twSay( 16, 10 + 4, "WANT" )
  419. DemoWait( 1 )
  420. twSay( 12, 46 - 5, " In ", aColors[1] )
  421. DemoWait( .1 )
  422. twSay( 13, 44 - 5, " Any ", aColors[2] )
  423. DemoWait( .1 )
  424. twSay( 14, 42 - 5, " Colour ", aColors[3] )
  425. DemoWait( .1 )
  426. twSay( 15, 44 - 5, " You ", aColors[4] )
  427. DemoWait( .1 )
  428. twSay( 16, 46 - 5, " Want ", aColors[5] )
  429. DemoWait( 1 )
  430. twScroll( 2, .f. )
  431.  
  432. twType( 16, 10, "You can emulate a typewriter if you want.",, .t. )
  433. twType( 17, 11, " And you can turn off the sound, too! ", aColors[ 3 ], .f. )
  434. twScroll( 2, .f. )
  435. twType( 17, 17, "Scrolling your screen  can",, .f. )
  436. twScroll( 1, .f. )
  437. twType( 17, 17, "make your application look",, .f. )
  438. twScroll( 1, .f. )
  439. twType( 17, 17, "neat. With TSDWIN Ver 2.10",, .f. )
  440. twScroll( 1, .f. )
  441. twType( 17, 17, "Library you can scroll all",, .f. )
  442. twScroll( 1, .f. )
  443. twType( 17, 17, "or part of a window,  with",, .f. )
  444. twScroll( 1, .f. )
  445. twType( 17, 17, "or without the border.    ",, .f. )
  446. for nX = 1 to 17
  447.     twScroll( , .f. )
  448.     twInkeyWait( .1 )
  449. next
  450. twCenter( 2, "Neat Tricks are Easy to Perform" )
  451. twBox( 5, 4, 15, 27, 1, BLA_CYH )
  452. twShadow( 5, 4, 15, 27, 1 )
  453. twBox( 5, 33, 15, 56, 1, BLA_CYH )
  454. twShadow( 5, 33, 15, 56, 3 )
  455. nX := 1
  456. do while nX <= 6
  457.     twSay( 6, 05, " Use Your Imagination ", YEL_RDH )
  458.     twSay( 14, 34, " Use Your Imagination ", YEL_RDH )
  459.     twInkeyWait( .1 )
  460.     twScroll( -1, .f., 6, 5, 14, 26 )
  461.     twScroll( 1, .f., 6, 34, 14, 55 )
  462.     twInkeyWait( .1 )
  463.     twSay( 6, 05, " **  Have a  Ball  ** ", BLA_GNH )
  464.     twSay( 14, 34, " **  Have a  Ball  ** ", BLA_GNH )
  465.     twInkeyWait( .1 )
  466.     twScroll( -1, .f., 6, 5, 14, 26 )
  467.     twScroll( 1, .f., 6, 34, 14, 55 )
  468.     twInkeyWait( .1 )
  469.     twSay( 6, 05, " CLIPPERING is a joy, ", WHH_BLH )
  470.     twSay( 14, 34, " CLIPPERING is a joy, ", WHH_BLH )
  471.     twInkeyWait( .1 )
  472.     twScroll( -1, .f., 6, 5, 14, 26 )
  473.     twScroll( 1, .f., 6, 34, 14, 55 )
  474.     twInkeyWait( .1 )
  475.     twSay( 6, 05, " with  TSD's  Windows ", RDH_YLH )
  476.     twSay( 14, 34, " with  TSD's  Windows ", RDH_YLH )
  477.     twInkeyWait( .1 )
  478.     twScroll( -1, .f., 6, 5, 14, 26 )
  479.     twScroll( 1, .f., 6, 34, 14, 55 )
  480.     twInkeyWait( .1 )
  481.     nX++
  482. enddo
  483. twSay( 6, 05, " **Happy Clippering** ", WHH_VIH )
  484. twSay( 14, 34, " **Happy Clippering** ", WHH_VIH )
  485. DemoWait( 2 )
  486. twScroll( 22, .t. )
  487. DemoWait( .5 )
  488. twPop()
  489. /*
  490. ┌──────────────────────────────────────────────────────────────────────────
  491. │ Boxes
  492. └──────────────────────────────────────────────────────────────────────────
  493. */
  494. twTitle( padc( "Boxes with Shadows", 30 ), TCOLOR, "T", "C" )
  495. twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
  496. twBox( nRow, nCol, nRow + 6, nCol + 20, 1,     BLA_CYH, " " )
  497. twShadow( nRow, nCol, nRow + 6, nCol + 20, 7 )
  498.  
  499. twSay( nRow + 01, nCol + 3, "████████",  RDH_CYH )
  500. twSay( nRow + 02, nCol + 3, "   ██   ",  RDH_CYH )
  501. twSay( nRow + 03, nCol + 3, "   ██   ",  RDH_CYH )
  502. twSay( nRow + 04, nCol + 3, "   ██   ",  RDH_CYH )
  503. twSay( nRow + 05, nCol + 3, "   ██   ",  RDH_CYH )
  504. twSay( nRow + 05, nCol + 9, "RILATERAL", BLU_CYH )
  505.  
  506. twBox( nRow, nCol + 32, nRow + 6, nCol + 52, 1,    BLA_CYH, " " )
  507. twShadow( nRow, nCol + 32, nRow + 6, nCol + 52, 9 )
  508.  
  509. twSay( nRow + 01, nCol + 35, "████████",  YEL_CYH )
  510. twSay( nRow + 02, nCol + 35, "██      ",  YEL_CYH )
  511. twSay( nRow + 03, nCol + 35, "████████",  YEL_CYH )
  512. twSay( nRow + 04, nCol + 35, "      ██",  YEL_CYH )
  513. twSay( nRow + 05, nCol + 35, "████████",  YEL_CYH )
  514. twSay( nRow + 05, nCol + 44, "YSTEMS",    BLU_CYH )
  515.  
  516. twBox( nRow + 9, nCol, nRow + 15, nCol + 24, 1,   BLA_CYH, " " )
  517. twShadow( nRow + 9, nCol, nRow + 15, nCol + 24, 1 )
  518.  
  519. twSay( nRow + 10, nCol + 3, "████████", WHI_CYH )
  520. twSay( nRow + 11, nCol + 3, "██     ▐", WHI_CYH )
  521. twSay( nRow + 12, nCol + 3, "██     ▐", WHI_CYH )
  522. twSay( nRow + 13, nCol + 3, "██     ▐", WHI_CYH )
  523. twSay( nRow + 14, nCol + 3, "████████", WHI_CYH )
  524. twSay( nRow + 14, nCol + 12, "EVELOPMENT", BLU_CYH )
  525.  
  526. twBox( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 1,  BLA_CYH, " " )
  527. twShadow( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 3 )
  528. twSay( nRow + 12, nCol + 39, "Limited",  BLU_CYH )
  529. DemoWait( 1, "Win7" )
  530. BEEPER
  531.  
  532. twTitle( padc( "You Can Clear a Box", 30 ), TCOLOR, "T", "C" )
  533. DemoWait( 1 )
  534. twClear( .f., " ", nRow, nCol, nRow + 6, nCol + 20 )
  535. DemoWait( 1 )
  536. BEEPER
  537.  
  538. twTitle( padc( "Or Include the Border", 30 ), TCOLOR, "T", "C" )
  539. DemoWait( 1 )
  540. twClear( .t., " ", nRow, nCol + 32, nRow + 6, nCol + 52 )
  541. DemoWait( 1 )
  542. BEEPER
  543.  
  544. twTitle( padc( "And You Can Fill It", 30 ), TCOLOR, "T", "C" )
  545. DemoWait( 1 )
  546. twClear( .t., "▒", nRow + 9, nCol, nRow + 15, nCol + 24 )
  547. DemoWait( 1 )
  548. twClear( .f., "▒", nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
  549. DemoWait( 1 )
  550. BEEPER
  551.  
  552. twTitle( padc( "You Can Also Change Colours", 30 ), TCOLOR, "T", "C" )
  553. DemoWait( 1 )
  554. twSay( nRow + 11, nCol + 3, "See What" )
  555. twAttrib( .t., YEL_RED, nRow + 9, nCol, nRow + 15, nCol + 24 )
  556. DemoWait( 1 )
  557. twSay( nRow + 11, nCol + 35, "I Mean" )
  558. twAttrib( .f., iif( ! lMono, "w+/br*", "w+/n" ), nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
  559. DemoWait( 1 )
  560. twAttrib( .f., iif( ! lMono, "b+/w", "n/w" ))
  561. DemoWait( 1 )
  562. twAttrib( .t., iif( ! lMono, "gr+/rb", "w+/n" ))
  563. DemoWait( 1 )
  564. twCenter( 0, "Patterns can Easily be made!" )
  565. twClearWith( .f., " TSDWIN ",,,,, iif( ! lMono, "gr+/b", "w+/n" ) )
  566. DemoWait( 1 )
  567. twClearWith( .f., "▓▓▒▒▒░░░░",,,,, iif( ! lMono, "gr+/b", "w+/n" ) )
  568. DemoWait( 1 )
  569. twClearWith( .f., "██│█▐▄",,,,, iif( ! lMono, "gr+/b", "w+/n" ) )
  570. DemoWait( 1 )
  571. twClearWith( .f., "│░▒▓█▓▒░│",,,,, iif( ! lMono, "gr+/b", "w+/n" ) )
  572. DemoWait( 1 )
  573. twClearWith( .f., "│▐▄▌█▐▀▌│",,,,, iif( ! lMono, "gr+/b", "w+/n" ) )
  574. DemoWait( 1 )
  575. twClear( .f. )
  576. /*
  577. ┌──────────────────────────────────────────────────────────────────────────
  578. │ Activation
  579. └──────────────────────────────────────────────────────────────────────────
  580. */
  581. twTitle( "Window Activation: USE 'F1', 'F2', 'F3', 'F4', 'ESC to exit'", TCOLOR, "T", "C" )
  582. twTitle( "Press a Key or Button or Wait", TCOLOR, "B", "C" )
  583. nWin1 := twOpen( 02, 05, 12, 44, COLORN, 1, DFRAME,, COLORFN )
  584. twTitle( "Window 1", TCOLOR )
  585. nWin5 := twOpen( 12, 42, 20, 70, COLORE, 1, DFRAME, "", COLORFE )
  586. twTitle( "I'm an Extra!!", TCOLOR )
  587. nWin2 := twOpen( 05, 10, 15, 49, COLORE, 7, DFRAME,, COLORFE )
  588. twTitle( "Window 2", TCOLOR, "T", "L" )
  589. nWin3 := twOpen( 08, 15, 18, 54, COLORM, 9, DFRAME,, COLORFM )
  590. twTitle( "Window 3", TCOLOR, "T", "R" )
  591. nWin4 := twOpen( 11, 20, 21, 59, COLORW, 3, DFRAME,, COLORFW )
  592. twTitle( "Window 4", TCOLOR, "B", "L" )
  593. bK_F1 := setkey( K_F1, nil )
  594. do while nKey != K_ESC
  595.     nKey := DemoWait( 0 )
  596.     do case
  597.         case nKey == K_F1
  598.             Window( nWin1 )
  599.         case nKey == K_F2
  600.             Window( nWin2 )
  601.         case nKey == K_F3
  602.             Window( nWin3 )
  603.         case nKey == K_F4
  604.             Window( nWin4 )
  605.     endcase
  606. enddo
  607. setkey( K_F1, bK_F1 )
  608.  
  609. nWin6 :=  twNew( 2, 2, 21,   76, COLORN, 3, 4, "░", COLORFN, "Complex Windows can be Displayed FAST!!!" )
  610. twBox(  1, 2, 10, 10, 2, YEL_BLU, " ",, 3, nWin6 )
  611. twBox( 12, 2, 17, 10, 2, YEL_BLU, " ",, 3, nWin6 )
  612. twBox( 1, 14, 17, 70, 2, YEL_BLU, " ",, 3, nWin6 )
  613. twVLine(  2, 35, 15, 2, YEL_BLU, nWin6 )
  614. twSay( 1, 35, "╦", YEL_BLU,, nWin6 )
  615. twSay( 17, 35, "╩", YEL_BLU,, nWin6 )
  616. twHLine(  3, 35, 35, 5, YEL_BLU, nWin6 )
  617. twSay( 3, 35, "╠", YEL_BLU,, nWin6 )
  618. twSay( 3, 70, "╣", YEL_BLU,, nWin6 )
  619. twSay( 2, 38, "Continental Information", YEL_BLU,, nWin6 )
  620. twHLine(  8, 15, 20, 4, YEL_BLU, nWin6 )
  621. twSay( 8, 14, "╟", YEL_BLU,, nWin6 )
  622. twSay( 8, 35, "╢", YEL_BLU,, nWin6 )
  623. twVLine(  4, 40, 13, 1, YEL_BLU, nWin6 )
  624. twSay( 3, 40, "╤", YEL_BLU,, nWin6 )
  625. twSay( 17, 40, "╧", YEL_BLU,, nWin6 )
  626. for nX := 1 to 13
  627.     twSay( 3 + nX, 37, padl( STRINT( nX ), 2 ), WHH_BLU,, nWin6 )
  628. next
  629. for nX := 1 to 8
  630.     twSay( 1 + nX, 5, padl( STRINT( nX ), 3, "0" ), WHH_BLU,, nWin6 )
  631. next
  632.  
  633. use Windemo index Windemo
  634.  
  635. for nX := 1 to 13
  636.     twSay( 3 + nX, 42, Windemo->Continent, WHT_BLU,, nWin6 )
  637.     SKIP
  638. next
  639. for nX := 1 to 6
  640.     twSay( 1 + nX, 17, Windemo->Codekey, WHT_BLU,, nWin6 )
  641.     SKIP
  642.     twSay( 1 + nX, 23, Windemo->Codekey, WHT_BLU,, nWin6 )
  643.     SKIP
  644. next
  645. twSay( 10, 20, "T S D W I N", WHT_BLU,, nWin6 )
  646. twSay( 12, 20, "     IS    ", WHT_BLU,, nWin6 )
  647. twSay( 14, 20, " Beautiful ", WHT_BLU,, nWin6 )
  648. twSay( 13, 4, "Jack", WHT_BLU,, nWin6 )
  649. twSay( 14, 4, " 'n ", WHT_BLU,, nWin6 )
  650. twSay( 15, 4, "Jill", WHT_BLU,, nWin6 )
  651. twSay( 16, 4, "Went", WHT_BLU,, nWin6 )
  652. close Windemo
  653.  
  654. twShow( nWin6 );DemoWait( 15, "Win8" );twPop()
  655.  
  656. UserMsg( { "It's Easy to Hide and", ;
  657.            " Unhide Windows with ",;
  658.            "    TSDWIN v2.10     " }, 3 )
  659.  
  660. twActivate( nWin1 )
  661. twActivate( nWin2 )
  662. twActivate( nWin3 )
  663. twActivate( nWin4 )
  664.  
  665. twHide( nWin1 );DemoWait( .5 )
  666. twHide( nWin2 );DemoWait( .5 )
  667. twHide( nWin3 );DemoWait( .5 )
  668. twHide( nWin4 );DemoWait( .5 )
  669. twHide( nWin5 );DemoWait( .5 )
  670. twUnHide( nWin5 );DemoWait( .5 )
  671. twUnHide( nWin4 );DemoWait( .5 )
  672. twUnHide( nWin3 );DemoWait( .5 )
  673. twUnHide( nWin2 );DemoWait( .5 )
  674. twUnHide( nWin1 );DemoWait( .5 )
  675.  
  676. twFrame( DFRAME,,, .f. )
  677. twTitle( "Moving Windows is Easy!", TCOLOR )
  678. twMove( -8, -20 )
  679. DemoWait( 1, "Win9" )
  680. twPop()
  681.  
  682. twFrame( DFRAME,,, .f. )
  683. twTitle( "I Move Around a Lot!", TCOLOR )
  684. twMove( 8, -20 )
  685. DemoWait( 1 )
  686. twPop()
  687.  
  688. twFrame( DFRAME,,, .f. )
  689. twTitle( "Sliding is Fun!", TCOLOR )
  690. twSlide( "R", 30 );twSlide( "U", 7 );twSlide( "R", 6 );twSlide( "U", 5 )
  691. twSlide( "L", 50 );twSlide( "D", 10 );twSlide( "R", 15 );twSlide( "U", 2 )
  692. DemoWait( 1, "WinA" )
  693. twPop()
  694.  
  695. twFrame( DFRAME,,, .f. )
  696. twTitle( "Watch me go too!", TCOLOR )
  697. twSlide( "R", 30 );twSlide( "D", 7 );twSlide( "R", 6 );twSlide( "D", 5 )
  698. twSlide( "L", 50 );twSlide( "U", 10 );twSlide( "R", 15 );twSlide( "D", 2 )
  699. DemoWait( 1 )
  700. twPop()
  701.  
  702. twSlide( "L", 30 )
  703. twSlide( "U", 10 )
  704. twTitle( "Try Sizing this window", TCOLOR )
  705. twTitle( "Use the Cursor Keys", TCOLOR, "B", "C" )
  706. do while .t.
  707.  
  708.     nKey := DemoWait(0, "WinB")
  709.     do case
  710.         case nKey == K_UP
  711.             twSize( "V", -1 )
  712.         case nKey == K_DOWN
  713.             twSize( "V", 1 )
  714.         case nKey == K_LEFT
  715.             twSize( "H", -1 )
  716.         case nKey == K_RIGHT
  717.             twSize( "H", 1 )
  718.         otherwise
  719.             exit
  720.     endcase
  721. enddo
  722.  
  723. twPop();twPop()
  724. return nil
  725. /*─────────────────────────────────────────────────────────────────────┐
  726. │ Description: Window Activation Routines                              │
  727. │                                                                      │
  728. │ procedure Window( nHandle )                                          │
  729. │                                                                      │
  730. │   Args: nHandle - Window Handle to Activate                          │
  731. │                                                                      │
  732. └───Created: 02-06-93      at 04:52:00pm   ───────────────────────────*/
  733. procedure Window( nHandle )
  734. static nRow1 :=  0, nRow2 :=  0, nRow3 :=  0, nRow4 :=  0
  735. local nRow, lOk := .t., GetList := {}
  736. do case
  737.     case nHandle = 4
  738.         nRow1 := iif( nRow1 > 6, 1, nRow1 + 1 ); nRow := nRow1
  739.     case nHandle = 6
  740.         nRow2 := iif( nRow2 > 6, 1, nRow2 + 1 ); nRow := nRow2
  741.     case nHandle = 7
  742.         nRow3 := iif( nRow3 > 6, 1, nRow3 + 1 ); nRow := nRow3
  743.     case nHandle = 8
  744.         nRow4 := iif( nRow4 > 6, 1, nRow4 + 1 ); nRow := nRow4
  745. endcase
  746. twActivate( nHandle )
  747. if nRow = 1
  748.     //twClear( .f. )
  749. endif
  750. tw_Say2( twRow( nRow + 1 ), twCol( 1 + nRow ), "Activation «" + alltrim( str( nRow )) + "»", twVattr( twStdClr( _twColor())), twVattr( twEnhClr( _twColor())))
  751. @ twRow( nRow ), twCol( 27 ) say "OK?" get lOk picture "Y"
  752. twReadModal( GetList, .t. )
  753. AskUser({ "How's That?", "Window Activation Works!" },;
  754.    "TSDWIN Activation Test" )
  755. return
  756. /*─────────────────────────────────────────────────────────────────────┐
  757. │ Description: Message System Functions                                │
  758. │                                                                      │
  759. │ function TSD30000()                                                  │
  760. │                                                                      │
  761. └───Created: 02-06-93      at 04:52:29pm   ───────────────────────────*/
  762. function TSD30000()
  763. local lexit := .f., nGetexit
  764. local nWin1 := twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME, "", COLORFN )
  765. local aActionKeys :=   {{ 1, { || TSD30001() }},;
  766.                         { 2, { || TSD30002() }},;
  767.                         { 3, { || TSD30003() }},;
  768.                         { 4, { || TSD30004() }}}
  769.  
  770. twTitle( padc( "TSDWIN Message Systems", 30 ), TCOLOR )
  771.  
  772. do while !lexit
  773.  
  774.     nGetexit := twButtonBox( "V", ;
  775.                "  Welcome to «TSDWIN»'s Message Systems.^ ^ ^"+ ;
  776.                "  With «TSDWIN V2.10» looking after the^details,you get "+ ;
  777.                "more time to look after^the important part of "+ ;
  778.                "your application...^ ^             «The Data»!", ;
  779.                { "This is a twButtonBox() Acting Like a Menu", TCOLOR },, ;
  780.                { "Alert Messages", ;
  781.                  "Windowed Messages", ;
  782.                  "Line/Area Messages", ;
  783.                  "Mouse Support", ;
  784.                  "Main Menu" },, ;
  785.                4, 5, 17, 74, DSHADOW, DFRAME,, aActionKeys,,, "AlertMain" )
  786.  
  787.     if nGetexit = 5 .or. nGetexit  =  0
  788.         lexit := .t.
  789.     endif
  790.  
  791. enddo
  792. twPop()
  793.  
  794. return nil
  795. /*─────────────────────────────────────────────────────────────────────┐
  796. │ Description: Alert System                                            │
  797. │                                                                      │
  798. │ function TSD30001()                                                  │
  799. │                                                                      │
  800. │   Args:                                                              │
  801. │                                                                      │
  802. │ Return:                                                              │
  803. │                                                                      │
  804. └───Created: 02-06-93      at 04:52:52pm   ───────────────────────────*/
  805. function TSD30001()
  806. local RetVal, cClrTemp
  807. local AText1 := ;
  808.       "One function is used in TSDWIN to create various types of " + ;
  809.       "alert boxes: PushButton Boxes, Radio Boxes and Select Boxes. " + ;
  810.       "Default buttons are created of none are passed, or, if passed " + ;
  811.       "as an array, buttons are created and displayed. In the case of " + ;
  812.       "PushButtons, they are shadowed with a thin shadow of the same " + ;
  813.       "type as the controlling window. The frame type is the same as " + ;
  814.       "that of the controlling window. The colour for each type of box " + ;
  815.       "defaults to an initial value, but is defineable. Shadow and frame " + ;
  816.       "type are defineable with each function call. The Buttons, or other " + ;
  817.       "select devices may be positioned horizontally or vertically."
  818. local ATEXT2 := ;
  819.       "The return values are, for twButtonBox() and twRadioBox(), the element " + ;
  820.       "of the array in which the buttons are held. for twCheckBox(), an array " + ;
  821.       "of checked elements is returned. All three of these functions act " + ;
  822.       "like similar constructs in MS-Windows. for the twButtonBox() function, " + ;
  823.       "the default exit key is the Enter or Escape key. for twCheckBox() and " + ;
  824.       "twRadioBox(), Enter or Space toggles the selection and the Escape key " + ;
  825.       "exits the routine. Only SINGLE choices are allowed with twButtonBox() " + ;
  826.       "and twRadioBox(). Multiple choices are allowed with twCheckBox(). " + ;
  827.       "You may pass either new exit keys or additonal " + ;
  828.       "Action keys to the function. With this feature, you may use any one " + ;
  829.       "of these functions to present a pop-up menu with very little " + ;
  830.       "code. The menu choice can then be simply the function itself. With " + ;
  831.       "Action keys, you can extend the usefulness of these functions in any " + ;
  832.       "number of ways. More examples will be available on the TSD support " + ;
  833.       "board."
  834. local AText3 := ;
  835.       "Watch while we demonstrate the same functions called with a vertical " + ;
  836.       "configuration. Remember, all that need be passed is the message text " + ;
  837.       "and an array of choices! We'll show the return values with another " + ;
  838.       "TSDWIN Messaging function twInfo(), after you make a selection."
  839.  
  840. twCheckBox( "H", ;                              // Style
  841.           AText1, ;                             // Message
  842.           {  "twCheckBox() with Custom Features", TCOLOR },, ; // Title ( No Button Number )
  843.           { "Check", "As", "Many", ;            // Button
  844.             "As", "You", "Want" }, ;            //   Array
  845.           2, 3, 5, 18, 74, DSHADOW, DFRAME,;    // Start, Coords, Shadow, Frame
  846.           ,,,, "Check1")
  847.  
  848.  
  849. twRadioBox( "H", ;                              // Style
  850.           AText2, ;                             // Message
  851.           { "This Uses twRadioBox()", TCOLOR },, ;            // Title ( No Button Number )
  852.           { "What's On", "The Radio", ;         // Button
  853.             "Tonight", "Dear" }, ;              //   Array
  854.           3, 2, 3, 21, 76, DSHADOW, DFRAME,;    // Start, Coords, Shadow, Frame
  855.           ,,,, "Radio1")
  856.  
  857. RetVal := twCheckBox( "V", ;
  858.           AText3, ;
  859.           { "Here's twCheckBox() Vertical", TCOLOR },, ;
  860.           { "Who Says", "You Can", "Only Pick", "One??" }, ;
  861.           1,, 7,, 71, DSHADOW, DFRAME,;
  862.           ,,,, "Check2")
  863.  
  864. CheckRtn( RetVal )
  865.  
  866. RetVal := twRadioBox( "V", ;
  867.           AText3, ;
  868.           { "I Know Why These are Called Radio Boxes!", TCOLOR },, ;
  869.           { "WKRP", "CHFI", "WNYC", "CKFM", "C100", "TSDL" }, ;
  870.           5, 2, 5, 16, 54, DSHADOW, DFRAME,;
  871.           ,,,, "Radio2")
  872.  
  873. CheckRtn( RetVal )
  874.  
  875. RetVal := twButtonBox( "V", ;
  876.           AText3 + " Have a look at the DEMO to see how easy " + ;
  877.           "it is to do things like this!", ;
  878.           { "LISTEN HERE!", TCOLOR },, ;
  879.           {"Well Now", ;
  880.            "It's About Time", ;
  881.            "We Got", ;
  882.            "A Few Things Straight, Dont' You?", ;
  883.            "TSDWIN Can", ;
  884.            "Make Your Life Easier", ;
  885.            "And Your Applications", ;
  886.            "More Coherent", ;
  887.            "Have No Doubt About That" }, ;
  888.            5, 2, 5, 22, 73, DSHADOW, DFRAME,;
  889.           ,,,, "Button1")
  890.  
  891. CheckRtn( RetVal )
  892.  
  893. twButtonBox( "H", "Now, wasn't that fun? You have seen some of the best Clipper functions"+;
  894.           " ever made. "+;
  895.           " TSD Ltd. will also be the first to provide Clipper users with a pseudo-object which turns lead into"+;
  896.           " gold, with the correct parameters! The parameter list will be supplied on"+;
  897.           " registration. One of the parameters will trigger a previously undocumented DOS"+;
  898.           " interrupt which starts a process rolling which will ultimately set the lead into gold routine into motion."+;
  899.           " After a suitable processing time, thin sheets of pure gold will start issuing"+;
  900.           " from the access door of the floppy drive designated as 'A' on your machine. "+;
  901.           " TSD recommends you advise your customers to have Brinks on hand when using this function."+;
  902.           " Please be warned that this particular routine may fail with some combinations of hardware."+;
  903.           " This routine has been tested on some types of hardware."+;
  904.           " Consult your hardware dealer for details about your BIOS if it doesn't work for you...", "GOLD! GOLD!! GOLD!!!", ;
  905.           1,,, 2, 5, 22, 75, DSHADOW, DFRAME,;
  906.           ,,,, "Button2")
  907.  
  908. return nil
  909. /*─────────────────────────────────────────────────────────────────────┐
  910. │ Description: Message System                                          │
  911. │                                                                      │
  912. │ function TSD30002()                                                  │
  913. │                                                                      │
  914. └───Created: 02-06-93      at 04:53:09pm   ───────────────────────────*/
  915. function TSD30002()
  916. local Var2Read := SPACE( 20 ), Var2 := SPACE( 20 )
  917.  
  918. twWarn( " Trying a Warning Message ",,,,, DSHADOW, DFRAME, "Warn1" )
  919. twInfo( " Trying an Info Message ",,,,, DSHADOW, DFRAME, "Info1" )
  920. twTextMsg("Trying a Text Message. With this one we have to have the thing do a word"+;
  921.         "wrap to put it into the box.",,,5,5,15,45,, DSHADOW, DFRAME,,, "TextMsg1" )
  922.  
  923. twInquire( {"Trying out an Inquire Message:",;
  924.            "Let's see if more lines will work out OK too?",;
  925.            "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",;
  926.            "";
  927.            },, Var2Read,,, DSHADOW, DFRAME,, "Inquire1" )
  928.  
  929. twInquire( "Trying out another Inquire Message:","Trying", Var2,;
  930.               ,, DSHADOW, DFRAME,, "Inquire2" )
  931.  
  932. twInfo( {" Trying an Info Message ",;
  933.        "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6",;
  934.        "Item 7", "Item 8", "Item 9", "Item 10", "Item 11", "Item 12" };
  935.        ,,,,, DSHADOW, DFRAME, "Info2" )
  936.  
  937. twMsgInit( 1, iif( !lMono, "gr+/r,w/n,,,w+/n", "n/w,w+/n,,,w/n"))
  938.  
  939. twInfo( {" You can change colours ",;
  940.        "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7" };
  941.        ,,,,, DSHADOW, DFRAME, "Info3" )
  942.  
  943. twMsgInit( 1, { COLORE, TCOLOR })
  944. return nil
  945. /*─────────────────────────────────────────────────────────────────────┐
  946. │ Description: Area Message System                                     │
  947. │                                                                      │
  948. │ function TSD30003()                                                  │
  949. │                                                                      │
  950. └───Created: 02-06-93      at 04:53:25pm   ───────────────────────────*/
  951. function TSD30003()
  952. BEEPER
  953. twInfoLine( 5, "twInfoLine() Puts Messages in a Pre-Defined Area. ( «Any Key» or «Button» )" , "L" )
  954. BEEPER
  955. twInfoLine( 5, "You Pick the Justification ( «Any Key» or «Button» )" , "C" )
  956. BEEPER
  957. twInfoLine( 5, "You can also Change the Area! ( «Any Key» or «Button» )" , "R", 20 )
  958. BEEPER
  959. twInfoLine( 5, "You can have «TWO» Colour Attributes too! ( «Any Key» or «Button» )" )
  960. BEEPER
  961. twWarnLine( 5, "twWarnLine() is the same «EXCEPT» for the default colour." )
  962. return nil
  963. /*─────────────────────────────────────────────────────────────────────┐
  964. │ Description: Messages Mouse Support                                  │
  965. │                                                                      │
  966. │ function TSD30004()                                                  │
  967. │                                                                      │
  968. └───Created: 02-06-93      at 04:53:46pm   ───────────────────────────*/
  969. function TSD30004()
  970. local aMsg := {}
  971. aadd( aMsg, "Mouse support for the TSDWIN message systems is automatic." )
  972. aadd( aMsg, "" )
  973. aadd( aMsg, "When using twInfo() and twWarn() the right button  returns" )
  974. aadd( aMsg, "the ESC key and the left button, the ENTER key." )
  975. aadd( aMsg, "" )
  976. aadd( aMsg, "With the Alert Boxes,  the  Right Button always enters ESC" )
  977. aadd( aMsg, "The left will 'Select' in twButtonBox() and 'Tag  or Mark'" )
  978. aadd( aMsg, "in twCheckBox() and twRadioBox()" )
  979. aadd( aMsg, "" )
  980. aadd( aMsg, "twInfoLine() and twWarnLine() simply wait for a button  or" )
  981. aadd( aMsg, "key press, if they are in a waiting state. " )
  982. aadd( aMsg, "" )
  983. aadd( aMsg, "The windowed and area messages may be called to:" )
  984. aadd( aMsg, "       Wait for a button or key press" )
  985. aadd( aMsg, "       Leave their display on the screen" )
  986. aadd( aMsg, "       Leave their display then remove it later." )
  987. UserMsg( aMsg )
  988. return nil
  989. /*─────────────────────────────────────────────────────────────────────┐
  990. │ Description: Check a return value and display it.                    │
  991. │                                                                      │
  992. │ function CheckRtn( RetVal )                                          │
  993. │                                                                      │
  994. │   Args: RetVal - The Return Value                                    │
  995. │                                                                      │
  996. │ Return: TRUE                                                         │
  997. │                                                                      │
  998. └───Created: 02-06-93      at 04:54:04pm   ───────────────────────────*/
  999. function CheckRtn( RetVal )
  1000. local aTempArray := {}, aLen, Cntr
  1001. if valtype( RetVal ) == 'N'
  1002.     aadd( aTempArray, "Your return Value Was:" )
  1003.     aadd( aTempArray, "Element Number: "+STRINT( RetVal ))
  1004.     twInfo( aTempArray,,,,, DSHADOW, DFRAME )
  1005. elseif valtype( RetVal ) == 'A'
  1006.     aLen := len( RetVal );Cntr:=0
  1007.     aadd( aTempArray, "You Picked:" )
  1008.     aeval( RetVal, {|| Cntr++, aadd( aTempArray, RetVal[ Cntr] ) } )
  1009.     twInfo( aTempArray,,,,, DSHADOW, DFRAME )
  1010. endif
  1011. return .t.
  1012. /*─────────────────────────────────────────────────────────────────────┐
  1013. │ Description: TSDWIN Menu Systems                                     │
  1014. │                                                                      │
  1015. │ function TSD40000()                                                  │
  1016. │                                                                      │
  1017. └───Created: 02-06-93      at 04:54:52pm   ───────────────────────────*/
  1018. function TSD40000()
  1019. local amArray, nChoice, cHeader, aMsg, wT, wL, nX
  1020. local nRowSkip, cJustify, cUser, nStartRow, lSBar
  1021. local aItems := { "one","two","three","four","five","six","seven","eight",;
  1022.                 "nine","ten","eleven","twelve","thirteen","fourteen",;
  1023.                 "fifteen","sixteen","seventeen","eighteen","nineteen",;
  1024.                 "twenty" }
  1025. local nRow := 5, nStartCol := 1, nEndCol := maxcol() - 1
  1026. local nStart := 0
  1027.  
  1028. UserMsg( { "The Main Menu in this demo uses  'twMenuTo().",;
  1029.            "This demonstration shows how  twPopMenu() and",;
  1030.            "twPopChoice() can be used to create menus.", "",;
  1031.            "The main differences between the two are  the",;
  1032.            "automatic handling of HotKeys in  twPopMenu()",;
  1033.            "and the different mouse confinement when  you",;
  1034.            "use twPopChoice().", "",;
  1035.            "for a more detailed description of the Choice",;
  1036.            "functions, see the section on Browses!", "",;
  1037.            "twLineMenu() gives you an expandable bar line",;
  1038.            "menu with indicators and mouse support." })
  1039.  
  1040. twOpen( FULLSCREEN, COLORN, DSHADOW, D2FRAME, "", COLORFN )
  1041. twTitle( padc( "TSDWIN Menus", 30 ), TCOLOR, "T", "C" )
  1042.  
  1043. amArray := { "«1.» Menu Item 1", ;
  1044.              "«2.» Menu Item 2", ;
  1045.              "«3.» Menu Item 3", ;
  1046.              "«4.» Menu Item 4", ;
  1047.              "«5.» Menu Item 5", ;
  1048.              "«Q.» Quit" }
  1049. nChoice := 1
  1050. do while nChoice != 0
  1051.     twMenuInit( 0,,,, .t., MENUPCLR )
  1052.     cHeader    := "twPopMenu()"
  1053.     aMsg       := nil
  1054.     wT         := 7
  1055.     wL         := 15
  1056.     nRowSkip   := 1
  1057.     nChoice := twPopMenu( amArray, cHeader, aMsg, wT, wL, nChoice, MENUPCLR, ;
  1058.                           DSHADOW, D2FRAME, MENUFCLR, MENUTCLR, nRowSkip )
  1059.     do case
  1060.         case nChoice >= 1 .and. nChoice <= 5
  1061.             UserMsg( "You Chose " + STRINT( nChoice ))
  1062.         case nChoice = 6
  1063.             exit
  1064.     endcase
  1065. enddo
  1066.  
  1067. nChoice := 1
  1068. setblink( .f. )
  1069. do while nChoice != 0
  1070.     twMenuInit( 0,,,, .t., MENUPCLR )
  1071.     cHeader    := "twPopMenu()"
  1072.     aMsg       := nil
  1073.     wT         := 5
  1074.     wL         := 15
  1075.     nRowSkip   := 2
  1076.  
  1077.     nChoice := twPopMenu( amArray, cHeader, aMsg, wT, wL, nChoice, MENUPCLR, ;
  1078.                           DSHADOW, D2FRAME, MENUFCLR, MENUTCLR, nRowSkip )
  1079.     do case
  1080.         case nChoice >= 1 .and. nChoice <= 5
  1081.             UserMsg( "You Chose " + STRINT( nChoice ))
  1082.         case nChoice = 6
  1083.             exit
  1084.     endcase
  1085. enddo
  1086.  
  1087. nX := 0
  1088. aeval( amArray, {|| nX++, amArray[ nX ] := ;
  1089.                  strtran( strtran( amArray[ nX ], "»", "" ), "«", "" )})
  1090. nChoice := 1
  1091. do while nChoice != 0
  1092.     cHeader    := "twPopChoice()"
  1093.     aMsg       := nil
  1094.     wT         := 8
  1095.     wL         := 45
  1096.     cJustify   := "L"
  1097.     cUser      := nil
  1098.     nStartRow  := 3
  1099.     lSBar      := .f.
  1100.  
  1101.     nChoice := twPopChoice( amArray, cHeader, wT, wL, nChoice, MENUPCLR, DSHADOW, ;
  1102.                             D2FRAME, MENUFCLR, cJustify, cUser, nStartRow, lSbar )
  1103.     do case
  1104.         case nChoice >= 1 .and. nChoice <= 5
  1105.             twInfo( "You Chose " + STRINT( nChoice ))
  1106.         case nChoice = 6
  1107.             exit
  1108.     endcase
  1109. enddo
  1110.  
  1111. amArray := {}
  1112. for nChoice = 1 to 30
  1113.     aadd( amArray, padl( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1114. next
  1115.  
  1116. nChoice := 1
  1117. setblink( .f. )
  1118.  
  1119. do while nChoice != 0
  1120.     cHeader    := "twPopChoice()"
  1121.     aMsg       := nil
  1122.     wT         := 8
  1123.     wL         := 45
  1124.     cJustify   := "L"
  1125.     cUser      := nil
  1126.     nStartRow  := 3
  1127.     lSBar      := .t.
  1128.  
  1129.     nChoice := twPopChoice( amArray, cHeader, wT, wL, nChoice, MENUPCLR, DSHADOW, ;
  1130.                             D2FRAME, MENUFCLR, cJustify, cUser, nStartRow, lSbar )
  1131.  
  1132.     if nChoice >= 1 .and. nChoice <= 30
  1133.         twInfo( "You Chose " + STRINT( nChoice ))
  1134.     else
  1135.         exit
  1136.     endif
  1137. enddo
  1138.  
  1139.  
  1140. do while .t.
  1141.  
  1142.     nChoice := twLineMenu( nRow, nStartCol, nEndCol, aItems, 2, ;
  1143.                     MENUPCLR,,,,,,,,,, "FirstLine" )
  1144.  
  1145.     if nChoice = 0
  1146.         exit
  1147.     endif
  1148.  
  1149.     UserMsg( "You Chose " + aItems[ nChoice ] )
  1150.  
  1151. enddo
  1152.  
  1153. aItems := {}
  1154. nRow += 3
  1155. use Windemo
  1156. do while !eof()
  1157.     aadd( aItems, " " +trim( Windemo->Ice_Cream ) )
  1158.     skip
  1159. enddo
  1160.  
  1161. do while .t.
  1162.  
  1163.     nChoice := twLineMenu( nRow, nStartCol + 2, nEndCol - 2, aItems,, MENUPCLR;
  1164.                             ,, .f.,, {|| twTitle( "Windowed twLineMenu() Test", TCOLOR) },;
  1165.                             , .t., DSHADOW, D2FRAME, MENUFCLR, "SecdLine" )
  1166.  
  1167.     if nChoice = 0
  1168.         exit
  1169.     endif
  1170.  
  1171.     UserMsg( "You Chose " + aItems[ nChoice ] )
  1172. enddo
  1173.  
  1174. close Windemo
  1175.  
  1176. twPop()
  1177. return nil
  1178. /*─────────────────────────────────────────────────────────────────────┐
  1179. │ Description: TSDWIN Browse Systems                                   │
  1180. │                                                                      │
  1181. │ function TSD50000()                                                  │
  1182. │                                                                      │
  1183. └───Created: 02-06-93      at 04:55:16pm   ───────────────────────────*/
  1184. function TSD50000()
  1185. local nTop, nLeft, nBottom, nRight, cUser, nStartItem, nWinRow, aSrch
  1186. local nTag, cACColor, cBarColor, wT, wL, wB, wR, nChoice, amArray, aLogicals
  1187. local nButRow, nButCol, aMouseID, f, nParts, nCost, nSell, aHelp, aColumns
  1188. local cTitle, cTopKey, bScopeBlock, lEditFlag, aActionKeys, wColor, wSType
  1189. local wFType, wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, bPreRun
  1190. local bPostRun, nexitKey, aSeparators, lOKAppend, lSound, nCount, aTemp
  1191.  
  1192. UserMsg( { "To conserve space, only the new  browses in  TSDWIN V 2.10",;
  1193.            "will be demonstrated here. They automatically invoke mouse",;
  1194.            "support if you have called twMouseInit() at the  beginning",;
  1195.            "of your program.", "",;
  1196.            "We shall show you:", "",;
  1197.            "    twACChoice() - a moused replacement for ACHOICE()",;
  1198.            "    twABBrowse() - a simple array browser.",;
  1199.            "    twRABrowse() - a totally configurable array browser.",;
  1200.            "    twBRBrowse() - a totally configurable DBF browser.", "",;
  1201.            "You should consult TSDWIN.NG for more information on these",;
  1202.            "functions, as they are very flexible.", "",;
  1203.            "During the demo, the line at the bottom of the screen, and",;
  1204.            "displayed buttons will be Mouse Hot Spots." })
  1205.  
  1206. twOpen( FULLSCREEN, COLORM, DSHADOW, DFRAME, "∙", COLORFM )
  1207. twTitle( padc( "TSDWIN Browse Systems", 30 ), TCOLOR, "T", "C" )
  1208.  
  1209. twOpen( 3, 3, 21, 76, COLORN, DSHADOW, DFRAME,, COLORFN )
  1210.  
  1211. nTop       := twRow( 3 )
  1212. nLeft      := twCol( 4 )
  1213. nBottom    := twRow( 10 )
  1214. nRight     := twCol( 22 )
  1215. cUser      := nil
  1216. nStartItem := 1
  1217. nWinRow    := 1
  1218. lScBar     := .t.
  1219. nTag       := 0
  1220. cACColor   := iif( ! lMono, "w+/br,gr+/r,n/bg,w+/r,w/br", ;
  1221.                             "w+/n,n/w,n/w,w/n,w+/n" )
  1222. cBarColor  := iif( ! lMono, "w+/g" , "n/w" )
  1223.  
  1224. twClear( .f.)
  1225. twTitle( padc( "twACChoice() with No Tagging + Logicals", 55 ), "n/w")
  1226. twSay( 12, 3, "Right Button: exit   │ Left Button: Select" )
  1227. twSay( 13, 3, "       ENTER: Select │         ESC: exit" )
  1228. twSay( 14, 3, 'cACColor  := "w+/br,gr+/r,n/bg,w+/r,w/br"' )
  1229. twSay( 15, 3, 'cBarColor := "w+/g"' )
  1230. twSay( 16, 3, '     nTag := 0' )
  1231. twBox( 2, 3, 11, 24, 1 )
  1232. nChoice := 1
  1233. do while nChoice != 0
  1234.  
  1235.     amArray := {}
  1236.     for nChoice = 1 to 30
  1237.         aadd( amArray, padl( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1238.     next
  1239.     aLogicals := array( 30 )
  1240.     afill( aLogicals, .t. )
  1241.     aLogicals[ 04 ] := .f.
  1242.     aLogicals[ 14 ] := .f.
  1243.     aLogicals[ 15 ] := .f.
  1244.     aLogicals[ 20 ] := .f.
  1245.     aLogicals[ 22 ] := .f.
  1246.     aLogicals[ 23 ] := .f.
  1247.     aLogicals[ 24 ] := .f.
  1248.     aLogicals[ 25 ] := .f.
  1249.     aLogicals[ 26 ] := .f.
  1250.  
  1251.     nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
  1252.                         aLogicals, cUser, nStartItem, nWinRow, ;
  1253.                         lScBar, nTag, cACColor, cBarColor )
  1254.  
  1255.     UserMsg( "You Chose " + STRINT( nChoice ))
  1256.  
  1257. enddo
  1258.  
  1259. twClear( .f.)
  1260. nButRow := _twTop()
  1261. nButCol := 50
  1262. cACColor   := iif( ! lMono, "w+/g,bg+/n,n/bg,w+/r,w/gr", ;
  1263.                             "w+/n,n/w,n/w,w/n,w+/n" )
  1264. cBarColor  := iif( ! lMono, "n/bg+" , "n/w" )
  1265.  
  1266. aMouseID := array( 7 )
  1267. twCreateButton( nButRow, nButCol, padc( "Help", 13), .f., iif( !lMono, "gr+/r", "n/w"))
  1268.  
  1269. #ifndef NOMOUSE
  1270.     aMouseID[ 1 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1271.                     {|| SpotDeactivate( aMouseID ),;
  1272.                         _twKBoard( K_F1 ),;
  1273.                         SpotActivate( aMouseID ) } , 1, , .t. )
  1274. #endif
  1275.  
  1276. nButRow += 2
  1277. twCreateButton( nButRow, nButCol, padc( "Tag All", 13), .f., iif( !lMono, "gr+/r", "n/w"))
  1278.  
  1279. #ifndef NOMOUSE
  1280.     aMouseID[ 2 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1281.                     {|| _twKBoard( K_F7 ) } , 1, , .t. )
  1282. #endif
  1283. nButRow += 2
  1284. twCreateButton( nButRow, nButCol, padc( "UnTag All", 13), .f., iif( !lMono, "gr+/r", "n/w"))
  1285. #ifndef NOMOUSE
  1286.     aMouseID[ 3 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1287.                     {|| _twKBoard( K_F8 ) } , 1, , .t. )
  1288. #endif
  1289. nButRow += 2
  1290. twCreateButton( nButRow, nButCol, padc( "Swap Tags", 13), .f., iif( !lMono, "gr+/r", "n/w"))
  1291. #ifndef NOMOUSE
  1292.     aMouseID[ 4 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1293.                     {|| _twKBoard( K_F9 ) } , 1, , .t. )
  1294. #endif
  1295. nButRow += 2
  1296. twCreateButton( nButRow, nButCol, padc( "Tag Current", 13), .f., iif( !lMono, "gr+/r", "n/w"))
  1297. #ifndef NOMOUSE
  1298.     aMouseID[ 5 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1299.                     {|| __keyboard( chr( 32 ))} , 1, , .t. )
  1300. #endif
  1301. nButRow += 2
  1302. twCreateButton( nButRow, nButCol, padc( "Select", 13), .f., iif( !lMono, "gr+/r", "n/w"))
  1303. #ifndef NOMOUSE
  1304.     aMouseID[ 6 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1305.                     {|| __keyboard( chr( 13 ))} , 1, , .t. )
  1306. #endif
  1307. nButRow += 2
  1308. twCreateButton( nButRow, nButCol, padc( "Done", 13), .f., iif( !lMono, "gr+/r", "n/w"))
  1309. #ifndef NOMOUSE
  1310.     aMouseID[ 7 ] := twACHotSpot( twRow( nButRow ), twCol( nButCol ), twRow( nButRow ), twCol( nButCol + 13 ), ;
  1311.                     {|| __keyboard( chr( 27 ))} , 1, , .t. )
  1312. #endif
  1313.  
  1314. setkey( K_F1, {|| HelpACChoice() } )
  1315.  
  1316. nTag       := 1 // Allow Tagging, NOT pretagged
  1317.  
  1318. twTitle( padc( "twACChoice() with Default Tagging + nil Logicals", 55 ), "n/w")
  1319. twSay( 12, 3, "Right Button: Tag    │ Left Button: Select" )
  1320. twSay( 13, 3, "       ENTER: Select │         ESC: exit" )
  1321. twSay( 14, 3, "       SPACE: Tag" )
  1322. twSay( 15, 3, 'cACColor  := "w+/b,bg+/n,n/bg,w+/r,w/gr"' )
  1323. twSay( 16, 3, 'cBarColor := "n/bg+"' )
  1324. twSay( 17, 3, '     nTag := 1' )
  1325. nChoice := 1
  1326. do while nChoice != 0
  1327.  
  1328.     amArray := {}
  1329.     for nChoice = 1 to 30
  1330.         aadd( amArray, padl( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1331.     next
  1332.     aLogicals := array( 30 )
  1333.     aLogicals := nil
  1334.  
  1335.     nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
  1336.                         aLogicals, cUser, nStartItem, nWinRow, ;
  1337.                         lScBar, nTag, cACColor, cBarColor )
  1338.     UserMsg( "You Chose " + STRINT( nChoice ))
  1339. enddo
  1340.  
  1341. nTag       := 2 // Allow tagging - PreTagged
  1342.  
  1343. nChoice := 1
  1344. cACColor   := iif( ! lMono, "n/bg,gr+/r,r/w,w+/g,w/b", ;
  1345.                             "w+/n,n/w,n/w,w/n,w+/n" )
  1346. cBarColor  := iif( ! lMono, "w+/b" , "n/w" )
  1347. twTitle( padc( "twACChoice() with Pre-Tagging + True Logicals", 55 ), "n/w")
  1348. twSay( 12, 3, "Right Button: Tag    │ Left Button: Select" )
  1349. twSay( 13, 3, "       ENTER: Select │         ESC: exit" )
  1350. twSay( 14, 3, "       SPACE: Tag" )
  1351. twSay( 15, 3, 'cACColor   := "n/bg,gr+/r,r/w,w+/g,w/b"' )
  1352. twSay( 16, 3, 'cBarColor  := "w+/b"' )
  1353. twSay( 17, 3, '     nTag := 2' )
  1354.  
  1355. do while nChoice != 0
  1356.     amArray := {}
  1357.     for nChoice = 1 to 30
  1358.         aadd( amArray, padl( STRINT( nChoice ), 2 ) +   ". Menu Item " + STRINT( nChoice ))
  1359.     next
  1360.     aLogicals := array( 30 )
  1361.     afill( aLogicals, .t. )
  1362.     for f = 1 to len( amArray )
  1363.         // Create some tags
  1364.         if f / 2 == int( f / 2 )
  1365.             amArray[ f ] := amArray[ f ] + "√"
  1366.         else
  1367.             amArray[ f ] := amArray[ f ] + " "
  1368.         endif
  1369.     next
  1370.  
  1371.     nChoice := twACChoice( nTop, nLeft, nBottom, nRight, amArray, ;
  1372.                         aLogicals, cUser, nStartItem, nWinRow, ;
  1373.                         lScBar, nTag, cACColor, cBarColor )
  1374.     UserMsg( "You Chose " + STRINT( nChoice ))
  1375. enddo
  1376. twPop()
  1377.  
  1378. #ifndef NOMOUSE
  1379.     for nChoice = 1 to 7
  1380.         twACRemHotSpot( aMouseID[ nChoice ] )
  1381.     next
  1382. #endif
  1383.  
  1384. setkey( K_F1,{|p,l,v| twHelp(p,l,v) } )
  1385. set deleted on
  1386. set confirm on
  1387.  
  1388. use PART index PART1 alias Part new
  1389. nParts := 0; nCost := 0; nSell := 0
  1390. DBeval( {|| nParts += Part->PonHand, ;
  1391.             nCost += ( Part->PonHand * Part->PCost ),;
  1392.             nSell += ( Part->PonHand * Part->PSell ) } )
  1393. go top
  1394.  
  1395. aHelp := {}
  1396. aadd( aHelp, {|| BRHelp( "GENHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1397. aadd( aHelp, {|| BRHelp( "COLHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1398. aadd( aHelp, {|| BRHelp( "ACTHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1399. aadd( aHelp, {|| BRHelp( "HOTHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1400. aadd( aHelp, {|| BRHelp( "MSEHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1401. aadd( aHelp, {|| BRHelp( "CARHLP.DOC", "twBRBrowse() Demo Help", aMouseID ) } )
  1402.  
  1403. wT          := 3
  1404. wL          := 11
  1405. wB          := 21
  1406. wR          := 68
  1407. aColumns    := {}
  1408. cTitle      := nil
  1409. cTopKey     := nil
  1410. bScopeBlock := nil
  1411. lEditFlag   := .t.
  1412. aActionKeys := {}
  1413. wColor   := iif( ! lMono, "w+/b,gr+/r,,gr+/b,bg+/b,br+/b,g+/b,n/w", ;
  1414.                           "w+/n,n/w,,w/n,w+/n,w/n,w+/n,n/w" )
  1415. wSType      := 3
  1416. wFType      := 10
  1417. wFColor     := iif( !lMono, { "w+/b", "w/b" }, { "w+/n", "w/n"} )
  1418. lScBar      := .t.
  1419. lMsgs       := .t.
  1420. lAlite      := .t.
  1421. nFreeze     := 3
  1422. lStabilize  := .t.
  1423. bPreRun     := {|x,y| twTitle( "Sample Inventory Maintenance", "n/w", "T", "C" ),;
  1424.                     x := twBRGetBrowse(), y := x:getcolumn( 2 ),;
  1425.                     y:colorblock := {|| { 5, 2 } },;
  1426.                     y := x:getcolumn( 3 ),;
  1427.                     y:colorblock := {|| iif( Part->POnHand > 500, { 1, 2 }, ;
  1428.                                         iif( Part->POnHand < 100,  { 7,  2 }, { 6, 2 } )) },;
  1429.                     x:ColPos := 1 }
  1430. bPostRun    := nil
  1431. nexitKey    := K_ALT_X
  1432. aSeparators := { "═", "  ", "─" }
  1433. lOKAppend   := .t.
  1434. lSound      := .t.
  1435. /*
  1436.  aSrch array structure
  1437.  
  1438.   { Column Number in which to start key display,
  1439.     Hilite Bar Exception Color
  1440.     Code block for search access to dbf.
  1441.     Prefix for common keys in scoped browses,
  1442.     Mask for display bar. }
  1443.  
  1444.   add columns
  1445.   aadd( aColumns, { cHead, bBlk, nWid, cFoot, lEdit, cPic, bWhn, bVld, ;
  1446.                     bRdr, aClr, bClr, cCsep, cHsep, cFsep })
  1447.  
  1448. */
  1449. aColumns := {}
  1450. aadd( aColumns, { "Part;Number", ;
  1451.                     {|x| iif( x=nil, Part->Pnumber, Part->Pnumber := x ) } ;
  1452.                     ,,, .t., "@! XXX-999999999",,, {|x| BRGetReader(x,,.t.) } })
  1453. aadd( aColumns, { "Part;Description", ;
  1454.                     {|x| iif( x=nil, Part->PDesc, Part->PDesc := x ) } ;
  1455.                     ,, "Total;Values;", .t., "@X",,, {|x| BRGetReader(x,,.t.) } })
  1456. aadd( aColumns, { "Number;On Hand", ;
  1457.                     {|x| iif( x=nil, Part->POnHand, Part->POnHand := x ) } ;
  1458.                     ,, transform( nParts, "999999" ) + ";     $",;
  1459.                     .t., "9999",, {|x| ShowParts(x, @nParts, @nSell, @nCost ) }, {|x| BRGetReader(x,,.t.) } })
  1460. aadd( aColumns, { "Selling;Price", ;
  1461.                     {|x| iif( x=nil, Part->PSell, Part->PSell := x ) } ;
  1462.                     ,, "  ;" + transform( nSell, "9999999.99" ),;
  1463.                     .t., "9999.99",, {|x| ShowSell(x, @nSell ) }, {|x| BRGetReader(x,,.t.) } })
  1464. aadd( aColumns, { "Cost;Price", ;
  1465.                     {|x| iif( x=nil, Part->PCost, Part->PCost := x ) } ;
  1466.                     ,, "  ;" + transform( nCost, "9999999.99" ), .t., "9999.99",, {|x| ShowCost(x, @nCost ) } })
  1467. /*
  1468. ┌──────────────────────────────────────────────────────────────────────────
  1469. │ add actionkeys
  1470. └──────────────────────────────────────────────────────────────────────────
  1471. */
  1472. aActionKeys := {}
  1473. aadd( aActionKeys, { K_F2, aHelp[ 1 ] })
  1474. aadd( aActionKeys, { K_F3, aHelp[ 2 ] })
  1475. aadd( aActionKeys, { K_F4, aHelp[ 3 ] })
  1476. aadd( aActionKeys, { K_F5, aHelp[ 4 ] })
  1477. aadd( aActionKeys, { K_F6, aHelp[ 5 ] })
  1478. aadd( aActionKeys, { K_F7, aHelp[ 6 ] })
  1479.  
  1480. #ifndef NOMOUSE
  1481. /*
  1482. ┌──────────────────────────────────────────────────────────────────────────
  1483. │ add hot spots
  1484. └──────────────────────────────────────────────────────────────────────────
  1485. */
  1486.     aMouseID := array( 6 )
  1487.     aMouseID[ 1 ] := twBRHotSpot( 24, 0, 24, 9,   aHelp[ 1 ], ;
  1488.                                     1,, .t. )
  1489.     aMouseID[ 2 ] := twBRHotSpot( 24, 11, 24, 20, aHelp[ 2 ], ;
  1490.                                     1,, .t. )
  1491.     aMouseID[ 3 ] := twBRHotSpot( 24, 22, 24, 34, aHelp[ 3 ], ;
  1492.                                     1,, .t. )
  1493.     aMouseID[ 4 ] := twBRHotSpot( 24, 36, 24, 47, aHelp[ 4 ], ;
  1494.                                     1,, .t. )
  1495.     aMouseID[ 5 ] := twBRHotSpot( 24, 49, 24, 56, aHelp[ 5 ], ;
  1496.                                     1,, .t. )
  1497.     aMouseID[ 6 ] := twBRHotSpot( 24, 58, 24, 65, aHelp[ 6 ], ;
  1498.                                     1,, .t. )
  1499.     aMouseID[ 6 ] := twBRHotSpot( 24, 67, 24, 74, {|| __keyboard( chr( K_ESC )) } , ;
  1500.                                     1,, .t. )
  1501. #endif
  1502.  
  1503. twInfoLine( -2, "«F2»∙General «F3»∙Columns «F4»∙Actionkeys «F5»∙Hot Spots «F6»∙Mouse «F7»∙Cargo «ESC»∙exit" )
  1504. do while .t.
  1505.  
  1506.     twBRBrowse( wT, wL, wB, wR, aColumns, cTitle, cTopKey, ;
  1507.                 bScopeBlock, lEditFlag, aActionKeys, wColor, wSType, wFType, ;
  1508.                 wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, ;
  1509.                 bPreRun, bPostRun, nexitKey, aSeparators, ;
  1510.                 lOKAppend, lSound,,,,, "FirstBR" )
  1511.  
  1512.     if lastkey() == K_ESC
  1513.         exit
  1514.     endif
  1515.  
  1516. enddo
  1517.  
  1518. lAlite  := .f.
  1519. bPreRun := nil
  1520. cTitle  := "Now Try The Speed Searching"
  1521. aSrch   := { 1, iif( ! lMono, "n/*gr" , "w+/n" ) }
  1522.  
  1523. do while .t.
  1524.  
  1525.     twBRBrowse( wT, wL, wB, wR, aColumns, cTitle, cTopKey, ;
  1526.                 bScopeBlock, lEditFlag, aActionKeys, wColor, wSType, wFType, ;
  1527.                 wFColor, lScBar, lMsgs, lAlite, nFreeze, lStabilize, ;
  1528.                 bPreRun, bPostRun, nexitKey, aSeparators, ;
  1529.                 lOKAppend, lSound,,, aSrch,, "SecondBR" )
  1530.  
  1531.     if lastkey() == K_ESC
  1532.         exit
  1533.     endif
  1534. enddo
  1535. /*
  1536. ┌──────────────────────────────────────────────────────────────────────────
  1537. │ Remove hot spots. MUST release memory
  1538. └──────────────────────────────────────────────────────────────────────────
  1539. */
  1540. #ifndef NOMOUSE
  1541.     for nCount = 1 to len( aMouseID )
  1542.         twBRRemHotSpot( aMouseID[ nCount ] )
  1543.     next
  1544. #endif
  1545.  
  1546. twAMPop()
  1547.  
  1548. aTemp := {}
  1549. for nCount = 1 to 10
  1550.     aadd( aTemp, "Array Element " + str( nCount, 3 ) )
  1551. next
  1552.  
  1553. wT          := 3
  1554. wL          := 25
  1555. wB          := 21
  1556. wR          := 54
  1557. wColor   := iif( ! lMono, "bg+/rg,gr+/n,,w+/rg,bg+/b,r/w,w+/b,w+/g,n/w", ;
  1558.                           "w+/n,n/w,,w+/n,w/n,n/w,w+/n,w/n,n/w" )
  1559. wFColor     := iif( !lMono, { "gr+/g", "w/b" }, { "w+/n", "w/n"} )
  1560. aColumns := {}
  1561. aadd( aColumns, { "      Column Header", 1,, "      Column Footer", .f.,,,,, ;
  1562.                      { 5, 2 }, {|| iif( twRAGetCurrent() % 3 = 0,;
  1563.                                 { 4, 6 }, { 7, 8 } ) },;
  1564.                      , "═", "■" } )
  1565.  
  1566. twInfoLine( -2, "«Single Element» Array  «ESC»∙exit" )
  1567. #ifndef NOMOUSE
  1568. /*
  1569. ┌──────────────────────────────────────────────────────────────────────────
  1570. │ add hot spots
  1571. └──────────────────────────────────────────────────────────────────────────
  1572. */
  1573.     aMouseID := array( 1 )
  1574.     aMouseID[ 1 ] := twRAHotSpot( 24, 22, 24, 29, {|| __keyboard( chr( K_ESC )) } , ;
  1575.                                     1,, .t. )
  1576. #endif
  1577. nChoice := twRABrowse( wT, wL, wB, wR, aTemp, aColumns, ;
  1578.                        "Single Element Array" , ;
  1579.                        .t.,, wColor, ;
  1580.                        3, 1, wFColor, .t., .t., 1, .t.,;
  1581.                        ,, K_ALT_X,,, "Array Element New", .t. )
  1582. twAMPop()
  1583. /*
  1584. ┌──────────────────────────────────────────────────────────────────────────
  1585. │ Remove hot spots. MUST release memory
  1586. └──────────────────────────────────────────────────────────────────────────
  1587. */
  1588. #ifndef NOMOUSE
  1589.     for nCount = 1 to len( aMouseID )
  1590.         twRARemHotSpot( aMouseID[ nCount ] )
  1591.     next
  1592. #endif
  1593.  
  1594. wT          := 3
  1595. wL          := 5
  1596. wB          := 21
  1597. wR          := 74
  1598. aTemp := twDirectory( "*.*" )
  1599. asort( aTemp,,, {|x,y| x[ 1 ] < y[ 1 ] } )
  1600. aColumns := {}
  1601. aadd( aColumns, { "File Name", 1,, "Col1", .t., "@X", {|| 1=1 }, {|| 1=1 }} )
  1602. aadd( aColumns, { "Size",      2,, "Col2", .t., "@X", {|| 1=2 }, {|| 1=1 },, ;
  1603.                         { 4, 2 }, {|| iif( twRAGetElement( 2 ) > 2000, ;
  1604.                                       iif( twRAGetElement( 2 ) > 10000, { 4, 2 },;
  1605.                                                          { 7, 2 } ), { 5, 2 } ) },;
  1606.                         " > ", "═", "═" })
  1607. aadd( aColumns, { "Date",      3,, "Col3", .t., "@X", {|| 1=1 }, {|| 1=1 },,;
  1608.                         { 5, 2 }, {|| { 8, 2 }}, " < ", "═", "═" } )
  1609. aadd( aColumns, { "Time",      4,, "Col4", .t., "@X", {|| 1=2 }, {|| 1=1 }} )
  1610. aadd( aColumns, { "Attribute", 5,, "Col5", .t., "@X", {|| 1=1 }, {|| 1=1 },,;
  1611.                         { 7, 2 }} )
  1612.  
  1613. twInfoLine( -2, "«Nested» Array with special column display  «ESC»∙exit" )
  1614. #ifndef NOMOUSE
  1615. /*
  1616. ┌──────────────────────────────────────────────────────────────────────────
  1617. │ add hot spots
  1618. └──────────────────────────────────────────────────────────────────────────
  1619. */
  1620.     aMouseID := array( 1 )
  1621.     aMouseID[ 1 ] := twRAHotSpot( 24, 42, 24, 49, {|| __keyboard( chr( K_ESC )) } , ;
  1622.                                     1,, .t. )
  1623. #endif
  1624. nChoice := twRABrowse( wT, wL, wB, wR, aTemp, aColumns, ;
  1625.                        "Directory of Files in " + curdir() , ;
  1626.                        .t.,, ;
  1627.                        iif( ! lMono, "bg+/rg,gr+/n,,g+/rg,gr+/rg,gr+/r,br+/rg,n/w", ;
  1628.                                      "w+/n,n/w,,w/n,w+/n,n/w,w+/n,n/w" ), ;
  1629.                        3, 1, iif( ! lMono, "gr+/g", "w+/n" ), ;
  1630.                        .t., .t., 1, .t.,,, K_ALT_X )
  1631.  
  1632. UserMsg( "You Chose: " + STRINT( nChoice )  + iif( nChoice =  0, '', aTemp [ nChoice, 1 ]))
  1633. /*
  1634. ┌──────────────────────────────────────────────────────────────────────────
  1635. │ Remove hot spots. MUST release memory
  1636. └──────────────────────────────────────────────────────────────────────────
  1637. */
  1638. #ifndef NOMOUSE
  1639.     for nCount = 1 to len( aMouseID )
  1640.         twRARemHotSpot( aMouseID[ nCount ] )
  1641.     next
  1642. #endif
  1643. close PART
  1644. twAMPop()
  1645.  
  1646. twPop()
  1647. return nil
  1648. /*─────────────────────────────────────────────────────────────────────┐
  1649. │ Description: Disable Mouse Spots in twACChoice() Demo                │
  1650. │                                                                      │
  1651. │ function SpotDeactivate( xSpot )                                     │
  1652. │                                                                      │
  1653. │   Args: xSpot                                                        │
  1654. │                                                                      │
  1655. │ Return:                                                              │
  1656. │                                                                      │
  1657. └───Created: 02-06-93      at 04:55:43pm   ───────────────────────────*/
  1658. function SpotDeactivate( xSpot )
  1659. local nX
  1660. #ifndef NOMOUSE
  1661.     if valtype( xSpot ) = 'A'
  1662.         for nX = 1 to len( xSpot )
  1663.             twACSpotOff( xSpot[ nX ] )
  1664.         next
  1665.     else
  1666.         twACSpotOff( xSpot )
  1667.     endif
  1668. #endif
  1669. return nil
  1670. /*─────────────────────────────────────────────────────────────────────┐
  1671. │ Description: Reactivate Mouse Spots in twACChoice() Demo             │
  1672. │                                                                      │
  1673. │ function SpotActivate( xSpot )                                       │
  1674. │                                                                      │
  1675. │   Args: xSpot                                                        │
  1676. │                                                                      │
  1677. │ Return:                                                              │
  1678. │                                                                      │
  1679. └───Created: 02-06-93      at 04:56:02pm   ───────────────────────────*/
  1680. function SpotActivate( xSpot )
  1681. local nX
  1682. #ifndef NOMOUSE
  1683.     if valtype( xSpot ) = 'A'
  1684.         for nX = 1 to len( xSpot )
  1685.             twACSpotOn( xSpot[ nX ] )
  1686.         next
  1687.     else
  1688.         twACSpotOn( xSpot )
  1689.     endif
  1690. #endif
  1691. return nil
  1692. /*─────────────────────────────────────────────────────────────────────┐
  1693. │ Description: Help  for twACChoice() Demo                             │
  1694. │                                                                      │
  1695. │ function HelpACChoice()                                              │
  1696. │                                                                      │
  1697. └───Created: 02-06-93      at 04:56:20pm   ───────────────────────────*/
  1698. function HelpACChoice()
  1699. local aMsg := {}, bF1 := setkey( K_F1, nil )
  1700. aadd( aMsg, "twACChoice() has  different default key and mouse actions" )
  1701. aadd( aMsg, "depending on the setting of the 'tagging' parameter:" )
  1702. aadd( aMsg, "" )
  1703. aadd( aMsg, "       nTag = 0 ( No Tagging )" )
  1704. aadd( aMsg, "" )
  1705. aadd( aMsg, "Left Button - Select │ Right Button - exit w/o choice" )
  1706. aadd( aMsg, "      ENTER - Select │          ESC - exit w/o choice" )
  1707. aadd( aMsg, "" )
  1708. aadd( aMsg, "       nTag = 1 ( Start with untagged array )" )
  1709. aadd( aMsg, "       nTag = 2 ( Start with Pre-Tagged array )" )
  1710. aadd( aMsg, "" )
  1711. aadd( aMsg, "Left Button - Select │ Right Button - Tag current" )
  1712. aadd( aMsg, "      ENTER - Select │        SPACE - Tag Current" )
  1713. aadd( aMsg, "               ESC - exit w/o choice" )
  1714. aadd( aMsg, "" )
  1715. aadd( aMsg, "       F7 - Tag All" )
  1716. aadd( aMsg, "       F8 - Untag All" )
  1717. aadd( aMsg, "       F9 - Swap tagged with untagged" )
  1718. twInfo( aMsg, "twACChoice() Help",,,, 3, 10 )
  1719. setkey( K_F1, bF1 )
  1720. return nil
  1721. */
  1722. /*─────────────────────────────────────────────────────────────────────┐
  1723. │ Description: Read Help for twBRBrowse() Demo                         │
  1724. │                                                                      │
  1725. │ function BRHelp( cFile, cTitle, aMouseSpots )                        │
  1726. │                                                                      │
  1727. │   Args: cFile        -                                               │
  1728. │         cTitle       -                                               │
  1729. │         aMouseSpots  -                                               │
  1730. │                                                                      │
  1731. │ Return:                                                              │
  1732. │                                                                      │
  1733. └───Created: 02-06-93      at 04:56:41pm   ───────────────────────────*/
  1734. function BRHelp( cFile, cTitle, aMouseSpots )
  1735. local aHandles, cMemo, nX
  1736.  
  1737. #ifndef NOMOUSE
  1738.     for nX := 1 to len( aMouseSpots )
  1739.         twBRSpotOff( aMouseSpots[ nX ] )
  1740.     next
  1741. #endif
  1742.  
  1743. twInfoLine( -2, "«Up/Dn»∙«Page»∙Scroll Text «ESC»∙Done" )
  1744. twTextFile( 7, 08, 20, 71, cFile, "n/w", ;
  1745.         3, 10, "b+/w", cTitle )
  1746. twAMPop()
  1747.  
  1748. #ifndef NOMOUSE
  1749.     for nX := 1 to len( aMouseSpots )
  1750.         twBRSpotOn( aMouseSpots[ nX ] )
  1751.     next
  1752. #endif
  1753. return nil
  1754. /*─────────────────────────────────────────────────────────────────────┐
  1755. │ Description: Footers display for twBRBrowse() Demo VALID clause      │
  1756. │                                                                      │
  1757. │ function ShowParts( oGet, nParts, nSell, nCost )                     │
  1758. │                                                                      │
  1759. │    Arguments: oGet   - Active get                                    │
  1760. │               nParts - Parts on hand                                 │
  1761. │               nSell  - Selling price                                 │
  1762. │               nCost  - Cost price                                    │
  1763. │                                                                      │
  1764. │ return Value: TRUE for the VALID                                     │
  1765. │                                                                      │
  1766. └───Created: 02-06-93      at 04:57:03pm   ───────────────────────────*/
  1767. function ShowParts( oGet, nParts, nSell, nCost )
  1768. local oB := twBRGetBrowse(), oCol
  1769. local nOldValue := Part->POnHand, nDiff, nNewValue := eval( oGet:block )
  1770. local nNewDollars
  1771. nDiff := nOldValue - nNewValue
  1772. oCol := oB:getcolumn( 3 )
  1773. nParts -= nDiff
  1774. oCol:Footing := transform( nParts, "999999" ) + ";     $"
  1775. nOldValue := Part->POnHand * Part->PSell
  1776. nNewDollars := nNewValue * Part->PSell
  1777. nDiff := nOldValue - nNewDollars
  1778. nSell -= nDiff
  1779. oCol := oB:getcolumn( 4 )
  1780. oCol:Footing := "  ;" + transform( nSell, "9999999.99" )
  1781. nOldValue := Part->POnHand * Part->PCost
  1782. nNewDollars := nNewValue * Part->PCost
  1783. nDiff := nOldValue - nNewDollars
  1784. nCost  -= nDiff
  1785. oCol := oB:getcolumn( 5 )
  1786. oCol:Footing := "  ;" + transform( nCost, "9999999.99" )
  1787. oB:Configure()
  1788. return .t.
  1789. /*─────────────────────────────────────────────────────────────────────┐
  1790. │ Description: VALID clause for selling price in twBRBrowse() Demo     │
  1791. │                                                                      │
  1792. │ function ShowSell( oGet, nSell )                                     │
  1793. │                                                                      │
  1794. │    Arguments: oGet  - Active get                                     │
  1795. │               nSell - Selling price                                  │
  1796. │                                                                      │
  1797. │ return Value: TRUE for the VALID                                     │
  1798. │                                                                      │
  1799. └───Created: 02-06-93      at 04:57:41pm   ───────────────────────────*/
  1800. function ShowSell( oGet, nSell )
  1801. local oB := twBRGetBrowse(), oCol
  1802. local nOldValue := Part->PSell * Part->POnHand
  1803. local nDiff := nOldValue  -  ( Part->POnHand * eval( oGet:block ))
  1804. oCol := oB:getcolumn( 4 )
  1805. nSell -= nDiff
  1806. oCol:Footing := "  ;" + transform( nSell, "9999999.99" )
  1807. oB:Configure()
  1808. return .t.
  1809. /*─────────────────────────────────────────────────────────────────────┐
  1810. │ Description: VALID clause for cost price in twBRBrowse() Demo        │
  1811. │                                                                      │
  1812. │ function ShowCost( oGet, nCost )                                     │
  1813. │                                                                      │
  1814. │    Arguments: oGet  - Active get                                     │
  1815. │               nCost - Cost price                                     │
  1816. │                                                                      │
  1817. │ return Value: TRUE for the VALID                                     │
  1818. │                                                                      │
  1819. └───Created: 02-06-93      at 04:58:18pm   ───────────────────────────*/
  1820. function ShowCost( oGet, nCost )
  1821. local oB := twBRGetBrowse(), oCol
  1822. local nOldValue := Part->PCost * Part->POnHand
  1823. local nDiff := nOldValue  -  ( Part->POnHand * eval( oGet:block ))
  1824. oCol := oB:getcolumn( 5 )
  1825. nCost -= nDiff
  1826. oCol:Footing := "  ;" + transform( nCost, "9999999.99" )
  1827. oB:Configure()
  1828. return .t.
  1829. /*─────────────────────────────────────────────────────────────────────┐
  1830. │ Description: Mouse Support Display                                   │
  1831. │                                                                      │
  1832. │ function TSD60000()                                                  │
  1833. │                                                                      │
  1834. └───Created: 02-06-93      at 04:58:59pm   ───────────────────────────*/
  1835. function TSD60000()
  1836. local nCount := 0, nTime :=  seconds(), lShowPresses := .f.
  1837. local nMRow, nMCol, nButton := 0
  1838. UserMsg( { "In TSDWIN, Mouse support is almost automatic. A call to twMouseInit()",;
  1839.            "at the beginning of a program is all it takes.",;
  1840.            "All the message and browse systems have default mouse  support  which",;
  1841.            "you can augment by creating Mouse Hot Spots with the right associated",;
  1842.            "tw??HotSpot() or tw??MouseLine() functions. See TSDWIN.NG for more.",;
  1843.            "When you use Mouse Hot Spots, be sure to release the memory they  use",;
  1844.            "with the correct tw??RemHotSpot() or tw??LinePop() function.",;
  1845.            "In TSDWIN, the left button usually defaults to a 'Selection' key. For",;
  1846.            "instance, in a browse, pressing the left button on the current choice",;
  1847.            "will select it. The same holds for Alert Boxes.",;
  1848.            "Sometimes the left button is used for tagging, if multiple selections",;
  1849.            "are allowed. In browses in Edit mode, double clicking the left button",;
  1850.            "initiates an edit.",;
  1851.            "The right hand button usually defaults to the ESC key, except in case",;
  1852.            "of multiple choice selections again, where it is a selction key.",;
  1853.            "Scroll Bar arrows cause a line up or down with the left button and  a",;
  1854.            "page up or down with the right button. Both buttons take you  to  the",;
  1855.            "top or bottom of the browse. Clicking in the scroll  bars  themselves",;
  1856.            "moves the pointer proportionately." ;
  1857.             } )
  1858. #ifndef NOMOUSE
  1859.     if AskUser( { "Continue with Demo", "exit to Main Menu" }, ;
  1860.                 "The following demonstrates routines showing you " +;
  1861.                 "how the low-level mouse functions work.." ) != 1
  1862.         return nil
  1863.     endif
  1864.  
  1865.     twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  1866.     twTitle( padc( "TSDWIN Low-Level Mouse Support", 30 ), TCOLOR, "T", "C" )
  1867.     @ twRow( 03 ), twCol( 2 ) say "               function                             0     1     2"
  1868.     @ twRow( 04 ), twCol( 2 ) say "------------------------------------------------------------------"
  1869.     @ twRow( 05 ), twCol( 2 ) say "                        Which Button Pressed  :"
  1870.     @ twRow( 06 ), twCol( 2 ) say "                       X coordinate of Mouse  :"
  1871.     @ twRow( 07 ), twCol( 2 ) say "                       Y coordinate of Mouse  :"
  1872.     @ twRow( 08 ), twCol( 2 ) say "  Status of Button 0 Pressed ( 0, 1, 2,  3 )  :"
  1873.     @ twRow( 09 ), twCol( 2 ) say "                    No. of Presses of Button  :"
  1874.     @ twRow( 10 ), twCol( 2 ) say "     get X coordinate of Last Button Pressed  :"
  1875.     @ twRow( 11 ), twCol( 2 ) say "     get Y coordinate of Last Button Pressed  :"
  1876.     @ twRow( 12 ), twCol( 2 ) say "    Status of Button released ( 0, 1, 2, 3 )  :"
  1877.     @ twRow( 13 ), twCol( 2 ) say "                   No. of releases of Button  :"
  1878.     @ twRow( 14 ), twCol( 2 ) say "        X coordinate of Last Button released  :"
  1879.     @ twRow( 15 ), twCol( 2 ) say "        Y coordinate of Last Button released  :"
  1880.     @ twRow( 16 ), twCol( 2 ) say "               Horizontal Direction of Mouse  :"
  1881.     @ twRow( 17 ), twCol( 2 ) say "                 Vertical Direction of Mouse  :"
  1882.     @ twRow( 19 ), twCol( 2 ) say " Counter for Presses/releases Display  ( 0-400 ):"
  1883.     @ twRow( 20 ), twCol( 2 ) say "                       Seconds to Full Display:"
  1884.  
  1885.     _twM1()
  1886.  
  1887.     @ twRow( 21 ), twCol( 30 ) say "Press ESC or Click Here to QUIT" COLOR twEnhClr( setcolor() )
  1888.     do while inkey() != 27
  1889.         nCount++
  1890.         if seconds() - nTime >= 60
  1891.             lShowpresses := .t.
  1892.         else
  1893.             @ twRow( 20 ), twCol( 50 ) say str( 60 - ( seconds() - nTime ), 7, 2 )
  1894.         endif
  1895.         @ twRow( 05 ), twCol( 50 ) say str( _twM3B(), 5 ) //  get Which Button Pressed
  1896.         @ twRow( 06 ), twCol( 50 ) say str( _twM3C()   , 5 ) //  get X coordinate of Mouse
  1897.         @ twRow( 07 ), twCol( 50 ) say str( _twM3D()   , 5 ) //  get Y coordinate of Mouse
  1898.         @ twRow( 08 ), twCol( 50 ) say str( _twM5A( 0 ), 5 ) + " " + str( _twM5A( 1 ), 5 ) + " " + str( _twM5A( 2 ), 5 )  // <int M2>  Status of Button Pressed ( 0 = up, 1 = down )
  1899.         if lShowPresses
  1900.             @ twRow( 10 ), twCol( 50 ) say str( _twM5C( 0 ), 5 ) + " " + str( _twM5C( 1 ), 5 ) + " " + str( _twM5C( 2 ), 5 )  // <int M2>  get X coordinate of Last Button Pressed
  1901.             @ twRow( 11 ), twCol( 50 ) say str( _twM5D( 0 ), 5 ) + " " + str( _twM5D( 1 ), 5 ) + " " + str( _twM5D( 2 ), 5 )  // <int M2>  get Y coordinate of Last Button Pressed
  1902.             @ twRow( 14 ), twCol( 50 ) say str( _twM6C( 0 )  , 5 ) + " " + str( _twM6C( 1 )  , 5 ) + " " + str( _twM6C( 2 )  , 5 )  // <int M2>  get X coordinate of Last Button released
  1903.             @ twRow( 15 ), twCol( 50 ) say str( _twM6D( 0 )  , 5 ) + " " + str( _twM6D( 1 )  , 5 ) + " " + str( _twM6D( 2 )  , 5 )  // <int M2>  get Y coordinate of Last Button released
  1904.             lShowPresses := .f.
  1905.         endif
  1906.         @ twRow( 12 ), twCol( 50 ) say str( _twM6A( 0 ), 5 ) + " " + str( _twM6A( 1 ), 5 ) + " " + str( _twM6A( 2 ), 5 )  // <int M2>  Status of Button released ( 0 = up, 1 = down )
  1907.         @ twRow( 16 ), twCol( 50 ) say str( _twM11C()   , 5 )  // get Horizontal Direction of Mouse
  1908.         @ twRow( 17 ), twCol( 50 ) say str( _twM11D()   , 5 )  // get Vertical Direction of Mouse
  1909.         if nCount = 400
  1910.             @ twRow( 09 ), twCol( 50 ) say str( _twM5B( 0 ), 5 ) + " " + str( _twM5B( 1 ), 5 ) + " " + str( _twM5B( 2 ), 5 )  // <int M2>  No. of Presses of Button
  1911.             @ twRow( 13 ), twCol( 50 ) say str( _twM6B( 0 )  , 5 ) + " " + str( _twM6B( 1 )  , 5 ) + " " + str( _twM6B( 2 )  , 5 )  // <int M2>  No. of releases of Button
  1912.             nCount := 0
  1913.             lShowPresses := iif( lShowPresses, .f., .t. )
  1914.         endif
  1915.         @ twRow( 19 ), twCol( 50 ) say str( nCount, 7 )
  1916.         nButton := twMGetPress( @nMRow, @nMCol )
  1917.         nMRow := int( nMRow / 8 );nMCol := int( nMCol / 8 )
  1918.  
  1919.         if nMRow = 22 .and. ( nMCol >= 30 .and. nMCol <= 47 ) .and. ( nButton == 1 )
  1920.             exit
  1921.         endif
  1922.     enddo
  1923.  
  1924.     _twM2()
  1925.     twPop()
  1926. #endif
  1927. return nil
  1928. /*─────────────────────────────────────────────────────────────────────┐
  1929. │ Description: Miscellaneous functions                                 │
  1930. │                                                                      │
  1931. │ function TSD70000()                                                  │
  1932. │                                                                      │
  1933. └───Created: 02-06-93      at 04:59:25pm   ───────────────────────────*/
  1934. function TSD70000()
  1935. local nKey, nGetTry := 0, GetList := {}, dGetTry := date()
  1936. local aNtxArray := {}, lMsgs := .f., nStartTime
  1937. local cFileSpec := "*.PRG,*.DOC        "
  1938. local cDest := "A:", cPath := ".\                  "
  1939. local wT := 3, wL := 10, wB := 15, wR := 70, cTitle := "Title String"
  1940. local cFooters := "Footer String"
  1941. local cMemo := "Printer Not Ready! You can try it if you want but it will not work."+;
  1942.         " Oh Well... I knew you had to go ahead and see for yourself. That really"+;
  1943.         " is a pity. Lack of trust will defeat us all, then that will be it! "+;
  1944.         "I wonder where it will all end. Probably at my own crucification!"+;
  1945.         " Whatever became of good old deceit and corporate skullduggery?"+;
  1946.         " I guess Santa ain't coming to town yet, eh?"
  1947. local tString
  1948. local mUdf, ActionKeys
  1949. local wColor, wSType, wFType, wFColor, lWrap, lEditMode, nLineLength
  1950. local nTabSize, nTBufRow, nTBufColumn
  1951. local nWinRow, nWinColumn, lScBar, lWindow
  1952.  
  1953. memvar mDest
  1954.  
  1955. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  1956. twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
  1957. twTitle( padc( 'TSD twCalculator()',  30 ), TCOLOR, 'T', 'C' )
  1958. twTitle( padc( 'Shift-F1 to Call Calculator', 30 ), TCOLOR, 'B', 'C' )
  1959. twCalcInit( 2, 3, MAINCLC, 3, 10,, .t. )
  1960. set key K_SH_F1 to twCallCalc()
  1961.  
  1962. do while .t.
  1963.     @ twRow( 4 ), twCol( 10 ) say "Get a Value:" get nGetTry picture "##########.####"
  1964.     twReadModal( GetList, .t. ); GetList := {}
  1965.  
  1966.     if lastkey() == K_ESC
  1967.         exit
  1968.     endif
  1969.  
  1970. enddo
  1971. twPop()
  1972.  
  1973. set key K_SH_F1 to
  1974. twOpen( 3, 10, 21, 70, COLORM, DSHADOW, DFRAME,, COLORFM )
  1975. twTitle( padc( 'TSD twCalendar()', 30 ), TCOLOR, 'T', 'C' )
  1976.  
  1977. twDateInit( 2, 3, MAINCYN, 7, 10,, .f. )
  1978.  
  1979. do while .t.
  1980.     @ twRow( 6 ), twCol( 10 ) say "Get a Date:" get dGetTry picture "@D" when twCalendar( @dGetTry )
  1981.     twReadModal( GetList, .t. ); GetList := {}
  1982.  
  1983.     if lastkey() == K_ESC
  1984.         exit
  1985.     endif
  1986.  
  1987. enddo
  1988. twPop()
  1989. twCenter( 02, "The TSDWIN Indexer makes use of the new GaugeBar Class." )
  1990. twCenter( 03, "It gives your users what they want to see... what's" )
  1991. twCenter( 04, "going on... and frees you from the drudgery of creating" )
  1992. twCenter( 05, "needed but complex routines." )
  1993. DemoWait( 1 )
  1994. twCenter( 07, "twIndexMaker function Description" )
  1995. DemoWait( 1 )
  1996. twSay( 09, 16, "Watch how these two lines of code operate:" )
  1997. twSay( 11, 6, "aadd( aNtxArray, { 'Windemo', 'Windemo', 'C', 'upper( CodeKey )' }) " )
  1998. twSay( 13, 6, "twIndexMaker( aNtxArray,,,,, COLORM, DSHADOW, D2FRAME, ; " )
  1999. twSay( 14, 16, "'Handy Index Maker',, .f. ) " )
  2000. DemoWait( 1 )
  2001. twCenter( 22, " Press a Key or Button or Wait!! " )
  2002. DemoWait( 5 )
  2003.  
  2004. aadd( aNtxArray, { "Windemo", "Windemo",   "C", "upper( CodeKey )" } )
  2005.  
  2006. twIndexMaker( aNtxArray,,,,, COLORM, DSHADOW, D2FRAME, ;
  2007.                "Handy Index Maker",, .f. )
  2008.  
  2009. twCenter( 16, "How was That??" )
  2010. DemoWait( 1 )
  2011. twClear( .f. )
  2012.  
  2013. twTitle( padc( "twBackUp() Demonstration",  30  ), TCOLOR, "T", "C" )
  2014. do while .t.
  2015.     @ twRow( 2 ), twCol( 10 ) say "       Path:" get cPath picture "@!@S25"
  2016.     @ twRow( 4 ), twCol( 10 ) say "   FileSpec:" get cFileSpec picture "@!"
  2017.     @ twRow( 6 ), twCol( 10 ) say "Destination:" get cDest picture "@!"
  2018.     @ twRow( 8 ), twCol( 10 ) say "Messages:" get lMsgs picture "Y"
  2019.     twReadModal( GetList ); GetList := {}
  2020.     if lastkey() == K_ESC
  2021.         exit
  2022.     endif
  2023.     nStartTime := seconds()
  2024.     twBackUp( cPath, cFileSpec, cDest, lMsgs, COLORM, DSHADOW, D2FRAME, COLORFM )
  2025.     UserMsg( "Backup took: " + ;
  2026.             alltrim( str( ( seconds() - nStartTime ) / 60 )) + " Minutes" )
  2027.  
  2028.     memvar->mDest := cDest +  "*.*"
  2029.     erase &mDest
  2030. enddo
  2031. release mDest
  2032.  
  2033. twTitle( padc( "Memo Handling Demonstration",  30  ), TCOLOR, "T", "C" )
  2034. twClear( .f. )
  2035. lMsgs      := .t.
  2036. lEditMode  := .t.
  2037. nWinColumn := nil
  2038. lScBar     := .t.
  2039. lWindow    := .t.
  2040. nLineLength := 100
  2041. cTitle      := "Testing twMemoEdit()"
  2042.  
  2043. cMemo := cMemo + cMemo + cMemo + cMemo + cMemo
  2044.  
  2045. cMemo := twMemoEdit( wT, wL, wB, wR, cMemo, cTitle, cFooters, mUdf, ActionKeys, ;
  2046.                      COLORM, DSHADOW, DFRAME, COLORFM, .t., lEditMode, .t., ;
  2047.                      nLineLength, nTabSize, nTBufRow, nTBufColumn, ;
  2048.                      nWinRow, nWinColumn, lScBar, lWindow )
  2049.  
  2050. twMemoView( wT, wL, wB, wR, cMemo, "Testing twMemoView()", cFooters, ;
  2051.             COLORM, DSHADOW, DFRAME, COLORFM )
  2052.  
  2053. twPop()
  2054. return nil
  2055. /*─────────────────────────────────────────────────────────────────────┐
  2056. │ Description: TSDWIN Hardware functions                               │
  2057. │                                                                      │
  2058. │ function TSD80000()                                                  │
  2059. │                                                                      │
  2060. └───Created: 02-06-93      at 04:59:46pm   ───────────────────────────*/
  2061. function TSD80000()
  2062. local nKey := 0, aKeyTry := {}, nX := 0, nRow := 3
  2063. local cDrStat := "0", nDrive := 0, GetList := {}, RetVal
  2064.  
  2065. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  2066. twTitle( "twIsDrive()Demonstration", TCOLOR )
  2067. twTitle( "Get out a Diskette or Two!!!!!!!!!!!!!",, "B", "C" )
  2068. BEEPER
  2069. do while .t.
  2070.     twSay( 2, 5, "Enter Drive to Check ( 0 for Drive A:, 1 for Drive B: )!" )
  2071.     @ twRow( 4 ), twCol( 12 ) get nDrive picture "#"
  2072.     twReadModal( GetList ); GetList := {}
  2073.     if lastkey() == K_ESC
  2074.         exit
  2075.     endif
  2076.  
  2077.     twIsDrive( nDrive, 3, 4 )
  2078.  
  2079. enddo
  2080. twPop()
  2081.  
  2082. twOpen( FULLSCREEN, COLORN, DSHADOW, DFRAME,, COLORFN )
  2083. twTitle( "Testing tw_GetKSt() - Try the Keys!!!", TCOLOR )
  2084. aadd( aKeyTry, RSHIFT        )
  2085. aadd( aKeyTry, LSHIFT        )
  2086. aadd( aKeyTry, CTRL          )
  2087. aadd( aKeyTry, ALT           )
  2088. aadd( aKeyTry, SCROLLSTAT    )
  2089. aadd( aKeyTry, NUMLOCKSTAT   )
  2090. aadd( aKeyTry, CAPLOCKSTAT   )
  2091. aadd( aKeyTry, INSERTSTAT    )
  2092. aadd( aKeyTry, CTRLNUMLKSTAT )
  2093. aadd( aKeyTry, SCROLLOCK     )
  2094. aadd( aKeyTry, NUMLOCK       )
  2095. aadd( aKeyTry, CAPLOCK       )
  2096. aadd( aKeyTry, INSERT        )
  2097. twSay( nRow++, 15, "        Right Shift:")
  2098. twSay( nRow++, 15, "         Left Shift:")
  2099. twSay( nRow++, 15, "            Control:")
  2100. twSay( nRow++, 15, "          Alternate:")
  2101. twSay( nRow++, 15, " Scroll Lock Status:")
  2102. twSay( nRow++, 15, "Number Lock Status :")
  2103. twSay( nRow++, 15, "   Caps Lock Status:")
  2104. twSay( nRow++, 15, "      Insert Status:")
  2105. twSay( nRow++, 15, "Ctrl NumLock Status:")
  2106. twSay( nRow++, 15, "    Scroll Lock Key:")
  2107. twSay( nRow++, 15, "    Number Lock Key:")
  2108. twSay( nRow++, 15, "      Caps Lock Key:")
  2109. twSay( nRow++, 15, "         Insert Key:")
  2110.  
  2111. do while ( nkey := inkey()) != 27
  2112.     twTitle( "Counter" + STRINT( ++nX ), TCOLOR, "B", "C" )
  2113.     nRow := 3
  2114.     twSay( nRow++, 35, str( tw_GetKSt( RSHIFT        )), ;
  2115.         iif( tw_GetKSt( RSHIFT )= 0,;
  2116.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2117.     twSay( nRow++, 35, str( tw_GetKSt( LSHIFT        )), ;
  2118.         iif( tw_GetKSt( LSHIFT )= 0,;
  2119.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2120.     twSay( nRow++, 35, str( tw_GetKSt( CTRL          )), ;
  2121.         iif( tw_GetKSt( CTRL )= 0,;
  2122.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2123.     twSay( nRow++, 35, str( tw_GetKSt( ALT           )), ;
  2124.         iif( tw_GetKSt( ALT )= 0,;
  2125.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2126.     twSay( nRow++, 35, str( tw_GetKSt( SCROLLSTAT    )), ;
  2127.         iif( tw_GetKSt( SCROLLSTAT )= 0,;
  2128.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2129.     twSay( nRow++, 35, str( tw_GetKSt( NUMLOCKSTAT   )), ;
  2130.         iif( tw_GetKSt( NUMLOCKSTAT )= 0,;
  2131.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2132.     twSay( nRow++, 35, str( tw_GetKSt( CAPLOCKSTAT   )), ;
  2133.         iif( tw_GetKSt( CAPLOCKSTAT )= 0,;
  2134.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2135.     twSay( nRow++, 35, str( tw_GetKSt( INSERTSTAT    )), ;
  2136.         iif( tw_GetKSt( INSERTSTAT )= 0,;
  2137.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2138.     twSay( nRow++, 35, str( tw_GetKSt( CTRLNUMLKSTAT )), ;
  2139.         iif( tw_GetKSt( CTRLNUMLKSTAT )= 0,;
  2140.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2141.     twSay( nRow++, 35, str( tw_GetKSt( SCROLLOCK     )), ;
  2142.         iif( tw_GetKSt( SCROLLOCK )= 0,;
  2143.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2144.     twSay( nRow++, 35, str( tw_GetKSt( NUMLOCK       )), ;
  2145.         iif( tw_GetKSt( NUMLOCK )= 0,;
  2146.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2147.     twSay( nRow++, 35, str( tw_GetKSt( CAPLOCK       )), ;
  2148.         iif( tw_GetKSt( CAPLOCK )= 0,;
  2149.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2150.     twSay( nRow++, 35, str( tw_GetKSt( INSERT        )), ;
  2151.         iif( tw_GetKSt( INSERT )= 0,;
  2152.         twStdClr( setcolor()),twEnhClr( setcolor())))
  2153. enddo
  2154. DemoWait( 3 )
  2155. twPop()
  2156.  
  2157. return nil
  2158. /*─────────────────────────────────────────────────────────────────────┐
  2159. │ Description: Place an Order                                          │
  2160. │                                                                      │
  2161. │ function TSD90000()                                                  │
  2162. │                                                                      │
  2163. └───Created: 02-06-93      at 05:00:08pm   ───────────────────────────*/
  2164. function TSD90000()
  2165. local nWin1
  2166. nWin1 := twOpen( FULLSCREEN, COLORW, DSHADOW, DFRAME,, COLORFW )
  2167. twOpen( 16, 64, 22, 78, WHH_CYN )
  2168. twSay( 00, 0, " ▄▄▄▄▄▄▄▄▄▄▄▄▄ ", RDH_CYN )
  2169. twSay( 01, 0, " ▀     █     ▀ ", RDH_CYN )
  2170. twSay( 02, 0, "       █       ", RDH_CYN )
  2171. twSay( 03, 0, "       █       ", RDH_CYN )
  2172. twSay( 04, 0, "       █       ", RDH_CYN )
  2173. twSay( 05, 0, "       █       ", RDH_CYN )
  2174. twSay( 06, 0, "       █       ", RDH_CYN )
  2175. twSay( 07, 0, "      ▄█▄      ", RDH_CYN )
  2176. twSlide( "U", 13 )
  2177. twSlide( "L", 61 )
  2178. twOpen( 15, 63, 22, 77, WHH_CYN )
  2179. twSay( 00, 0, "▄▄▄▄▄▄▄▄▄▄▄▄▄▄", YEL_CYN )
  2180. twSay( 01, 0, "█            █", YEL_CYN )
  2181. twSay( 02, 0, "█            █", YEL_CYN )
  2182. twSay( 03, 0, "█             ", YEL_CYN )
  2183. twSay( 04, 0, "▀▀▀▀▀▀▀▀▀▀▀▀▀█", YEL_CYN )
  2184. twSay( 05, 0, "             █", YEL_CYN )
  2185. twSay( 06, 0, "█            █", YEL_CYN )
  2186. twSay( 07, 0, "█            █", YEL_CYN )
  2187. twSay( 08, 0, "█▄▄▄▄▄▄▄▄▄▄▄▄█", YEL_CYN )
  2188. twSlide( "U", 7 )
  2189. twSlide( "L", 60 )
  2190. setcolor( YEL_CYN )
  2191. @ 5 + 3, 3 say "▄▄▄▄▄▄▄█▄▄▄▄▄▄"
  2192. @ 6 + 3, 3 say "█     ▄█▄    █"
  2193. setcolor( RDH_CYN )
  2194. @ 5 + 3, 10 say "█"
  2195. @ 6 + 3, 09 say "▄█▄"
  2196. twOpen( 16, 64, 22, 77, WHH_CYN )
  2197. twSay( 00, 0, "  ▄▄▄▄▄▄▄▄▄▄  ", WHH_CYN )
  2198. twSay( 01, 0, "  ██       █  ", WHH_CYN )
  2199. twSay( 02, 0, "  ██       █  ", WHH_CYN )
  2200. twSay( 03, 0, "  ██       █  ", WHH_CYN )
  2201. twSay( 04, 0, "  ██       █  ", WHH_CYN )
  2202. twSay( 05, 0, "  ██       █  ", WHH_CYN )
  2203. twSay( 06, 0, "  ██▄▄▄▄▄▄▄█  ", WHH_CYN )
  2204. twSlide( "U", 02 )
  2205. twSlide( "L", 61 )
  2206. setcolor( YEL_CYN )
  2207. @ 11 + 3, 3 say "█ ▄▄▄▄▄▄▄▄▄▄ █"
  2208. @ 12 + 3, 3 say "█▄██▄▄▄▄▄▄▄█▄█"
  2209. setcolor( WHH_CYN )
  2210. @ 11 + 3, 5 say "▄▄▄▄▄▄▄▄▄▄"
  2211. @ 12 + 3, 5 say "██"
  2212. @ 12 + 3, 14 say "█"
  2213. _twHandle( nWin1 )
  2214. twSay( 15 + 2, 20, "█   █ ▀█▀ █▄▄▄" )
  2215. twSay( 16 + 2, 20, "█ █ █  █  █  █" )
  2216. twSay( 17 + 2, 20, "█▄█▄█ ▄█▄ █  █         CLIPPER 5.01 Windowing Library" )
  2217. DemoWait( .5 )
  2218. twCenter( 21, "VISA - MasterCard - American Express - Discover", GNH_CYN )
  2219.  
  2220. twHLine( 01, 21, 56, 1, BLH_CYN )
  2221.  
  2222. twSay( 02, 21, "TSDWIN.LIB v2.10 is a ShareWare Product. You are free to", RED_CYN )
  2223. twSay( 03, 21, "use it in order  to judge its  usefulness to you in your", RED_CYN )
  2224. twSay( 04, 21, "   situation. if you like and continue to  use TSDWIN,  ", RED_CYN )
  2225. twSay( 05, 21, "                 please register:                       ", RED_CYN )
  2226. twSay( 09, 29, "  Register Your Version 2.10 $ 145.00 US" )
  2227. twSay( 11, 29, "All include your Disk Format with Manual" )
  2228. twSay( 12, 29, "and NG on disk. Support BBS membership." )
  2229. twSay( 14, 29, "See ORDERFRM.DOC for Details." )
  2230. twSay( 17, 36, "TSDWIN's customers are the most important", BLA_CYN )
  2231. twSay( 18, 36, "      factor in its evolving design!", BLA_CYN )
  2232. DemoWait( 30 )
  2233. _twHandle( nWin1 )
  2234. twTitle( "Any Key or Button", TCOLOR, "B", "C" )
  2235. DemoWait( 30 )
  2236. twSay( 17, 36, "                                         ", BLA_CYN )
  2237. twSay( 18, 36, "  Here's where you can place your order!", RED_CYN )
  2238. DemoWait( 3 )
  2239. twScroll( 15, .f., 1, 21, 16, 77 )
  2240. DemoWait( 1 )
  2241. twSay( 02, 21, "          CANADA              U.S.A. -  Central/West   " , RED_CYN )
  2242. twSay( 03, 21, "       TSD Limited             FOX Business Systems    " , WHH_CYN )
  2243. twSay( 04, 21, "     18 Bond St. South             217 McCall Rd.      " , BLA_CYN )
  2244. twSay( 05, 21, "    Dundas, ON,  Canada        Manhattan, KS,  66502   " , BLA_CYN )
  2245. twSay( 06, 21, "          L9H 3H1               Voice: 913-776-1452    " , BLA_CYN )
  2246. twSay( 07, 21, "    Voice: 416-628-5086           BBS: 913-776-0111    " , BLA_CYN )
  2247. twSay( 08, 21, "      BBS: 519-650-0389                                " , BLA_CYN )
  2248.  
  2249. twSay( 10, 21, "                       U.S.A -  East                   " , RED_CYN )
  2250. twSay( 11, 21, "                     Ahlstedt Software                 " , WHH_CYN )
  2251. twSay( 12, 21, "                  2212 Wade Hampton Blvd.              " , BLA_CYN )
  2252. twSay( 13, 21, "                Greenville, SC, 29615-2249             " , BLA_CYN )
  2253. twSay( 14, 21, "                    Voice: 803-292-2249                " , BLA_CYN )
  2254. twSay( 15, 21, "                                                       " , BLA_CYN )
  2255.  
  2256. twTitle( "Press a Key or Button to exit or Wait", TCOLOR, "B", "C" )
  2257. DemoWait( 30 )
  2258. _twHandle( len( _twStack()))
  2259. twPop();twPop();twPop();twPop()
  2260. return nil
  2261. /*─────────────────────────────────────────────────────────────────────┐
  2262. │ Description:  Black Box for twButtonBox()                            │
  2263. │                                                                      │
  2264. │ function AskUser( aChoices, cQuestion, cTitle )                      │
  2265. │                                                                      │
  2266. │    Arguments: aChoices  - array of prompts                           │
  2267. │               cQuestion - prompt string                              │
  2268. │               cTitle    - optional title for window                  │
  2269. │                                                                      │
  2270. │                                                                      │
  2271. │ return Value: Choice number or zero on K_ESC.                        │
  2272. │                                                                      │
  2273. └───Created: 02-06-93      at 05:00:27pm   ───────────────────────────*/
  2274. function AskUser( aChoices, cQuestion, cTitle )
  2275. local nRetVal, nRowAdd
  2276. local nWinWidth := 0, nLeft, nRight, x := 0
  2277. DEFAULT aChoices to { "Yes", "No" },;
  2278.         cQuestion to "Proceed?",;
  2279.         cTitle to nil
  2280.  
  2281. aeval( aChoices, {|x| nWinWidth += ( len( x ) + 4 ) } )
  2282.  
  2283. nWinWidth += 3
  2284. nLeft   := int( ( maxcol() / 2 ) - ( nWinWidth / 2 ))
  2285. nRight  := int( ( maxcol() / 2 ) + ( nWinWidth / 2 ))
  2286. nRowAdd := int( len( cQuestion ) / ( nRight - nLeft ))
  2287.  
  2288. return ( twButtonBox( "H", cQuestion, cTitle,, aChoices,, 6, nLeft, ;
  2289.                 12 + nRowAdd, nRight, DSHADOW, DFRAME ))
  2290. /*─────────────────────────────────────────────────────────────────────┐
  2291. │ Description: Informative Message Black Box                           │
  2292. │                                                                      │
  2293. │ function UserMsg( xMessage, nWait, nT, nB )                          │
  2294. │                                                                      │
  2295. │    Arguments: nT, nB   - Coordinates to start the box                │
  2296. │               xMessage - Display string or array                     │
  2297. │               nWait    - Wait Time                                   │
  2298. │                                                                      │
  2299. │ return Value:                                                        │
  2300. │                                                                      │
  2301. └───Created: 02-06-93      at 05:01:03pm   ───────────────────────────*/
  2302. function UserMsg( xMessage, nWait, nT, nB )
  2303. return twInfo( xMessage,, nWait, nT, nB, DSHADOW, DFRAME )
  2304. /*─────────────────────────────────────────────────────────────────────┐
  2305. │ Description: Store the menu descriptions.                            │
  2306. │                                                                      │
  2307. │ function StoreDesc( nX )                                             │
  2308. │                                                                      │
  2309. │    Arguments: nX - Message to return                                 │
  2310. │                                                                      │
  2311. │ return Value: Message array                                          │
  2312. │                                                                      │
  2313. └───Created: 02-06-93      at 05:01:37pm   ───────────────────────────*/
  2314. function StoreDesc( nX )
  2315. local aMessages := {}
  2316.  
  2317. aadd( aMessages, {"One of the most powerful features of «TSDWIN»", ;
  2318.                   "is its ability to operate on any  window in", ;
  2319.                   "the stack.  You  can «write to either active»", ;
  2320.                   "«or inactive windows».","", ;
  2321.                   "All the other features let you  design YOUR", ;
  2322.                   "interface the way YOU want it.  «TSDWIN» does", ;
  2323.                   "not interfere with  «your personal style»  of", ;
  2324.                   "interface design.","", ;
  2325.                   "«TSDWIN» is a granular library.  ONLY modules", ;
  2326.                   "you need are linked.  We have respect for a", ;
  2327.                   "need to  conserve  memory and have designed", ;
  2328.                   "«TSDWIN» accordingly!", "", ;
  2329.                   "Your continued  support is  appreciated and", ;
  2330.                   "helps to make this the product YOU want."} )
  2331.  
  2332. aadd( aMessages, {"«TSDWIN» lets  you configure  your windows to", ;
  2333.                   "match your own personal interface style. We", ;
  2334.                   "offer:", ;
  2335.                   "         ∙ Multiple «frame» types.", ;
  2336.                   "         ∙ Multiple «shadow» types.", ;
  2337.                   "         ∙ «Lines» and «Boxes».", ;
  2338.                   "         ∙ Various «title» schemes.", ;
  2339.                   "         ∙ Window «reactivation».", ;
  2340.                   "         ∙ Varied «text formatting».", ;
  2341.                   "         ∙ «Hiding» and «Unhiding».", ;
  2342.                   "         ∙ «Create» before «Display».", ;
  2343.                   "         ∙ Easy «Mouse Support».", ;
  2344.                   "         ∙ Mouse Support is «Optional».", ;
  2345.                   "         ∙ Comprehensive «documentation».", ;
  2346.                   "         ∙ «Moving», «Sizing» and «Sliding»",;
  2347.                   "         ∙ «BBS» and voice «support»." ;
  2348.                   } )
  2349.  
  2350. aadd( aMessages, {"«TSDWIN» offers three message systems:", ;
  2351.                   "", ;
  2352.                   "   ∙ Windowed informative and warning", ;
  2353.                   "     messages with automatic formatting.", ;
  2354.                   "   ∙ «Line» or «Area» messages with the", ;
  2355.                   "     option to use embedded colours.", ;
  2356.                   "   ∙ Three types of «Alert» boxes using", ;
  2357.                   "", ;
  2358.                   "           «Pushbutton»", ;
  2359.                   "           «Checkmark»", ;
  2360.                   "           and «Radio» selection.", ;
  2361.                   "", ;
  2362.                   "   ∙ Optional «ActionKeys».", ;
  2363.                   "   ∙ Automatic «Mouse Support».", ;
  2364.                   "   ∙ Initialization schemes to ensure", ;
  2365.                   "     consistency.", ;
  2366.                   "   ∙ On-the-Fly control of defaults." ;
  2367.                   } )
  2368.  
  2369. aadd( aMessages, {"«TSDWIN»'s MENU to  replacement gives you the", ;
  2370.                   "option to «control colours». It also includes", ;
  2371.                   "automatic  «hot keys»  and  «Mouse Support».", ;
  2372.                   "", ;
  2373.                   "There  are three  types  of «message systems»", ;
  2374.                   "including  multi-line messages  with direct", ;
  2375.                   "screen writes for speed. This menu is using", ;
  2376.                   "multi-line messages.", ;
  2377.                   "", ;
  2378.                   "Menus  may include «security» and also «action", ;
  2379.                   "blocks» to execute external code.", ;
  2380.                   "", ;
  2381.                   "Windowed «PopUp» menus  are available in both", ;
  2382.                   "the MENU to and ACHOICE() format.", ;
  2383.                   "", ;
  2384.                   "An  expandable «Line Menu»  accepts a varying", ;
  2385.                   "number of prompts." } )
  2386.  
  2387. aadd( aMessages, {"«TSDWIN» offers a choice of fast «DBF» and «Array»", ;
  2388.                   "browsers, with or without «Mouse Support».", ;
  2389.                   "", ;
  2390.                   "The new browses in «TSDWIN» 2.10  give you the", ;
  2391.                   "most complete control of column  definitions", ;
  2392.                   "and on-the-fly modification methods you will", ;
  2393.                   "find available.", ;
  2394.                   "", ;
  2395.                   "«Append» and «Edit» modes are availables in both", ;
  2396.                   "DBF and Array browses.", ;
  2397.                   "", ;
  2398.                   "«ActionKeys» and «Mouse Hot Spots»  make it very", ;
  2399.                   "easy to construct comprehensive mouse driven",;
  2400.                   "modules.", ;
  2401.                   "", ;
  2402.                   "You can build  whole applications around the", ;
  2403.                   "new browses in «TSDWIN» V2.10." ;
  2404.                   } )
  2405.  
  2406. aadd( aMessages, {"Mouse support in «TSDWIN» is almost automatic.", ;
  2407.                   "", ;
  2408.                   "With the  exception  of «Mouse Hot Spots», one", ;
  2409.                   "call to «twMouseInit()» at the  beginning of a", ;
  2410.                   "program  provides  you  with «automatic» mouse", ;
  2411.                   "operations.", ;
  2412.                   "", ;
  2413.                   "There  are «High and Level» mouse functions to", ;
  2414.                   "allow  you to extend and customize the mouse", ;
  2415.                   "operations already available in «TSDWIN».", ;
  2416.                   "", ;
  2417.                   "Two  methods of handling «Mouse Hot Spots» are", ;
  2418.                   "included:  one based on information  held in", ;
  2419.                   "the  calling  routine and another managed by", ;
  2420.                   "«TSDWIN».", ;
  2421.                   "", ;
  2422.                   "Mousing is «Optional» with «TSDWIN v2.10»."} )
  2423.  
  2424. aadd( aMessages, {"«TSDWIN» offers many functions which allow you", ;
  2425.                   "to provide your «clients» with  little  extras", ;
  2426.                   "to keep them «coming back».", ;
  2427.                   "", ;
  2428.                   "We  provide a  comprehensive «Calculator» with", ;
  2429.                   "memory  and a «Calendar» system to  use either", ;
  2430.                   "for data entry or as a driver for other date", ;
  2431.                   "operations.", ;
  2432.                   "", ;
  2433.                   "Creating «indexes» is easy and informative for", ;
  2434.                   "your clients when you use twIndexMaker().", ;
  2435.                   "", ;
  2436.                   "«File Backup» is available  with this version,", ;
  2437.                   "with or without the interface we provide.", ;
  2438.                   "", ;
  2439.                   "You will find replacements for MEMOEDIT()." ;
  2440.                   } )
  2441.  
  2442. aadd( aMessages, {"«TSDWIN» offers some functions  which directly", ;
  2443.                   "affect the computer hardware.", ;
  2444.                   "", ;
  2445.                   "We believe this area to be well-supported in",;
  2446.                   "other third party products and so our thrust",;
  2447.                   "is to provide only functions  which directly",;
  2448.                   "affect the «user interface».",;
  2449.                   "",;
  2450.                   "We offer easy and complete disk «Drive Status»",;
  2451.                   "checks which you can  call  Low-Level or use",;
  2452.                   "our windowed interface.", ;
  2453.                   "", ;
  2454.                   "There is the ability to check and/or set the", ;
  2455.                   "status of 'dead' keys (CTRL ALT DEL etc.).", ;
  2456.                   "", ;
  2457.                   "An on-screen «Clock» can be called directly or", ;
  2458.                   "fitted into your window scheme by «TSDWIN»." ;
  2459.                   } )
  2460.  
  2461. aadd( aMessages, {"", ;
  2462.                   "  «TSDWIN Version 2.10» is a «Major» Upgrade!", ;
  2463.                   "", ;
  2464.                   "", ;
  2465.                   "Current registered users should inquire about", ;
  2466.                   "«upgrading» to TSDWIN V2.10.", "",;
  2467.                   "", ;
  2468.                   "", ;
  2469.                   "«MAXI source» is included with version 2.10." ;
  2470.                   } )
  2471.  
  2472. aadd( aMessages, {"", ;
  2473.                   "", ;
  2474.                   "", ;
  2475.                   "",;
  2476.                   "     Trilateral Systems Development Ltd.",;
  2477.                   "",;
  2478.                   "has enjoyed bringing you this demonstration.";
  2479.                   } )
  2480.  
  2481. return aMessages[ nX ]
  2482. /*─────────────────────────────────────────────────────────────────────┐
  2483. │ Description: Display Corporate Colours                               │
  2484. │                                                                      │
  2485. │ function TSDSetup( lMono )                                           │
  2486. │                                                                      │
  2487. │   Args: lMono                                                        │
  2488. │                                                                      │
  2489. │ Return: nil                                                          │
  2490. │                                                                      │
  2491. └───Created: 02-06-93      at 05:02:11pm   ───────────────────────────*/
  2492. function TSDSetup( lMono )
  2493. if ! lMono
  2494.     @ 0, 19 say "T" COLOR "r+/bg"
  2495.     @ 0, 20 say "S" COLOR "gr+/bg"
  2496.     @ 0, 21 say "D" COLOR "w+/bg"
  2497. endif
  2498. if ! lMono
  2499.     @ maxrow(), 22 say "T" COLOR "r+/bg"
  2500.     @ maxrow(), 33 say "S" COLOR "gr+/bg"
  2501.     @ maxrow(), 41 say "D" COLOR "w+/bg"
  2502. endif
  2503.  
  2504. return nil
  2505. /*─────────────────────────────────────────────────────────────────────┐
  2506. │ Description: GetReader for twBRBrowse() Demo                         │
  2507. │                                                                      │
  2508. │ procedure BRGetReader( get, lGoRight, lRightOnEnter )                │
  2509. │                                                                      │
  2510. │    Arguments: get - get Object                                       │
  2511. │               lGoRight - stuff a oDB:Right()                         │
  2512. │               lRightOnEnter - stuff a oDB:Right() and write get      │
  2513. │                                                                      │
  2514. └───Created: 02-06-93      at 05:02:37pm   ───────────────────────────*/
  2515. procedure BRGetReader( get, lGoRight, lRightOnEnter )
  2516. DEFAULT lGoRight to .t., ;
  2517.         lRightOnEnter to .f.
  2518.  
  2519. // read the get if the when condition is satisfied
  2520. if ( GetPreValidate( get ))
  2521.     // activate the get for reading
  2522.     get:SetFocus()
  2523.     do while ( get:exitState == GE_NOEXIT )
  2524.  
  2525.         // check for initial typeout ( no editable positions )
  2526.         if ( get:typeOut )
  2527.             get:exitState := GE_ENTER
  2528.         endif
  2529.  
  2530.         // apply keystrokes until exit
  2531.         do while ( get:exitState == GE_NOEXIT )
  2532.             BRGetApplyKey( get, inkey( 0 ), lGoRight, lRightOnEnter )
  2533.         enddo
  2534.  
  2535.         // disallow exit if the VALID condition is not satisfied
  2536.         if ( !GetPostValidate( get ))
  2537.             get:exitState := GE_NOEXIT
  2538.         endif
  2539.     enddo
  2540.     // de-activate the GET
  2541.     get:KillFocus()
  2542. endif
  2543. return
  2544. /*─────────────────────────────────────────────────────────────────────┐
  2545. │ Description: Custom get Key Handler for Parts Browse (twBRBrowse() ) │
  2546. │                                                                      │
  2547. │ procedure BRGetApplyKey( get, key, lGoRight, lRightOnEnter )         │
  2548. │                                                                      │
  2549. │    Arguments: get - get Object                                       │
  2550. │               key - key passed from get reader                       │
  2551. │               lGoRight - stuff a oDB:Right()                         │
  2552. │               lRightOnEnter - stuff a oDB:Right() and write get      │
  2553. │                                                                      │
  2554. └───Created: 02-06-93      at 05:03:15pm   ───────────────────────────*/
  2555. procedure BRGetApplyKey( get, key, lGoRight, lRightOnEnter )
  2556. local cKey
  2557. local bKeyBlock
  2558. // check for set key first
  2559. if (( bKeyBlock := setkey( key )) <> nil )
  2560.     GetDosetkey( bKeyBlock, get, procname(2), procline(2) )
  2561.     return                                  // NOTE
  2562. endif
  2563.  
  2564. do case
  2565.     case ( key == K_UP )
  2566.         get:exitState := GE_UP
  2567.  
  2568.     case ( key == K_SH_TAB )
  2569.         get:exitState := GE_UP
  2570.  
  2571.     case ( key == K_DOWN )
  2572.         get:exitState := GE_DOWN
  2573.  
  2574.     case ( key == K_TAB )
  2575.         get:exitState := GE_DOWN
  2576.  
  2577.     case ( key == K_ENTER )
  2578.         if lGoRight
  2579.             get:exitState := GE_ENTER
  2580.             if lRightOnEnter
  2581.                 __keyboard( chr( K_RIGHT ))
  2582.             endif
  2583.         else
  2584.             if lRightOnEnter
  2585.                 get:exitState := GE_WRITE
  2586.                 __keyboard( chr( K_RIGHT ))
  2587.             else
  2588.                 get:exitState := GE_WRITE
  2589.                 __keyboard( chr( K_CTRL_HOME ) + iif( !( recno() = lastrec() + 1 ), chr( K_DOWN ), "" ))
  2590.             endif
  2591.         endif
  2592.  
  2593.     case ( key == K_ESC )
  2594.         if ( set( _SET_ESCAPE ))
  2595.             get:undo()
  2596.             get:exitState := GE_ESCAPE
  2597.         endif
  2598.  
  2599.     case ( key == K_PGUP )
  2600.         get:exitState := GE_WRITE
  2601.  
  2602.     case ( key == K_PGDN )
  2603.         get:exitState := GE_WRITE
  2604.  
  2605.     case ( key == K_CTRL_HOME )
  2606.         get:exitState := GE_TOP
  2607.  
  2608.         #ifdef CTRL_END_SPECIAL
  2609.         // both ^W and ^End go to the last GET
  2610.     case ( key == K_CTRL_END )
  2611.         get:exitState := GE_BOTTOM
  2612.  
  2613.         #else
  2614.         // both ^W and ^End terminate the READ ( the default )
  2615.     case ( key == K_CTRL_W )
  2616.         get:exitState := GE_WRITE
  2617.         #endif
  2618.  
  2619.     case ( key == K_INS )
  2620.         set( _SET_INSERT, !set( _SET_INSERT ))
  2621.         BRShowScoreboard()
  2622.  
  2623.     case ( key == K_UNDO )
  2624.         get:Undo()
  2625.  
  2626.     case ( key == K_HOME )
  2627.         get:Home()
  2628.  
  2629.     case ( key == K_END )
  2630.         get:End()
  2631.  
  2632.     case ( key == K_RIGHT )
  2633.         //get:Right()
  2634.         get:exitState := GE_WRITE
  2635.         if lGoRight
  2636.             __keyboard( chr( K_RIGHT ))
  2637.         else
  2638.             __keyboard( chr( K_CTRL_HOME ) + iif( !( recno() = lastrec() + 1 ), chr( K_DOWN ), "" ))
  2639.         endif
  2640.  
  2641.     case ( key == K_LEFT )
  2642.         //get:Left()
  2643.         get:exitState := GE_WRITE
  2644.         __keyboard( chr( K_LEFT ))
  2645.  
  2646.     case ( key == K_CTRL_RIGHT )
  2647.         get:Right()
  2648.  
  2649.     case ( key == K_CTRL_LEFT )
  2650.         get:Left()
  2651.  
  2652.     case ( key == K_BS )
  2653.         get:BackSpace()
  2654.  
  2655.     case ( key == K_DEL )
  2656.         get:Delete()
  2657.  
  2658.     case ( key == K_CTRL_T )
  2659.         get:DelWordRight()
  2660.  
  2661.     case ( key == K_CTRL_Y )
  2662.         get:DelEnd()
  2663.  
  2664.     case ( key == K_CTRL_BS )
  2665.         get:DelWordLeft()
  2666.  
  2667.     otherwise
  2668.  
  2669.         if ( key >= 32 .and. key <= 255 )
  2670.             cKey := chr( key )
  2671.             if ( get:type == "N" .and. ( cKey == "." .or. cKey == ", " ))
  2672.                 get:ToDecPos()
  2673.             else
  2674.                 if ( set( _SET_INSERT ))
  2675.                     get:Insert( cKey )
  2676.                 else
  2677.                     get:Overstrike( cKey )
  2678.                 endif
  2679.                 if ( get:typeOut .and. !set( _SET_CONFIRM ))
  2680.                     if ( set( _SET_BELL ))
  2681.                         ?? chr( 7 )
  2682.                     endif
  2683.                     if lGoRight
  2684.                         get:exitState := GE_ENTER
  2685.                         if lRightOnEnter
  2686.                             __keyboard( chr( K_RIGHT ))
  2687.                         endif
  2688.                     else
  2689.                         get:exitState := GE_WRITE
  2690.                         __keyboard( chr( K_CTRL_HOME ) + iif( !( recno() = lastrec() + 1 ), chr( K_DOWN ), "" ))
  2691.                     endif
  2692.                 endif
  2693.             endif
  2694.         endif
  2695. endcase
  2696. return
  2697. /**********************************
  2698. *
  2699. *   wacky compatibility services
  2700. *
  2701. */
  2702. // display coordinates for SCOREBOARD
  2703. #define SCORE_ROW       0
  2704. #define SCORE_COL       60
  2705. /*─────────────────────────────────────────────────────────────────────┐
  2706. │ Description: Compatibility PROC  for get reader                      │
  2707. │                                                                      │
  2708. │ static procedure BRShowScoreboard()                                  │
  2709. │                                                                      │
  2710. └───Created: 02-06-93      at 05:03:57pm   ───────────────────────────*/
  2711. static procedure BRShowScoreboard()
  2712. local nRow, nCol
  2713. if ( set( _SET_SCOREBOARD ))
  2714.     nRow := row()
  2715.     nCol := col()
  2716.     setpos( SCORE_ROW, SCORE_COL )
  2717.     dispout( iif( set( _SET_INSERT ), "Ins", "   " ))
  2718.     setpos( nRow, nCol )
  2719. endif
  2720. return
  2721. /*─────────────────────────────────────────────────────────────────────┐
  2722. │ Description: Wait State                                              │
  2723. │                                                                      │
  2724. │ function DemoWait( nWait, cHelpVar, nHelpLevel )                     │
  2725. │                                                                      │
  2726. │   Args: nWait       -  Wait Time                                     │
  2727. │         cHelpVar    -  Help System Name                              │
  2728. │         nHelpLevel  -  Help System Level                             │
  2729. │                                                                      │
  2730. │ Return: Key Pressed                                                  │
  2731. │                                                                      │
  2732. └───Created: 02-06-93      at 05:04:23pm   ───────────────────────────*/
  2733. function DemoWait( nWait, cHelpVar, nHelpLevel )
  2734. local nKey
  2735. #ifndef NOMOUSE
  2736.     nKey := twMInkeyWait( nWait, .t., .t., .t., cHelpVar, nHelpLevel )
  2737. #else
  2738.     nKey := twInkeyWait( nWait, cHelpVar, nHelpLevel )
  2739. #endif
  2740. return nKey
  2741. /*─────────────────────────────────────────────────────────────────────┐
  2742. │ Description: Useful Function                                         │
  2743. │                                                                      │
  2744. │ function ListProcs()                                                 │
  2745. │                                                                      │
  2746. └───Created: 02-06-93      at 05:05:07pm   ───────────────────────────*/
  2747. function ListProcs()
  2748. local aProcs := {}, nCount := 0
  2749. do while !(procname( nCount ) == "" )
  2750.     aadd( aProcs, STRINT( nCount ) + " / " + procname( nCount ) )
  2751.     nCount++
  2752. enddo
  2753. twinfo( aProcs )
  2754. return nil
  2755.