home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / fast220c.zip / DEMO.PRG < prev    next >
Text File  |  1993-08-29  |  24KB  |  786 lines

  1. #include "fast.ch"
  2. #include "inkey.ch"
  3.  
  4.  
  5. /********************************************************************
  6. *      Fast Library For Clipper : Demo Program, 2.20c Lib. Version.
  7. *
  8. *      (c) 1992-93 Manu Roibal
  9. *
  10. *      Compile with : Clipper Demo /A /M /N /L /W
  11. *
  12. *      Link with    : Rtlink Fi Demo Lib Fast
  13. *             or    : Blinker Fi Demo Lib Fast
  14. */
  15.  
  16.  
  17. Function Main()
  18. Local nX := Col ()
  19. Local nY := Row ()
  20. Local cColor  := SetColor()
  21. Local nCursor := SetCursor( 0 )
  22. Local aE
  23. Local nInd
  24. Local cCadena
  25.     SetCancel( .F. )
  26.     Set ( _SET_SCOREBOARD, .F. )
  27.     SetColor ( "W+/B" )
  28.     Pantalla ( .T. )
  29.     aE := GaugeNew ( 8, "Fast Library For CA-Clipper. L'enfant Terrible", "B" )
  30.     For nInd := 1 To 30
  31.       GaugeUpdate( aE, 1 / 30 )
  32.       Delay( .01 )
  33.     Next
  34.     Screen( "Fast Library For CA-Clipper   ", "B+/W" )
  35.     Font ( "Roman.Fon" )
  36.     Version()
  37.     Screen ( "┼", "B+/B" )
  38.     FastSign( 1, 2 )
  39.     SetColor ( "N/BG,N/W" )
  40.     NewBox ( 3, 22, 22, 59, "Fast Library Demo Program", "╔═╗║╝═╚║ ", .T. )
  41.     Clock( .T., 0, 70 )
  42.     aChoice ( 5, 25, 21, 56, ;
  43.               { " 1. CA-Clipper GIF decoder", ;
  44.                 " 2. CA-Clipper PCX decoder", ;
  45.                 " 3. Calculator", ;
  46.                 " 4. Fire!!!", ;
  47.                 " 5. Calendar", ;
  48.                 " 6. Serpent game", ;
  49.                 " 7. Screen Saver", ;
  50.                 " 8. CA-Clipper Notes", ;
  51.                 " 9. Enjoy Tetris", ;
  52.                 "10. File Manager", ;
  53.                 "11. Backup", ;
  54.                 "12. Restore", ;
  55.                 "13. Window System Demo", ;
  56.                 "14. Directory Structure", ;
  57.                 "15. Load INI files", ;
  58.                 "16. Load and modify INI files", ;
  59.                 "17. A little Text Editor", ;
  60.                 "18. Windows with light focus", ;
  61.                 "19. Get Password", ;
  62.                 "20. Encrypt string", ;
  63.                 "21. Deencrypt string", ;
  64.                 "22. Graphics Demo", ;
  65.                 "23. GraphBar on CA-Clipper", ;
  66.                 "24. GraphTart on CA-Clipper", ;
  67.                 "25. VGA efects!!", ;
  68.                 "26. Fast Library Version", ;
  69.                 "27. Menu System Demo", ;
  70.                 "28. PCX in EGA y VGA", ;
  71.                 "29. Serial Comunications", ;
  72.                 "30. Mouse demo", ;
  73.                 "31. Font Editor", ;
  74.                 "32. Footing with CA-Clipper", ;
  75.                 "33. Big Clock", ;
  76.                 "34. Puzzle", ;
  77.                 "35. Another Graph Bar", ;
  78.                 "36. A mini debugger", ;
  79.                 "37. Ascii Table", ;
  80.                 "38. A message with scroll", ;
  81.                 "39. Sound Blaster demo", ;
  82.                 "40. Parallel DAC demo", ;
  83.                 "41. New Memo edit function", ;
  84.                 "42. Ellipse Graphs", ;
  85.                 "43. More Speed please", ;
  86.                 "44. Fast Icons" }, .T., "USERFUNC" )
  87.     Clock( .F. )
  88.     Pantalla ( .F. )
  89.     SetPos ( nY, nX )
  90.     SetColor ( cColor )
  91.     SetCursor ( nCursor )
  92.     Font ( "Standard.Fon" )
  93. Return ( Nil )
  94.  
  95.  
  96. Function UserFunc ( nModo, nElemento, nRel )
  97. Local aPanta
  98. Local nRet    := 2
  99. Local nInd
  100. Local cMemo   := "To be or not to be, that's the fastquestion"
  101.     If Lastkey () == K_ESC
  102.       If BoxQuery( "Are you sure you want to exit to DOS?" )
  103.         Return( 0 )
  104.       Else
  105.         Return( 32 )
  106.       EndIf
  107.     ElseIf Lastkey () == K_RETURN
  108.       aPanta := SaveScr ( , , , , 1 + nRandom ( 3 ) )
  109.       Pantalla ( .F. )
  110.       Do Case
  111.         Case nElemento == 1
  112.           SetVGA256()
  113.           If GIFShow256 ( "demo.gif" )
  114.             Inkey(0)
  115.             While Inkey() == 0
  116.               Origin( 0,  2 )
  117.               Origin( 0,  0 )
  118.               Origin( 0, -2 )
  119.               Origin( 0,  0 )
  120.             End
  121.           EndIf
  122.           TxtMode()
  123.           SetBlink(.F.)
  124.         Case nElemento == 2
  125.           SetVGA256()
  126.           If PCXShow256 ( "m_roibal.pcx", .T., .F. )
  127.             Inkey(0)
  128.           EndIf
  129.           TxtMode()
  130.           SetBlink(.F.)
  131.         Case nElemento == 3
  132.           Calculator ( "N/W", "G+/N", "R+/N" )
  133.         Case nElemento == 4
  134.           Al_Infierno()
  135.         Case nElemento == 5
  136.           Calendar ( 5, 20, "N/BG", "R/BG", "GR+/B" )
  137.         Case nElemento == 6
  138.           Serpent ( "W+/B*", "R+/B*", "G+/B*" )
  139.         Case nElemento == 7
  140.           ScreenSave ( "BG+/N", "Fast Library For CA-Clipper. (C) 1993 Manu Roibal" )
  141.         Case nElemento == 8
  142.           Notes( "W/B,N/BG", "W/B,N/BG,G/B,W/B,R+/B", "HojaCalc.hc" )
  143.         Case nElemento == 9
  144.           Tetris ( 25, 3, 4 )
  145.         Case nElemento == 10
  146.           Manager ( "N/W,N/BG", "N/BG", "*.prg" )
  147.         Case nElemento == 11
  148.           Backup ( Date (), Time (), "Root", "A:\", ;
  149.                    { { "C:\DOS\",      "*.*"   }, ;
  150.                      { "C:\OS2\MDOS\", "*.COM" } }, ;
  151.                    .T., "N/W,N/W" )
  152.         Case nElemento == 12
  153.           Restore ( "A:\", { "D:\DOS" }, "N/W,N/W" )
  154.         Case nElemento == 13
  155.           DemoVentanas ()
  156.         Case nElemento == 14
  157.           TreeDemo ( "C:\", "\*.*" )
  158.         Case nElemento == 15
  159.           LeerIni ( "FAST", "MANU", "CPUTYPE" )
  160.         Case nElemento == 16
  161.           ModificarIni ( "FAST", "MANU", "TIMESLIZE" )
  162.         Case nElemento == 17
  163.           Editor ( "Fast.Ini", "W/B" )
  164.         Case nElemento == 18
  165.           DemoFoco ()
  166.         Case nElemento == 19
  167.           DamePass ()
  168.         Case nElemento == 20
  169.           Revuelve ()
  170.         Case nElemento == 21
  171.           Revuelve ()
  172.         Case nElemento == 22
  173.           GrafDemo ()
  174.         Case nElemento == 23
  175.           BarraDemo ()
  176.         Case nElemento == 24
  177.           TartaDemo ()
  178.         Case nElemento == 25
  179.           EfectosVGA ()
  180.         Case nElemento == 26
  181.           Version ()
  182.         Case nElemento == 27
  183.           Menues ()
  184.         Case nElemento == 28
  185.           PCXDemo ()
  186.         Case nElemento == 29
  187.           DemoCom ()
  188.         Case nElemento == 30
  189.           DemoRata ()
  190.         Case nElemento == 31
  191.           FontEdit( "cubo.fon" )
  192.         Case nElemento == 32
  193.           Footing()
  194.         Case nElemento == 33
  195.           Cls
  196.           ? "  ■  Original idea by Angel Canudas  ■"
  197.           ? "  ■ Club Español de Usuarios Clipper ■"
  198.           BigClock()
  199.         Case nElemento == 34
  200.           BoxWarning( "The winner is... " + If( Puzzle(), "the User", "the Computer" ) )
  201.         Case nElemento == 35
  202.           Graf2Demo()
  203.         Case nElemento == 36
  204.           MiniDebug( 7, "Replicate( 'Fast ', 2 )" )
  205.         Case nElemento == 37
  206.           AsciiTab()
  207.         Case nElemento == 38
  208.           MsgScroll( 10, 20, 30, "Fast Library For CA-Clipper, the best CA-Clipper extender", "GR+/B" )
  209.         Case nElemento == 39
  210.           sbVocPlay ( "Fast.voc", 11268 )
  211.         Case nElemento == 40
  212.           If BoxQuery( "Do you have a Parallel DAC in LPT2?" )
  213.            dacPort( 2 )
  214.            dacVocPlay( "Fast.voc", 12912 )
  215.          EndIf
  216.         Case nElemento == 41
  217.           cMemo := FastMemo( 10, 10, 20, 60, cMemo, "Demo", "W+/B", .T., .T. )
  218.         Case nElemento == 42
  219.           EllipseDemo ()
  220.         Case nElemento == 43
  221.           MoreSpeed()
  222.         Case nElemento == 44
  223.           DemoIcons()
  224.       EndCase
  225.       Font ( "Roman.Fon" )
  226.       RestScr ( , , , , aPanta )
  227.       SetCursor ( 1 )
  228.       SetCursor ( 0 )
  229.     ElseIf LastKey () == K_ESC
  230.       nRet := 0
  231.     EndIf
  232. Return ( nRet )
  233.  
  234.  
  235. Function Pantalla ( lModo )
  236. Static cPanta
  237.     If lModo
  238.       cPanta := SaveScreen ( 0, 0, 24, 79 )
  239.     Else
  240.       Return ( Implode ( 0, 0, 24, 79, cPanta ) )
  241.     EndIf
  242. Return ( Nil )
  243.  
  244.  
  245. Function DamePass ()
  246. Local cPanta  := SaveScreen ( 0, 0, 24, 79 )
  247. Local nCursor := SetCursor ( 0 )
  248. Local cColor  := SetColor ( "W+/B" )
  249.     NewBox ( 5, 5, 9, 74, "Security", "╔═╗║╝═╚║ ", .T. )
  250.     GetPass ( 7, 12, "Input your access key (15 letters Max.):", 15 )
  251.     SetColor ( cColor )
  252.     SetCursor ( nCursor )
  253.     Implode ( 0, 0, 24, 79, cPanta )
  254. Return ( Nil )
  255.  
  256.  
  257. Function Revuelve ()
  258. Local cPanta  := SaveScreen ( 0, 0, 24, 79 )
  259. Local nCursor := SetCursor ( 0 )
  260. Local cColor  := SetColor ( "W+/B" )
  261. Local cEncrip
  262. Local cDeEncrip
  263.     NewBox ( 5, 5, 10, 74, "De/Encrypt", "╔═╗║╝═╚║ ", .T. )
  264.     cEncrip := Encrypt ( "Manu Roibal" )
  265.     Message ( 7, 12, "<Manu Roibal> -> encrypt -> " + cEncrip )
  266.     cDeEncrip := DesEncrypt ( cEncrip )
  267.     Message ( 8, 12, "<" + cEncrip + "> -> deEncrypt -> " + cDeEncrip )
  268.     Inkey (0)
  269.     SetColor ( cColor )
  270.     SetCursor ( nCursor )
  271.     Implode ( 0, 0, 24, 79, cPanta )
  272. Return ( Nil )
  273.  
  274.  
  275. Function TreeDemo ( cDisco, cMascara )
  276. Local cPanta  := SaveScreen ( 0, 0, 24, 79 )
  277. Local nCursor := SetCursor ( 0 )
  278. Local cColor  := SetColor ( "W+/B,N/W" )
  279. Local aDisco  := DirTree ( cMascara, cDisco )
  280.     Window ( 4, 0, 22, 29, "Directory " + cDisco, "╔═╗║╝═╚║ ", .T. )
  281.     Achoice ( 5, 2, 21, 27, aDisco, .T. )
  282.     SetColor ( cColor )
  283.     SetCursor ( nCursor )
  284.     Implode ( 0, 0, 24, 79, cPanta )
  285. Return ( Nil )
  286.  
  287.  
  288. Function DemoVentanas ()
  289. Local aColor := { "N/BG", "W+/R", "R/W",  "G/W",  "B/W",  "W/B", ;
  290.                   "G+/W", "W+/G", "BG/N", "N/BG", "R+/B", "GR+/N" }
  291. Local nTipo
  292. Local cColor
  293. Local nInd := 0
  294. Local nX1  := 0
  295. Local nY1  := 0
  296. Local nX2  := 0
  297. Local nY2  := 0
  298. Local aPan := {}
  299. Local cPan := ""
  300.     For nInd := 1 To 100
  301.       nX1 := nRandom ( 77 ) + 1
  302.       nY1 := nRandom ( 22 ) + 1
  303.       nX2 := nRandom ( 77 - nX1 ) + nX1 + 1
  304.       nY2 := nRandom ( 22 - nY1 ) + nY1 + 1
  305.       cColor  := aColor [ nRandom ( 11 ) + 1 ]
  306.       nTipo := nRandom ( 3 ) + 1
  307.       If nX2 - nX1 < 22
  308.         nTipo := 4
  309.       EndIf
  310.       If nTipo == 1
  311.         If Seconds () % 2 == 0
  312.           Window ( nY1, nX1, nY2, nX2, "Window with shadow", "╔═╗║╝═╚║ ", .T., cColor )
  313.         Else
  314.           NewBox ( nY1, nX1, nY2, nX2, "NewBox with shadow", "╔═╗║╝═╚║ ", .T., cColor )
  315.         EndIf
  316.       ElseIf nTipo == 2
  317.         If Seconds () % 2 == 0
  318.           Window ( nY1, nX1, nY2, nX2, "Window without shadow", "╔═╗║╝═╚║ ", .F., cColor )
  319.         Else
  320.           NewBox ( nY1, nX1, nY2, nX2, "NewBox without shadow", "╔═╗║╝═╚║ ", .F., cColor )
  321.         EndIf
  322.       ElseIf nTipo == 3
  323.         Wall ( nY1, nX1, nY2, nX2, cColor )
  324.       Else
  325.         If Seconds () % 2 == 0
  326.           Window ( nY1, nX1, nY2, nX2, , "╔═╗║╝═╚║ ", .T., cColor )
  327.         Else
  328.           NewBox ( nY1, nX1, nY2, nX2, , "╔═╗║╝═╚║ ", .T., cColor )
  329.         EndIf
  330.       EndIf
  331.     Next
  332.     Inkey(5)
  333.     Stars()
  334.     cPan := SaveScreen ( 0, 0, 24, 79 )
  335.     Fascinate( "G", "BG" )
  336.     Inkey(0)
  337.     aPan := SaveScr ( , , , , 1 )
  338.     RestScreen ( 0, 0, 24, 79, cPan )
  339.     RestScr ( , , , , aPan )
  340.     aPan := SaveScr ( , , , , 2 )
  341.     RestScreen ( 0, 0, 24, 79, cPan )
  342.     RestScr ( , , , , aPan )
  343.     aPan := SaveScr ( , , , , 3 )
  344.     RestScreen ( 0, 0, 24, 79, cPan )
  345.     RestScr ( , , , , aPan )
  346.     aPan := SaveScr ( , , , , 4 )
  347.     RestScreen ( 0, 0, 24, 79, cPan )
  348.     RestScr ( , , , , aPan )
  349. Return ( Nil )
  350.  
  351.  
  352. Function LeerIni ( cFichero, cAplicacion, cCampo )
  353. Local cValor
  354. Local cPantalla := SaveScreen ( 0, 0, 24, 79 )
  355.     IniLoad ( cFichero, cAplicacion )
  356.     cValor := IniSearch( cCampo, "386SX" )
  357.     Window ( 9, 15, 16, 64, "Configuration", "╔═╗║╝═╚║ ", .T., "N/BG" )
  358.     Message ( 11, 20, "The .Ini shows CPU Type -> " + cValor, "N/BG" )
  359.     Message ( 12, 20, "Default value is        -> 386SX" , "N/BG" )
  360.     Message ( 14, 20, "For more information read Fast.ini", "N/BG" )
  361.     Inkey ( 0 )
  362.     Implode ( 0, 0, 24, 79, cPantalla )
  363. Return ( Nil )
  364.  
  365.  
  366. Function ModificarIni ( cFichero, cAplicacion, cCampo )
  367. Local cValor
  368. Local cNuevo
  369. Local cPantalla := SaveScreen ( 0, 0, 24, 79 )
  370.     IniLoad ( cFichero, cAplicacion )
  371.     cValor := IniSearch( cCampo, "50" )
  372.     Window ( 9, 15, 16, 64, "Configuration", "╔═╗║╝═╚║ ", .T., "N/BG" )
  373.     Message ( 11, 20, "The .Ini shows Time Slize -> " + cValor, "N/BG" )
  374.     cNuevo := TransForm ( nRandom ( 99 ), "99" )
  375.     IniSave( cCampo, cNuevo )
  376.     IniWrite( cFichero, cAplicacion )
  377.     Message ( 12, 20, "New value will be         -> " + cNuevo, "N/BG" )
  378.     Message ( 14, 20, "For more information read Fast.ini", "N/BG" )
  379.     Inkey ( 0 )
  380.     Implode ( 0, 0, 24, 79, cPantalla )
  381. Return ( Nil )
  382.  
  383.  
  384. Function DemoFoco ()
  385. Local aBoton
  386.     aBoton := BoxOpen ( 3, 10, 5, 50, "B", .1 )
  387.     Message ( 4, 13, "- Original idea by Urbano García -", "W+/B" )
  388.     While Inkey ( 0 ) != K_ESC
  389.       BoxPush ( aBoton )
  390.     End
  391.     BoxClose ( aBoton )
  392. Return ( Nil )
  393.  
  394.  
  395. Function GrafDemo ()
  396.     SetVGA()
  397.     DispStr ( "Now, i am going to generate lines until you press any key", 35, 50, 9, 0, 10 )
  398.     Inkey(0)
  399.     While Inkey() == 0
  400.       gLine( nRandom(639), nRandom(479), nRandom(639), nRandom(479), nRandom( 15 ) )
  401.     End
  402.     TxtMode()
  403.     SetBlink(.F.)
  404. Return ( Nil )
  405.  
  406.  
  407. Function BarraDemo ()
  408.     SetVGA ()
  409.     GraphBar ( "This is a VGA special efects demo", ;
  410.                { "Item 1",               { 2481, 3212, 4212, 1266, 1699, 6312 } }, ;
  411.                , ;
  412.                { "Item 3",               { 2481, 3212, 4212, 1266, 1699, 6312 } }, ;
  413.                { "Item 4 and last",      { 2281, 3332, 3212, 2557, 7499, 2612 } } )
  414.     Inkey (0)
  415.     TxtMode ()
  416.     SetBlink (.F.)
  417. Return ( Nil )
  418.  
  419.  
  420. Function Graf2Demo ()
  421.     SetVGA ()
  422.     GraphBar2 ( "This is a VGA special efects demo", ;
  423.                 { { 9481, 4212, 5212, 4266, 8699, 9442, 9298 }, ;
  424.                   { 7481, 1212, 4642, 1234, 6542, 9312, 1921 }, ;
  425.                   { 2481, 3212, 4212, 1266, 1699, 6312, 7921 }, ;
  426.                   { 2281, 3332, 3212, 2557, 7499, 2612, 3120 } } )
  427.     Legend (  20, 420, 15,  9, "Fast Library" )
  428.     Legend ( 340, 420, 15, 10, "Other" )
  429.     Legend (  20, 450, 15, 11, "Other" )
  430.     Legend ( 340, 450, 15, 12, "Other" )
  431.     Inkey (0)
  432.     TxtMode ()
  433.     SetBlink (.F.)
  434. Return ( Nil )
  435.  
  436.  
  437. Function TartaDemo ()
  438. Local cTitulo := "Statistics"
  439.     SetVGA ()
  440.     GraphTart ( 540, 60, 40, { 17, 3, 15, 60, 15 } )
  441.     GraphTart ( 80, 120, 30, { 17, 3, 15, 60, 15 } )
  442.     gBox ( 210, 130, 430, 350, 10 )
  443.     GraphTart ( 320, 240, 100, { 17, 3, 15, 60, 15 } )
  444.     DispStr ( cTitulo, 320 - Len ( cTitulo ) * 4, 370, 15, 0 )
  445.     Legend ( 320, 460, 15, 4, "Fast Library For CA-Clipper" )
  446.     Inkey (0)
  447.     TxtMode ()
  448.     SetBlink (.F.)
  449. Return ( Nil )
  450.  
  451.  
  452. Function EllipseDemo ()
  453. Local cTitulo := "Statistics"
  454.     SetVGA ()
  455.     GraphEllipse ( 540, 60, 40, { 17, 3, 15, 60, 15, 21, 21, 23, 54 } )
  456.     GraphEllipse ( 80, 120, 30, { 17, 3, 15, 60, 15, 21, 47, 11, 11, 64, 11 } )
  457.     gBox ( 210, 130, 430, 350, 10 )
  458.     GraphEllipse ( 320, 240, 100, { 17, 23, 12, 72, 3, 15, 60, 21, 15 } )
  459.     DispStr ( cTitulo, 320 - Len ( cTitulo ) * 4, 370, 15, 0 )
  460.     Legend ( 320, 460, 15, 4, "Fast Library For CA-Clipper" )
  461.     Inkey (0)
  462.     TxtMode ()
  463.     SetBlink (.F.)
  464. Return ( Nil )
  465.  
  466.  
  467. Function Version ()
  468. Local cPanta  := SaveScreen ( 0, 0, 24, 79 )
  469. Local nCursor := SetCursor ( 0 )
  470. Local cColor  := SetColor ( "GR+/B" )
  471.     NewBox ( 5, 5, 13, 74, "Credits", "╔═╗║╝═╚║ ", .T. )
  472.     Message (  7, 9, PadC ( FastVersion(), 61 ) )
  473.     Message (  9, 9, PadC ( FastRight(),   61 ) )
  474.     Message ( 11, 9, PadC ( FastUser(),    61 ) )
  475.     Inkey (0)
  476.     SetColor ( cColor )
  477.     SetCursor ( nCursor )
  478.     Implode ( 0, 0, 24, 79, cPanta )
  479. Return ( Nil )
  480.  
  481.  
  482. Function DemoRata ()
  483.     Cls
  484.     If rIsMouse()
  485.       ? "Well, you have a mouse; Them, press any key or mouse button"
  486.       rInkey(0)
  487.       rCursorOn ()
  488.       rSetPos ( 12, 39 )
  489.       ? "Now mouse cursor is on 12,39"
  490.       rSetPos ( 12, 39 )
  491.       rSetArea ( 16, 30, 18, 50 )
  492.       rInkey(0)
  493.       rCursorOff ()
  494.       ? "good bye mouse"
  495.       rInkey(0)
  496.       rCursorOn()
  497.       ? "hello mouse"
  498.       rInkey(0)
  499.       rColors ( 1, 8 )
  500.       ? "Now, press any key or mouse button"
  501.       rInkey(0)
  502.       rCursorOff()
  503.     Else
  504.       BoxWarning ( "There is no mouse on system" )
  505.     EndIf
  506. Return ( Nil )
  507.  
  508.  
  509. Function EfectosVGA()
  510. Local nInd    := 0
  511. Local nValor  := 3
  512. Local cCambio := ""
  513.     SetVGA ()
  514.     GraphBar ( "This is a VGA special efects demo", ;
  515.                { "Item 1",               { 2481, 3212, 4212, 1266, 1699, 6312 } }, ;
  516.                , ;
  517.                { "Item 3",               { 2481, 3212, 4212, 1266, 1699, 6312 } }, ;
  518.                { "Item 4 and last",      { 2281, 3332, 3212, 2557, 7499, 2612 } } )
  519.     egVGAOn()
  520.     egHigh( "w" )
  521.     egChange( "rb",  "gr+" )
  522.     egChange( "w+",  "n"   )
  523.     egChange( "r",   "b"   )
  524.     egChange( "bg+", "n"   )
  525.     egChange( "b",   "gr+" )
  526.     egChange( "w",   "b+"  )
  527.     egChange( "r+",  "bg"  )
  528.     egChange( "gr+", "n"   )
  529.     Inkey(0)
  530.     egRatePal( 4 )
  531.     egRateClk( 1 )
  532.     Inkey(0)
  533.     egRatePal( 1 )
  534.     egRateClk( 4 )
  535.     Inkey(0)
  536.     egRestAll()
  537.     egBlink( "r",  "g+", .T. )
  538.     egBlink( "gr", "bg"  )
  539.     egBlink( "w+", "g",  .T. )
  540.     Inkey(0)
  541.     egRestAll()
  542.     egFixPal( .T. )
  543.     cCambio := ""
  544.     nValor  := 3
  545.     For nInd = 1 TO 16
  546.        cCambio += Chr ( nValor ) + Chr ( 0 ) + Chr ( 0 )
  547.        nValor  += 4
  548.     Next
  549.     egPalette( 14, cCambio )
  550.     egPalNo( 14 )
  551.     Inkey ( 0 )
  552.     cCambio := ""
  553.     nValor  := 3
  554.     For nInd = 1 TO 16
  555.        cCambio += Chr ( 0 ) + Chr ( nValor ) + Chr ( 0 )
  556.        nValor  += 4
  557.     Next
  558.     egPalette( 14, cCambio )
  559.     egPalNo( 14 )
  560.     Inkey(0)
  561.     cCambio := ""
  562.     nValor  := 3
  563.     For nInd = 1 TO 16
  564.        cCambio += Chr ( 0 ) + Chr ( 0 ) + Chr ( nValor )
  565.        nValor  += 4
  566.     Next
  567.     egPalette( 14, cCambio )
  568.     egPalNo( 14 )
  569.     Inkey(0)
  570.     egVGAOff()
  571.     TxtMode ()
  572.     SetBlink ( .F. )
  573. Return ( Nil )
  574.  
  575.  
  576. Function Menues ()
  577. Local aMenu
  578. Local nOpt
  579. Local cColor   := "W+/BG,N+/BG"
  580. local cGet1    := "Manu Roibal                 "
  581. local cGet2    := "Fast Library For CA-Clipper "
  582. local GetList  := {}
  583. local nChoice1 := 2
  584. local nChoice2 := 1
  585. local nChoice3 := 1
  586. local nChoice4 := 3
  587. local nChoice5 := 2
  588.     Clock( .F. )
  589.     Clock( .T., MaxRow(), 70 )
  590.     Fascinate ( "GR", "BG" )
  591.     Set wrap On
  592.     Set message To 24 Center
  593.     @ 24, 0 Say Space ( 80 ) Color "N/W"
  594.     aMenu := NewMenu( { "^System", "^Tools", "^States", "^Last" }, ;
  595.                       { "N/W", "R/W", "W/B", "W+/B", "N/W", "W+/B", "N+/W", ;
  596.                         "R/W", "GR+/B" } )
  597.     AddItem ( aMenu, 1, "New", "Nothing" )
  598.     AddItem ( aMenu, 1, "Open" )
  599.     AddLine ( aMenu, 1 )
  600.     AddItem ( aMenu, 1, "Save", "More messages" )
  601.     AddItem ( aMenu, 1, "Discard" )
  602.     AddLine ( aMenu, 1 )
  603.     AddItem ( aMenu, 1, "Good m^orning sir", , 3 )
  604.     AddItem ( aMenu, 1, "^Quit", "Are you sure you want exit from here?" )
  605.     DelItem ( aMenu, 1, 3 )
  606.     OffItem ( aMenu, 1, 2 )
  607.     AddItem ( aMenu, 2, "^Cut" )
  608.     AddItem ( aMenu, 2, "^Paste" )
  609.     AddItem ( aMenu, 2, "^Copy" )
  610.     AddItem ( aMenu, 3, "^Search" )
  611.     AddItem ( aMenu, 3, "^Replace" )
  612.     AddItem ( aMenu, 4, "^Help" )
  613.     AddItem ( aMenu, 4, "And ^more Help" )
  614.     AddItem ( aMenu, 4, "And more, ^and more..." )
  615.     AddLine ( aMenu, 4 )
  616.     AddItem ( aMenu, 4, "Little rabbit ^Duracell" )
  617.     nOpt := DispMenu ( aMenu, 3 )
  618.     BoxWarning ( "And the winer is... " + Str ( nOpt ) )
  619.     Clock( .F. )
  620.     Clock( .T., 0, 70 )
  621.     Cls
  622.     SetCursor ( 1 )
  623.     @ 4,5  say "Get Normal 1:" get cGet1
  624.     @ 6,5  say "Clipper Lib"   get nChoice1 VALID nChoice1 == 3 COLOR cColor ;
  625.            with radiobuttons { "1 Option1", "2 No buttons 2", "3 Not Selected" }
  626.     @ 6,40 say "Fast Library"  get nChoice2 when nChoice1 != 2 COLOR cColor ;
  627.            with radiobuttons { "1 Adios", "2 Agur", "3 Bye bye", "4 Adeu" }
  628.     @ 7,60 get nChoice3        COLOR cColor ;
  629.            with radiobuttons { "1 Fast", "2 Normal", "3 Slow" } ;
  630.            nobox
  631.     @ 12,5 say "Get Normal 2:" get cGet2
  632.     @ 15,5 say "Botones 4:"
  633.     @ 15,col()+1 get nChoice4 COLOR cColor ;
  634.                  with radiobuttons { "1 Option 1", "2 Option 2", "3 Option 3" } ;
  635.                  nobox ;
  636.                  horizontal
  637.     @ 17,5 Say "Botones 5:" get nChoice5 COLOR cColor ;
  638.            with radiobuttons { "1 Option1", "2 Option 2", "3 Option 3" } ;
  639.            double ;
  640.            horizontal
  641.     read
  642. Return ( Nil )
  643.  
  644.  
  645. Function PCXDemo ()
  646. Local i
  647.     SetVGA()
  648.     PCXShow ( "fast.pcx", .F., 100,  10 )
  649.     DispStr ( "Press any key to continue", 350, 60, 15, 0 )
  650.     While Inkey() == 0
  651.       For i := 0 To -340 Step -2
  652.         Origin( 0, i )
  653.       Next
  654.       For i := -340 To 0 Step +2
  655.         Origin( 0, i )
  656.       Next
  657.       Origin( 0, 0 )
  658.     End
  659.     Degrade( Palette() )
  660.     TxtMode ()
  661.     SetBlink(.F.)
  662. Return ( Nil )
  663.  
  664.  
  665. Function DemoCom()
  666. #define COMPORT 2
  667. Local nAux := ComInst( COMPORT )
  668.     Cls
  669.     If nAux != 0
  670.       BoxWarning( "Error number " + Str( nAux, 1 ) + " in COM" + Str( COMPORT, 1 ) )
  671.     Else
  672.       ComHighDTR()
  673.       ComSpeed( 2400 )
  674.       ComParity( COM_NONE, 1 )
  675.       Message( 10, 10, "Alt-X Exit. Another key go to port" )
  676.       While .T.
  677.         nAux := Inkey( 0 )
  678.         If nAux == K_ALT_X
  679.           ComUnInst()
  680.           Exit
  681.         EndIf
  682.         ComOutput( nAux )
  683.         nAux := ComInput()
  684.         If nAux != Nil
  685.           Message( 12, 10, "Received from port : " + Str( nAux ) )
  686.         EndIf
  687.       End
  688.     EndIf
  689. Return( Nil )
  690.  
  691.  
  692. Function Al_Infierno()
  693.     Fire()
  694.     SetBlink( .F. )
  695. Return( Nil )
  696.  
  697.  
  698. Function MoreSpeed()
  699. Local nTime
  700. Local aBoton
  701. Local nInd
  702.     aBoton := BoxOpen ( 8, 2, 14, 76, "B", .1 )
  703.     @ 10, 10 Say "Writes 1 to 15.000 with @ Say ->" Color "W+/B"
  704.     nTime := Seconds()
  705.     For nInd := 1 to 15000
  706.       @ 10, 40 Say Str( nInd ) Color "W+/B"
  707.     Next
  708.     @ 10, 60 Say Str( Seconds() - nTime ) Color "GR+/B"
  709.     @ 12, 10 Say "Writes 1 to 15.000 with Fast  ->" Color "W+/B"
  710.     nTime := Seconds()
  711.     For nInd := 1 to 15000
  712.       FastPrint( 12, 40, Str( nInd ), 31 )
  713.     Next
  714.     @ 12, 60 Say Str( Seconds() - nTime ) Color "GR+/B"
  715.     Inkey(0)
  716.     BoxClose( aBoton )
  717. Return( Nil )
  718.  
  719.  
  720. Function DemoIcons()
  721. Local aExit, aCubo, aLine
  722.     Cls
  723.     Font( "Cubo.Fon" )
  724.     aExit := BoxOpen( 5, 30, 7, 34, "B", 0.2 )
  725.     @ 6, 31 Say "≡≤≥" Color "GR+/B"
  726.     aCubo := BoxOpen( 5, 38, 7, 42, "B", 0.2 )
  727.     @ 6, 39 Say " ⌠ " Color "GR+/B"
  728.     aLine := BoxOpen( 5, 46, 7, 50, "B", 0.2 )
  729.     @ 6, 47 Say " ┌█" Color "GR+/B"
  730.     Inkey( 0 )
  731.     BoxPush( aExit )
  732.     Inkey( 0 )
  733.     BoxPush( aCubo )
  734.     Inkey( 0 )
  735.     BoxPush( aLine )
  736.     Font( "Standard.Fon" )
  737. Return( Nil )
  738.  
  739.  
  740. Function Footing()
  741. Local nI      := 0
  742. Local nCont   := 1
  743. Local cC      := ""
  744. Local nN      := 1
  745. Local cColor  := setcolor( "Gr+/B" )
  746. Local aFrase  := {}
  747. Local cLit    := "Fast-Fonts Demo. Created by ≈Yosu Unibaso Suarez"
  748. Local nLonLit := Len( cLit ) + 12 - 1
  749. Local aBox
  750.     aFrase = Array( 80 )
  751.     aFill( aFrase, " " )
  752.     For nI := 12 To nLonlit
  753.       aFrase[ nI ] := SubStr( cLit, nI - 11, 1 )
  754.     Next
  755.     Font( "cubo.fon" )
  756.     aBox := BoxOpen( 4, 0, 6, 79, "b", 0.2 )
  757.     @ 5, 2 Say "ε"
  758.     For nI := 2 To 78
  759.       If nCont == 1
  760.         cC := "±"
  761.       ElseIf nCont == 2
  762.         cC := "ε"
  763.       ElseIf nCont == 3
  764.         cC := "÷"
  765.       ElseIf nCont == 4
  766.         cC := "ε"
  767.       EndIf
  768.       @ 5, nI say cC
  769.       nCont := If( nCont < 4, ++nCont, 1 )
  770.       Delay( 0.1 )
  771.       @ 5, nI say aFrase[ nI ]
  772.     Next
  773.     cC := "▄▌"
  774.     For nI := 2 To 77
  775.       @ 5, nI Say cC
  776.       Delay( 0.1 )
  777.       @ 5, nI Say "  "
  778.     Next
  779.     BoxPush( aBox )
  780.     BoxClose( aBox )
  781.     Font( "standard.fon" )
  782.     SetColor( cColor )
  783. Return( Nil )
  784.  
  785.  
  786.