home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / QBAS / Q4T15.ZIP / Q4T-DEMO.BAS next >
BASIC Source File  |  1992-02-21  |  26KB  |  585 lines

  1. '----------------------------------------------------------------------------
  2. '                         **    Q4T-DEMO.BAS    **
  3. '      Demonstration of the capabilities of the Q4Tool Library routines
  4. '     Written for and compiled with Microsoft (R), QuickBASIC  4.00b (C)
  5. '                   By R. J. Crouch  -  June 1990/Jan 1992
  6. '                     Copyright  -  1990-92  -  CareWare
  7. '                            All Rights Reserved
  8. '----------------------------------------------------------------------------
  9.  
  10. ' For Q4tool v.1.5
  11.  
  12. REM $INCLUDE: 'Q4T.BI'                            ' Contains declarations for
  13.                                                   '  Ctr() and Delay()
  14. DEFINT A-Z
  15.  
  16. TYPE RegType                                      ' Necessary for the CALL to
  17.    ax    AS INTEGER                               ' QB's Interrupt() routine
  18.    bx    AS INTEGER                               ' used to clear the screen
  19.    cx    AS INTEGER                               ' at end of demo
  20.    dx    AS INTEGER                               ' Generally placed in the
  21.    bp    AS INTEGER                               ' "$INCLUDE:" file
  22.    si    AS INTEGER                               '
  23.    di    AS INTEGER                               '
  24.    flags AS INTEGER                               '
  25. END TYPE                                          '
  26.                                                   
  27. DIM InReg AS RegType, OutReg AS RegType               ' Typed for Interrupt()
  28. DIM Menu(5, 4) AS STRING                        ' Array for BarMenu() routine
  29. DIM ScrnBuf(8) AS STRING * 4000                          ' Room for 9 screens
  30.                                                          '  w/ option base 0
  31. FALSE = 0: TRUE = NOT FALSE                                           ' Flags
  32. CONST CONT = "Press any key to continue"                            ' Prompts
  33. CONST MCONT = "Left mouse button to continue"                       '
  34.  
  35. Menu(0, 0) = "0303020401"          '<== Contains upper limits of each 2nd dim-
  36.                                       ' ension for each 1st dimension of any
  37. Menu(1, 0) = " Menu Item #1 "         ' menu array.  The field for each value
  38. Menu(1, 1) = " Select Item #1 "       ' is 2 characters in length.
  39. Menu(1, 2) = " Do Item #2     "       '
  40. Menu(1, 3) = " Pick Item #3   "       '     1st Dim      1   2   3   4   5
  41.                                       ' 
  42. Menu(2, 0) = " Item #2 "              '  # of level 2   03  03  02  04  01
  43. Menu(2, 1) = " #1           "         '  menu items
  44. Menu(2, 2) = " Level 2 - #2 "         '                   
  45. Menu(2, 3) = " #3           "         ' 2nd dim. of any menu array must be as
  46.                                       ' large as the largest 1st dim. set.
  47. Menu(3, 0) = " Level #1 Item #3 "     ' ie.  since 1st dim. 4 of Menu() has 4
  48. Menu(3, 1) = " Pick Item #1      "    ' 2nd dim. items - Menu() must be DIMed
  49. Menu(3, 2) = " Show This Item #2 "    ' DIM Menu(5, 4) AS STRING
  50.                                       '             |-- largest number of 2nd
  51. Menu(4, 0) = " Selection #4 "         '                 dimension items
  52. Menu(4, 1) = " Sub Menu Item #1  " '<== The window width of the level 2 menu
  53. Menu(4, 2) = " Sub Item #2       "    ' is determined by the length of ele-
  54. Menu(4, 3) = " Sub Level Item #3 "    ' ment 1 of the 2nd dim.  All strings
  55. Menu(4, 4) = " Sub Menu Item #4  "    ' should be as long as the longest item
  56.                                       ' title.  Spaces at start and end of
  57. Menu(5, 0) = " Quit "                 ' string are not required, but present a
  58. Menu(5, 1) = " Exit Menu Demo "       ' better looking menu when highlighting.
  59.  
  60. b1$ = CHR$(221) + " ": b2$ = " " + CHR$(222)                       ' Brackets
  61. cpyr$ = b1$ + "Copyright - 1990-92 - CareWare" + b2$
  62. mpos1$ = b1$ + "Row ## - Col ##" + b2$                         ' Formats for
  63. mpos2$ = b1$ + "Y ###  -  X ###" + b2$                         '  PRINT USING
  64. buttons = 0
  65.                                     
  66. 'ON KEY(10) GOSUB Terminate                                 ' For programming
  67. 'KEY(10) ON                                                 '  purposes only
  68.  
  69. '----------------------------------------------------------------------------
  70. 'Title Screen
  71. '----------------------------------------------------------------------------
  72.  
  73.    COLOR 7, 0, 0: CLS
  74.    CALL DoWindow(1, 3, 25, 76, 103, 5, 0, "Q4Tool Demo - Ver. 1.5", 2)
  75.    CALL PrtScrn(cpyr$, 25, 24, 103)
  76.    CALL DoWindow(3, 13, 16, 56, 15, 5, 3, CONT, 3)
  77.    FOR row = 5 TO 14
  78.       READ line$: lctr = Ctr(line$) + 1
  79.       IF row < 8 THEN att = 12 ELSE att = 14
  80.       CALL PrtScrn(line$, row, lctr, att)
  81.    NEXT row
  82.    READ line$
  83.    CALL PrtScrn(line$, row + 1, lctr, 10)
  84.    CALL PrtScrn("█▀▀▐ █ █", 21, 11, 103)
  85.    CALL PrtScrn("█▄▄▐▄█▄█", 22, 11, 103)
  86.    CALL PrtScrn("Software", 23, 11, 103)
  87.    CALL PrtScrn("by  R. J. Crouch", 21, 55, 103)
  88.    CALL PrtScrn("Member", 22, 65, 103)
  89.    CALL PrtScrn(" ssociation of  hareware  rofessionals", 23, 33, 103)
  90.    CALL PrtScrn("A", 23, 33, 96)
  91.    CALL PrtScrn("S", 23, 48, 96)
  92.    CALL PrtScrn("P", 23, 58, 96)
  93.    CALL PutScrn(ScrnBuf(0))
  94.    WHILE INKEY$ = "": WEND                       ' Typical wait for key press
  95.    CALL MouseStatus(have)                         ' Check for mouse interrupt
  96.    IF have THEN                                            ' Ask to use mouse
  97.       CALL DoWindow(7, 16, 12, 49, 12, 1, 0, "", 0)
  98.       CALL MouseVersion(ver$)
  99.       FOR row = 9 TO 14
  100.          READ line$
  101.          lcrt = Ctr(line$)
  102.          CALL PrtScrn(line$, row, lctr, 14)
  103.          IF row = 10 THEN
  104.             CALL PrtScrn(ver$, row, lctr + 26, 10)
  105.             CALL PrtScrn(".", row, lctr + 26 + LEN(ver$), 14)
  106.          END IF
  107.       NEXT row
  108.       finish! = TIMER + 30
  109.       DO
  110.          i$ = UCASE$(INKEY$)                                   ' Wait for key
  111.          now! = TIMER                                          '  or 30 sec.
  112.       LOOP UNTIL i$ = "N" OR i$ = "Y" OR now! > finish!
  113.       IF i$ = "Y" THEN                              ' Initialize mouse driver
  114.          prompt$ = MCONT: pctr = Ctr(MCONT)                ' Use mouse prompt
  115.          CALL MouseReset(buttons)                       ' Return # of buttons
  116.          Mouse = TRUE
  117.       ELSE                                                 ' Mouse not wanted
  118.          prompt$ = CONT: pctr = Ctr(CONT)                    ' Use key prompt
  119.          Mouse = FALSE
  120.       END IF
  121.       CALL PrtScrn(prompt$, 16, pctr, 10)
  122.       CALL Delay(30, 0)
  123.    ELSE                                                   ' No mouse detected
  124.       FOR x = 1 TO 6: READ nul$: NEXT x                ' Skip mouse text data
  125.    END IF
  126.    CALL GetScrn(ScrnBuf(0))                         ' Retrieve opening screen
  127.    IF Mouse THEN CALL PrtScrn(b1$ + prompt$ + b2$, 18, pctr - 2, 15)
  128.    CALL Delay(60, 0)
  129.    CLS
  130.    CALL DoWindow(8, 14, 9, 53, 13, 5, 3, prompt$, 3)
  131.    FOR row = 11 TO 13
  132.       READ line$: lctr = Ctr(line$)
  133.       CALL PrtScrn(line$, row, lctr, 15)
  134.    NEXT row
  135.    CALL Delay(60, 0)
  136.  
  137. '----------------------------------------------------------------------------
  138. 'Frame types and screen save/restore
  139. '----------------------------------------------------------------------------
  140.  
  141.    COLOR 0, 0, 0: CLS
  142.    col = 0: frm = -1: scrn = -1
  143.    bgd = 0: fgd = 15
  144.    FOR row = 2 TO 14 STEP 3
  145.       col = col + 6: bgd = bgd + 1
  146.       frm = frm + 1: fgd = fgd - 1
  147.       watt = (bgd * 16) + fgd
  148.       CALL DoWindow(row, col, 10, 20, watt, frm, 0, "Window", 2)
  149.       scrn = scrn + 1
  150.       CALL PutScrn(ScrnBuf(scrn))                   ' Screen save w/PutScrn()
  151.    NEXT row
  152.    FOR row = 11 TO 2 STEP -3
  153.       col = col + 6: bgd = bgd + 1
  154.       frm = frm + 1: fgd = fgd - 1
  155.       IF frm = 6 THEN frm = 1
  156.       IF bgd = 9 THEN bgd = 1
  157.       watt = (bgd * 16) + fgd
  158.       CALL DoWindow(row, col, 10, 20, watt, frm, 0, "Q4Tool", 3)
  159.       IF scrn < 8 THEN                             ' Save all but last screen
  160.          scrn = scrn + 1
  161.          CALL PutScrn(ScrnBuf(scrn))             ' Save screens for later use
  162.       END IF
  163.    NEXT row
  164.    FOR row = 3 TO 9
  165.       READ line$
  166.       CALL PrtScrn(line$, row, col + 2, 31)
  167.    NEXT row
  168.    CALL PrtScrn(prompt$, 25, pctr, 10)
  169.    CALL Delay(60, 0)
  170.    CALL DoWindow(9, 12, 7, 56, 15, 5, 0, "", 3)
  171.    FOR row = 11 TO 13
  172.       READ line$: lctr = Ctr(line$)
  173.       CALL PrtScrn(line$, row, lctr, 10)
  174.    NEXT row
  175.    CALL Delay(60, 0)
  176.    FOR show = 7 TO 0 STEP -1
  177.       CALL GetScrn(ScrnBuf(show))                    ' Retrieve saved screens
  178.    NEXT show
  179.    FOR row = 5 TO 7
  180.       CALL PrtScrn("*  Fast  *", row, 11, 16)
  181.    NEXT row
  182.    CALL Delay(2, 0)
  183.    CALL DoWindow(10, 12, 7, 56, 15, 5, 0, prompt$, 3)
  184.    FOR row = 12 TO 13
  185.       READ line$: lctr = Ctr(line$)
  186.       CALL PrtScrn(line$, row, lctr, 10)
  187.    NEXT row
  188.    CALL Delay(60, 0)
  189.    FOR show = 1 TO 8
  190.       CALL GetScrn(ScrnBuf(show))                ' Screen restore w/GetScrn()
  191.       CALL Delay(.33, 0)                         '  .33 second delay added
  192.    NEXT show
  193.    CALL PrtScrn("Now a three", 5, 58, 31)
  194.    CALL PrtScrn("second pause", 7, 58, 31)
  195.    CALL Delay(3, 0)
  196.    FOR show = 8 TO 0 STEP -1
  197.       CALL GetScrn(ScrnBuf(show))
  198.       CALL Delay(.33, 0)
  199.    NEXT show
  200.    CALL DoWindow(2, 6, 10, 20, 116, 5, 0, "Q4Tool", 2)
  201.    CALL PrtScrn("*  Next  *", 5, 11, 112)
  202.    CALL PrtScrn("Shadow Styles", 7, 10, 112)
  203.    CALL PrtScrn(prompt$, 25, pctr, 10)
  204.    CALL Delay(60, 0)
  205.  
  206. '----------------------------------------------------------------------------
  207. 'Shadowing
  208. '----------------------------------------------------------------------------
  209.  
  210.    CLS
  211.    CALL DoWindow(1, 1, 25, 80, 57, 5, 0, prompt$, 3)
  212.    CALL DoWindow(2, 21, 3, 38, 112, 1, 0, "", 0)
  213.    CALL DoWindow(6, 41, 18, 35, 17, 0, 0, "", 0)
  214.    READ line$: lctr = Ctr(line$)
  215.    CALL PrtScrn(line$, 3, lctr, 117)
  216.    FOR row = 7 TO 16 STEP 9
  217.       FOR col = 8 TO 43 STEP 35
  218.          shadow = shadow + 1: back = back + 1: watt = (back * 16) + 14
  219.          CALL DoWindow(row, col, 7, 30, watt, back, shadow, "", 0)
  220.          FOR x = row + 2 TO row + 4
  221.             READ line$
  222.             CALL PrtScrn(line$, x, col + 5, back * 16)
  223.          NEXT x
  224.       NEXT col
  225.       back = back + 1
  226.    NEXT row
  227.    CALL PutScrn(ScrnBuf(0))
  228.    CALL Delay(60, 0)
  229.    CALL DoWindow(8, 9, 10, 62, 14, 5, 0, prompt$, 3)
  230.    FOR row = 10 TO 14
  231.       READ line$: lctr = Ctr(line$)
  232.       IF row < 12 THEN att = 15 ELSE att = 10
  233.       CALL PrtScrn(line$, row, lctr, att)
  234.    NEXT row
  235.    CALL Delay(60, 0)
  236.    CALL GetScrn(ScrnBuf(0))
  237.    CALL DoWindow(11, 12, 7, 57, 11, 5, 0, prompt$, 3)
  238.    FOR row = 13 TO 14
  239.       READ line$
  240.       CALL PrtScrn(line$, row, 18, 15)
  241.    NEXT row
  242.    CALL Delay(60, 0)
  243.  
  244. '----------------------------------------------------------------------------
  245. 'MenuDemo
  246. '----------------------------------------------------------------------------
  247.  
  248.    COLOR 1, 1, 0: CLS
  249.    DO
  250.       R1 = 2: R2 = 0
  251.       CALL PrtScrn("Use the arrow keys to highlight and press <ENTER> to select.", 12, 10, 31)
  252.       IF Mouse THEN
  253.          CALL PrtScrn("or", 13, 39, 31)
  254.          CALL PrtScrn("Roll your mouse to highlight and press the LEFT button to select.", 14, 8, 31)
  255.       END IF
  256.       CALL BarMenu(Menu(), 11, 4, 120, 112, 79, Mouse, R1, R2)
  257.  
  258.       ' Generally placed after this CALL is some type of selectional
  259.       ' trapping.  The following remarked section outlines a brief example
  260.       ' of one type of system.  The number of CASEs required depends on the
  261.       ' number of items per menu level.
  262.       '
  263.       ' SELECT CASE R1                     Level #1
  264.       '    CASE 0   
  265.       '       SELECT CASE R2               Level #2
  266.       '          CASE 0
  267.       '             <ESC> key or RIGHT mouse button pressed
  268.       '          CASE ELSE
  269.       '       END SELECT
  270.       '    CASE 1
  271.       '       SELECT CASE R2               Level #2
  272.       '          CASE 1
  273.       '             Do this
  274.       '          CASE 2
  275.       '             Do this instead
  276.       '          Etc...
  277.       '          CASE ELSE
  278.       '       END SELECT
  279.       '    CASE 2
  280.       '       SELECT CASE R2
  281.       '          CASE 1
  282.       '             Now do this
  283.       '          CASE 2
  284.       '             Do this instead
  285.       '          Etc...
  286.       '          CASE ELSE
  287.       '       END SELECT
  288.       '    Etc...
  289.       '    Etc...
  290.       '    CASE ELSE
  291.       ' END SELECT
  292.  
  293.       IF Mouse THEN CALL MouseVisible(0)
  294.       CALL DoWindow(8, 12, 11, 57, 6, 5, 0, prompt$, 3)
  295.       CALL PrtScrn("The following values were returned.", 11, 23, 14)
  296.       CALL PrtScrn("Level 1 menu item is ==>" + STR$(R1), 13, 27, 11)
  297.       CALL PrtScrn("Level 2 menu item is ==>" + STR$(R2), 15, 27, 11)
  298.       CALL Delay(0, 0)
  299.       CALL DoWindow(8, 12, 11, 57, 17, 0, 0, "", 0)
  300.    LOOP UNTIL (R1 = 5 AND R2 = 1)
  301.    CLS
  302.    CALL DoWindow(9, 12, 7, 57, 13, 5, 0, prompt$, 3)
  303.    FOR row = 11 TO 12
  304.       READ line$
  305.       CALL PrtScrn(line$, row, 21, 15)
  306.    NEXT row
  307.    CALL Delay(60, 0)
  308.  
  309. '----------------------------------------------------------------------------
  310. 'Equipment and System Information
  311. '----------------------------------------------------------------------------
  312.  
  313.    CALL GetDrive(DrvTot, CurDrv, CurDir$)
  314.    Avail& = CurDrv
  315.    CALL DriveSpc(Avail&)
  316.    CALL GetVideo(VMode, VPage, VCol, CStrt, CStp, CAtt)
  317.    CALL GetDOS(Dver$)
  318.    CALL GetSize("Q4T-DEMO.EXE", FSize&)
  319.    CALL DoWindow(3, 8, 19, 65, 7, 5, 0, "Equipment and System Information", 2)
  320.    CALL PrtScrn(b1$ + prompt$ + b2$, 21, pctr - 2, 7)
  321.    CALL PrtScrn("     The Current Drive:  " + CHR$(CurDrv + 64) + ":", 6, 21, 11)
  322.    CALL PrtScrn("Total Drives Installed: " + STR$(DrvTot), 7, 21, 11)
  323.    CALL PrtScrn("     Current Directory:  " + CurDir$, 8, 21, 11)
  324.    CALL PrtScrn("  Disk Space Available: " + STR$(Avail&) + " Bytes", 9, 21, 11)
  325.    CALL PrtScrn("    Current Video Mode: " + STR$(VMode), 10, 21, 11)
  326.    CALL PrtScrn("    Current Video Page: " + STR$(VPage), 11, 21, 11)
  327.    CALL PrtScrn("     Number of Columns: " + STR$(VCol), 12, 21, 11)
  328.    CALL PrtScrn("     Cursor Start Line: " + STR$(CStrt), 13, 21, 11)
  329.    CALL PrtScrn("      Cursor Stop Line: " + STR$(CStp), 14, 21, 11)
  330.    CALL PrtScrn("      Cursor Attribute: " + STR$(CAtt), 15, 21, 11)
  331.    CALL PrtScrn("   Current DOS Version:  " + Dver$, 16, 21, 11)
  332.    CALL PrtScrn("  Size of Q4T-DEMO.EXE: " + STR$(FSize&) + " Bytes", 17, 21, 11)
  333.    CALL Delay(60, 0)
  334.    CALL DoWindow(9, 12, 7, 57, 13, 5, 0, prompt$, 3)
  335.    FOR row = 11 TO 12
  336.       READ line$
  337.       CALL PrtScrn(line$, row, 18, 15)
  338.    NEXT row
  339.    CALL Delay(60, 0)
  340.    
  341. '----------------------------------------------------------------------------
  342. 'Mouse Services
  343. '----------------------------------------------------------------------------
  344.  
  345.    mver$ = b1$ + "Mouse Driver ver. " + ver$ + "  -  "
  346.    mstat$ = mver$ + "With" + STR$(buttons) + " buttons installed" + b2$
  347.    sctr = Ctr(mstat$)
  348.  
  349.    CLS
  350.    CALL DoWindow(1, 1, 25, 80, 30, 5, 0, "Q4Tool", 2)
  351.    CALL DoWindow(2, 31, 3, 20, 31, 1, 0, "", 0)
  352.    CALL PrtScrn("Mouse Services", 3, 34, 31)
  353.    CALL DoWindow(5, 5, 10, 35, 12, 5, 0, "Mouse State #1", 2)
  354.    CALL DoWindow(7, 14, 3, 18, 12, 1, 0, "", 0)
  355.    CALL DoWindow(5, 42, 10, 35, 12, 5, 0, "Mouse State #2", 2)
  356.    CALL DoWindow(16, 7, 6, 68, 115, 5, 3, "", 0)
  357.    FOR row = 17 TO 20
  358.       READ line$
  359.       CALL PrtScrn(line$, row, 10, 112)
  360.    NEXT row
  361.    CALL PutScrn(ScrnBuf(0))
  362.    IF Mouse THEN
  363.       CALL PrtScrn(mstat$, 25, sctr, 30)
  364.       CALL MouseLimits(6, 6, 13, 38, 1)                 ' -------------------
  365.       CALL MouseLocate(11, 22, 1)                       '
  366.       CALL MouseCursor(9, 7, 30)                        '
  367.       CALL MouseReset(2)                                ' Save mouse state #1
  368.       CALL MouseVisible(1)                              ' Mouse pointer on
  369.       DO
  370.          CALL MouseClick(lft, mid, rgt)                 ' Typical wait for a
  371.       LOOP UNTIL lft OR rgt                             ' mouse button
  372.       IF rgt THEN
  373.          CALL MouseLimits(6, 43, 13, 75, 1)             ' -------------------
  374.          CALL MouseLocate(11, 59, 1)                    '
  375.          CALL MouseCursor(14, 0, 24)                    '
  376.          CALL MouseReset(4)                             ' Save mouse state #2
  377.  
  378.          pos$ = mpos1$: Mode = 1
  379.          DO                                             ' Loop conditional to
  380.             CALL MouseClick(lft, mid, rgt)              ' mouse button
  381.             IF rgt AND switch THEN
  382.                CALL MouseVisible(0)                   ' Turn old cursor off
  383.                CALL MouseReset(5)                     ' Recall mouse state #2
  384.                CALL MouseVisible(1)                   ' Turn new cursor on
  385.                switch = FALSE
  386.             ELSEIF rgt THEN
  387.                CALL MouseVisible(0)                   ' Turn old cursor off
  388.                CALL MouseReset(3)                     ' Recall mouse state #1
  389.                CALL MouseVisible(1)                   ' Turn new cursor on
  390.                CALL PrtScrn("Black Hole", 8, 18, 12)
  391.                switch = TRUE
  392.             END IF
  393.             IF switch THEN                                   ' Mouse state #1
  394.                CALL MouseExclude(7, 14, 9, 31, 1)           ' Black hole area
  395.                CALL MousePosition(mr, mc, 1)                 ' Turn cursor on
  396.                IF mr < 7 OR mr > 9 OR mc < 14 OR mc > 31 THEN ' outside of
  397.                   CALL MouseVisible(1)                        ' excluded area
  398.                END IF
  399.             ELSE                                             ' Mouse state #2
  400.                IF lft THEN                                     ' Toggle modes
  401.                   IF Mode = 0 THEN
  402.                      pos$ = mpos1$: Mode = 1
  403.                   ELSE
  404.                      pos$ = mpos2$: Mode = 0
  405.                   END IF
  406.                END IF
  407.                CALL MousePosition(r, c, Mode)         ' Return mouse position
  408.                LOCATE 14, 50: COLOR 12, 0: PRINT USING pos$; r; c
  409.             END IF
  410.          LOOP UNTIL lft AND switch
  411.       END IF
  412.       CALL MouseVisible(0)
  413.       READ line$, line$
  414.    ELSE                                                 ' Print no mouse text
  415.       CALL PrtScrn("Black Hole", 8, 18, 12)
  416.       CALL DoWindow(21, 7, 4, 68, 12, 1, 0, CONT$, 3)
  417.       FOR row = 22 TO 23
  418.          READ line$: lctr = Ctr(line$)
  419.          CALL PrtScrn(line$, row, lctr, 14)
  420.       NEXT row
  421.       CALL Delay(60, 0)
  422.       CALL GetScrn(ScrnBuf(0))
  423.    END IF
  424.    CALL DoWindow(8, 12, 11, 56, 6, 5, 0, prompt$, 3)
  425.    FOR row = 10 TO 16
  426.       READ line$: lctr = Ctr(line$)
  427.       IF row < 12 THEN att = 15 ELSE att = 10
  428.       CALL PrtScrn(line$, row, lctr, att)
  429.    NEXT row
  430.    CALL Delay(60, 0)
  431.  
  432. '----------------------------------------------------------------------------
  433. 'Closing
  434. '----------------------------------------------------------------------------
  435.  
  436.    CLS
  437.    CALL DoWindow(1, 1, 25, 80, 71, 5, 0, "Q4Tool Demo - Ver. 1.5", 2)
  438.    CALL DoWindow(3, 6, 21, 69, 15, 5, 0, "", 3)
  439.    CALL PrtScrn(cpyr$, 25, 24, 71)
  440.    READ line$: lctr = Ctr(line$)
  441.    CALL PrtScrn(line$, 5, lctr, 12)
  442.    FOR row = 7 TO 19
  443.       READ line$: lctr = Ctr(line$)
  444.       CALL PrtScrn(line$, row, lctr, 14)
  445.    NEXT row
  446.    CALL PrtScrn(prompt$, 21, pctr, 10)
  447.    CALL Delay(90, 0)
  448.  
  449. '----------------------------------------------------------------------------
  450. Terminate:
  451. '----------------------------------------------------------------------------
  452.   
  453.    IF Mouse THEN CALL MouseReset(0)
  454.  
  455.    ah = 7: al = 0                               ' Example of system Interrupt
  456.    bh = 7: bl = 0                               '  to clear a screen (ie. CLS)
  457.    ch = 0: cl = 0                               '  with int 10h function 7h
  458.    dh = 24: dl = 79                             '  (ah = scroll down)
  459.    InReg.ax = (ah * 256) + al                   ' Conversion of high and low
  460.    InReg.bx = (bh * 256) + bl                   '  byte for acceptance by QB
  461.    InReg.cx = (ch * 256) + cl                   '
  462.    InReg.dx = (dh * 256) + dl                   '
  463.    CALL Interrupt(&H10, InReg, OutReg)          ' Returns nothing
  464.  
  465.    END
  466.  
  467.  
  468.    DATA "Welcome to the world of the"
  469.    DATA "Q4Tool Library [Q4T]"
  470.    DATA "═══════════════════════════"," "
  471.    DATA "This program is set up to demonstrate  the"
  472.    DATA "features of the Q4T Library.  This library"
  473.    DATA "is  designed  to  work with Microsoft (R),"
  474.    DATA "QuickBASIC 4.xx (C).   The source code for"
  475.    DATA "this demo is provided so you  can  examine"
  476.    DATA "the  actual  usage  of these Q4T routines."
  477.    DATA "             Shall we begin?"
  478.    DATA "This  program  detects  the presence of a"
  479.    DATA "mouse driver; version no."
  480.    DATA "Do  you wish to use your mouse throughout"
  481.    DATA "this demonstration?"," "
  482.    DATA "               (Y)  -  (N)"
  483.    DATA "First you will see the various windowing"
  484.    DATA "frame  styles and a demonstration of the"
  485.    DATA "screen save and restore routines.       "
  486.    DATA "Q4Tool  offers a"
  487.    DATA "wide variety  of"
  488.    DATA "frame styles."
  489.    DATA "----------------"
  490.    DATA "The window title"
  491.    DATA "can be placed at"
  492.    DATA "top or bottom.  "
  493.    DATA "Each window screen was saved with PutScrn()."
  494.    DATA "We will now use  GetScrn()  and recall those"
  495.    DATA "nine screens.                               "
  496.    DATA "Now  we will add a .33 second delay  and"
  497.    DATA "again recycle through the saved screens."
  498.    DATA "**  Window Shadow Styles  **"
  499.    DATA "left side and bottom"," "
  500.    DATA "*  black in color  *"
  501.    DATA "right side and bottom"," "
  502.    DATA "*  black in  color  *"
  503.    DATA "left side and bottom"," "
  504.    DATA "*   tinted black   *"
  505.    DATA "right side and bottom"," "
  506.    DATA "*   tinted  black   *"
  507.    DATA "So far this demonstration has used  the  following"
  508.    DATA "routines with a combined number of 72 occurrences."," "
  509.    DATA "   MouseStatus() - DoWindow() - PrtScrn()   "
  510.    DATA "   Delay() - PutScrn() - GetScrn() - Ctr()  "
  511.    DATA "Next is a demonstration of the mouse and key"
  512.    DATA "driven pull-down bar menu routine of Q4Tool."
  513.    DATA "Next is a list of equipment and system"
  514.    DATA "information returned by Q4Tool routines."
  515.    DATA "Next will be a demonstration of  the  various"
  516.    DATA "mouse services offered in the Q4Tool Library."
  517.    DATA "The right mouse button will toggle between the separate mouse"
  518.    DATA "states.  While in mouse state #2,  the left mouse button will"
  519.    DATA "toggle  between  modes  for  MousePosition().  While in mouse"
  520.    DATA "state #1, the left mouse button will exit Mouse Services.    "
  521.    DATA "Sorry, but a mouse driver is not detected by this program."
  522.    DATA "A demonstration of the mouse services will not be done."
  523.    DATA "The following routines are used in the mouse"
  524.    DATA "services demonstration.                     ", " "
  525.    DATA "MouseStatus()    MouseReset()     MousePosition()"
  526.    DATA "MouseLocate()    MouseLimits()    MouseVersion() "
  527.    DATA "MouseVisible()   MouseExclude()   MouseCursor()  "
  528.    DATA "MouseClick()                                     "
  529.    DATA "  ==   Q4Tool Library (Q4T)   =="
  530.    DATA "This concludes the short demonstration of the features"
  531.    DATA "offered by the Q4Tool Library.  Nearly  every  routine"
  532.    DATA "in  Q4T  was used in this demo.  Over 2/3 of the lines"
  533.    DATA "of code in this program contain  a  Q4Tool  statement."
  534.    DATA "The  features  offered  in  this library are common to"
  535.    DATA "most programming needs.  The  prototypes  and  a  full"
  536.    DATA "description  of  these  routines are documented in the"
  537.    DATA "file Q4TOOL.DOC.  Information on the object files  and"
  538.    DATA "source codes for the routines in Q4T is also available"
  539.    DATA "in this file.                                         "," "
  540.    DATA "Microsoft is a registered  trademark of the  Microsoft"
  541.    DATA "Corporation.  Good Luck and Enjoy!                    "
  542.  
  543. '============================================================================
  544. '
  545. '      The source code for  this  demonstration  is  quite  simple.  It
  546. '      should, however, give you a better idea as to the practical  use
  547. '      of  the  Q4Tool  library routines.  Q4T is designed to be a lib-
  548. '      rary containing the routines generally needed most.   The  mouse
  549. '      services, DoWindow, & BarMenu are the backbone of  this library.
  550. '      There's few programs, large  or  small,  that  couldn't  utilize
  551. '      these features.
  552. '
  553. '      The   complete   Q4Tool  Library  is  distributed  as  the  file
  554. '      Q4T15.ZIP and contains the following files:
  555. '
  556. '                Q4T.LIB         Q4T.QLB           Q4T.BI
  557. '                Q4TOOL.DOC      Q4T-DEMO.BAS      Q4T-DEMO.EXE
  558. '
  559. '      Information  on  the availability of the source and object codes
  560. '      for Q4Tool is found in  the  file  Q4TOOL.DOC.  You  can  always
  561. '      obtain the latest version of Q4Tool from CompuServe (R), IBMPRO,
  562. '      LIB 4 (Browse Q4T) or directly from CareWare.
  563. '
  564. '      Q4Tool is copyrighted to the author with all rights reserved and
  565. '      is  distributed  as  a Shareware product.  If you acquire Q4Tool
  566. '      and decide to use its  services,  than  a  registration  fee  of
  567. '      $25.00  is  required.  This fee, when paid, entitles you to full
  568. '      usage and support of this product, and  the  latest  version  of
  569. '      Q4Tool and individual QBJ modules on disk.
  570. '
  571. '                                           _______
  572. '                                      ____|__     |                (R)
  573. '      R. J. Crouch                 --|       |    |-------------------
  574. '      CareWare                       |   ____|__  |  Association of
  575. '      10217 Ridge View Dr.           |  |       |_|  Shareware
  576. '      Grass Valley, CA  95945        |__|   o   |    Professionals
  577. '      (916) 477-6024               -----|   |   |---------------------
  578. '      CIS - 74270,516                   |___|___|    MEMBER
  579. '
  580. '
  581. '      Microsoft is registered trademark of the Microsoft Corporation.
  582. '
  583. '============================================================================
  584.  
  585.