home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / utils / miscutil.zip / TBWINDOW.ZIP / TBWIND20.DOC < prev    next >
Text File  |  1987-06-06  |  10KB  |  297 lines

  1.  
  2.  
  3.  
  4.  
  5.                                                          June 6, 1987
  6.  
  7.  
  8.  
  9.                                      TBWINDO
  10.                                MULTI-LEVEL WINDOWS
  11.                              FOR BORLANDS TURBO BASIC
  12.                                    Version 2.0
  13.  
  14.         PURPOSE:
  15.  
  16.         This utility creates incredibly quick multi-level windows
  17.         in Turbo Basic programs for IBM PC/XT/AT compatibles.
  18.  
  19.  
  20.         TEST DRIVE:
  21.  
  22.         Compile and run the tutoring program DEMO20.BAS to get a feeling
  23.         for features and speed.
  24.  
  25.  
  26.         FILES:
  27.  
  28.         In this version, TBWINDO.ARC contains:
  29.             TBWINDO.INC  - Turbo Basic include file
  30.             QPRINT.BIN   - Quick print inline subroutine
  31.             QPRINTC.BIN  - Quick print between columns
  32.             QATTR.BIN    - Re-attribute an area of the screen
  33.             QFILL.BIN    - Fill an area of the screen with a
  34.                            specified character and attribute
  35.             SAVESCRN.BIN - Save screen inline subroutine
  36.             RESTSCRN.BIN - Restore screen inline subroutine
  37.             SCROLL.BIN   - Scroll inline subroutine
  38.             CALCATTR.BIN - Calculate Attribute inline subroutine
  39.             RECOLOR.BIN  - Screen area recoloring inline subroutine
  40.             DEMO20.BAS   - Demonstration program source code
  41.             TBWIND20.DOC - This document file.
  42.  
  43.             Assembly language source code for all BIN files is included
  44.             for all those interested.  Any suggestion for improvements to
  45.             the code would be appreciated, as I do not profess to be good
  46.             at Assembly Language.
  47.  
  48.         USING TBWINDO
  49.  
  50.         Include the TBWINDO.INC program in your program with
  51.         the following statement:
  52.  
  53.         $INCLUDE "TBWINDO.INC"
  54.  
  55.         Dimension the array for screen saves(see below).
  56.  
  57.         Set the SNOCHK% variable (see below).
  58.  
  59.         You invoke the routines by means of a CALL with a list of
  60.         parameters, rather than a GOSUB.
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.         Using the MAKEWINDOW procedure:
  70.  
  71.         CALL MAKEWINDOW(ROW%,COL%,ROWS%,COLS%,ATTR%,BRDRSEL%,SHADOW%,ZOOM%)
  72.  
  73.         Where: ROW - the screen row of the upper left hand corner of your
  74.                      desired window.  Value should be between 2 and 23
  75.                      (for reasons explained below).  WARNING - the subroutines
  76.                      doe not check for proper values. You must check these
  77.                      yourself or accept the consequences.
  78.  
  79.                COL - the screen column of the upper left hand corner. Value
  80.                      should be between 2 and 79.
  81.  
  82.               ROWS - the number of rows long the window should be.
  83.  
  84.               COLS - the number of columns wide the window should be.
  85.  
  86.               ATTR - the attribute of the window colors.
  87.  
  88.            BRDRSEL - the border you desire around the window.  Valid
  89.                      selections in this release are:
  90.  
  91.                         0 - No Frame (just a border of BACKground
  92.                             color.
  93.                         1 - Single Line Frame
  94.                         2 - Double Line Frame
  95.                         3 - Single Horizontal Line, Double Vertical
  96.                             Line Frame
  97.                         4 - Single Vertical Line, Double Horizontal
  98.                             Line Frame
  99.  
  100.             SHADOW - Another "switch" to indicate if the window should
  101.                      have a black "shadow" under it offset down and to
  102.                      the left. This gives a three-dimensional effect
  103.                      that seems to "raise" the window away from the
  104.                      screen. A value of 1 indicates a shadow is desired
  105.                      while a value of 0 means no shadow.
  106.  
  107.               ZOOM - A "switch" used to indicate to the subroutine if
  108.                      the window should "grow" from a small box at the
  109.                      midpoints of the coordinates to full size. A value
  110.                      of 1 indicates the window should grow. A value of
  111.                      0 indicates it should not.
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.         using the TITLEWINDOW procedure:
  136.  
  137.         CALL TITLEWINDOW(LOC%,TITLE$)
  138.  
  139.         Where: LOC - Indicates where the title should be placed.  Valid
  140.                      selections are:
  141.  
  142.                         1 - Top left hand corner
  143.                         2 - Top center
  144.                         3 - Top right hand corner
  145.                         4 - Lower left hand corner
  146.                         5 - Lower center
  147.                         6 - Lower right hand corner
  148.  
  149.              TITLE - The string data you would like printed.
  150.  
  151.                      NOTE:  The TITLEWINDOW procedure uses the coordinates
  152.                             from the most recent use of MAKEWINDOW.  Use this
  153.                             procedure only after a call has been made to
  154.                             MAKEWINDOW.
  155.  
  156.         Using the FNATTR% function:
  157.  
  158.         FNATTR%(FORE%,BACK%)
  159.  
  160.         Where: FORE - is the foreground color.  Any Turbo Basic color
  161.                       number is valid.
  162.  
  163.                BACK - is the backgound color.  Any Turbo Basic background
  164.                       color number is valid.
  165.  
  166.                FNATTR% returns the attribute of the colors specified.
  167.  
  168.  
  169.         Using the SAVESCRN procedure:
  170.  
  171.         First you must  define  an  integer array  with  a  dimension
  172.         of 2000 (allowing for 4000 bytes)  for each screen you store, early
  173.         in the program.  If you plan on saving screens three deep then the
  174.         array must be 6000.
  175.  
  176.         When making the call to SAVESCRN, you  must  pass the location of
  177.         this array as follows:
  178.                    10 DIM SCRDATA%(2000)
  179.                    .
  180.                    80 SNOCHK%=0:'Test retrace (1 will not test retrace)
  181.                    90 FIRST%=VARPTR(SCRDATA%(0))
  182.                   100 CALL SAVESCRN(SNOCHK%,FIRST%)
  183.         Also,  since  the  SAVESCRN operation 'loses' the position of the
  184.         cursor, you should preserve it prior to making the  call  if  you
  185.         need it as follows:
  186.                    90 OLDX=CSRLIN:OLDY=POS(0)
  187.         The RESTSCRN procedure is used in exactly the same way:
  188.                   200 CALL RESTSCRN(SNOCHK%,FIRST%)
  189.         and  if  necessary,  the cursor position can be restored by using
  190.         the following statement:
  191.                   210 LOCATE OLDX,OLDY
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.         Using the CALCATTR procedure:
  202.  
  203.         CALL CALCATTR(FORE%,BACK%,ATTR%)
  204.  
  205.         Where: FORE - Is the foreground color. Valid numbers are 0-31.
  206.  
  207.                BACK - Is the background color. Valid numbers are 0-7.
  208.  
  209.                ATTR - The attribute is returned in this variable.
  210.  
  211.                    CALL CALCATTR(15,1,ATTR%)
  212.                    Y% = ATTR%
  213.  
  214.         Using the RECOLOR procedure:
  215.  
  216.         CALL RECOLOR(OLDATTR%,NEWATTR%,SNOCHK%)
  217.  
  218.         Where: OLDATTR - Is the attribute of the areas on the screen
  219.                          you wish to change.
  220.  
  221.                NEWATTR - Is the attribute of the color you want.
  222.  
  223.                SNOCHK  - Snow checking switch.
  224.  
  225.                     X% = SCREEN(1,1,1)  ' RETURNS CURRENT SCREEN ATTRIBUTE
  226.                     CALL CALCATTR(14,4,ATTR%) ' CALCULATE NEW ATTRIBUTE
  227.                     CALL RECOLOR(X%,ATTR%,SNOCHK%)
  228.  
  229.                     This will recolor everything on the screen that has
  230.                     the same attribute a the upper left corner of the screen
  231.                     to a foreground of 14 and a background of 4.
  232.  
  233.  
  234.         All of the above variables (with the exception  of  TITLE$)  must
  235.         either  be  declared  globally  as  integers by means of a DEFINT
  236.         statement early  in  the  program;  or  must  have  the  specific
  237.         integer  identifier  (%)  attached  wherever  they  appear in the
  238.         program. The BASIC compiler is picky about this; so  be  sure  to
  239.         verify that the type assignment is correct.
  240.  
  241.         TBWINDO  requires  no special handling when it comes to compiling
  242.         your program. Just  make  certain  that  all  of  your  variables
  243.         passing  parameters  to  the TBWINDO subroutine are identified as
  244.         integers, and you will  be  able  to  proceed  with  the  compile
  245.         operation as with any other program.
  246.  
  247.  
  248.         ACKNOWLEDGEMENTS
  249.  
  250.         I would like to express my thanks to Dave Evers (BASWIN22),
  251.         Tom Hanlin (ADVBAS33) and Jim LeMay (WINDOW33).  The routines
  252.         presented are patterned after routines that were written by
  253.         them for MicroSoft Quick Basic and Borland Turbo Pascal.
  254.  
  255.         Rick Fothergill
  256.         141 Oak Hill Road
  257.         Pittsfield, MA 01201
  258.         (413) 442-2456
  259.  
  260.         GEnie Address: R.FOTHERGILL
  261.            Compuserve: 76210,443
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.                              TBWINDO QUICK REFERENCE
  270.  
  271.  
  272.         MakeWindow(Row%,Col%,Rows%,Cols%,Attr%,BrdrSel%,Shadow%,Zoom%)
  273.  
  274.         TitleWindow(Loc%,Title$)
  275.  
  276.         FNAttr%(Fore%,Back%)
  277.  
  278.         SaveScrn(SnoChk%,VarPtr(Scrn%(??)))
  279.  
  280.         RestScrn(SnoChk%,VarPtr(Scrn%(??)))
  281.  
  282.         ReColor(OldAttr%,NewAttr%,SnoChk%)
  283.  
  284.         CalcAttr(Fore%,Back%,Attr%)
  285.  
  286.         Scroll(ULRow%,ULCol%,LRRow%,LRCol%,Rows%,Dir%)
  287.  
  288.         Qprint(Row%,Col%,StrDat$,SnoChk%,Attr%)
  289.  
  290.         QprintC(Row%,ColLeft%,ColRight%,StrDat$,SnoChk%,Attr%)
  291.  
  292.         QFill(Row%,Col%,Rows%,Cols%,Char%,SnoChk%,Attr%)
  293.  
  294.         QAttr(Row%,Col%,Rows%,Cols%,SnoChk%,Attr%)
  295.  
  296.         QBox(Row%,Col%,Rows%,Cols%,Attr%,BrdrSel%)
  297.