home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
utils
/
miscutil.zip
/
TBWINDOW.ZIP
/
TBWIND20.DOC
< prev
next >
Wrap
Text File
|
1987-06-06
|
10KB
|
297 lines
June 6, 1987
TBWINDO
MULTI-LEVEL WINDOWS
FOR BORLANDS TURBO BASIC
Version 2.0
PURPOSE:
This utility creates incredibly quick multi-level windows
in Turbo Basic programs for IBM PC/XT/AT compatibles.
TEST DRIVE:
Compile and run the tutoring program DEMO20.BAS to get a feeling
for features and speed.
FILES:
In this version, TBWINDO.ARC contains:
TBWINDO.INC - Turbo Basic include file
QPRINT.BIN - Quick print inline subroutine
QPRINTC.BIN - Quick print between columns
QATTR.BIN - Re-attribute an area of the screen
QFILL.BIN - Fill an area of the screen with a
specified character and attribute
SAVESCRN.BIN - Save screen inline subroutine
RESTSCRN.BIN - Restore screen inline subroutine
SCROLL.BIN - Scroll inline subroutine
CALCATTR.BIN - Calculate Attribute inline subroutine
RECOLOR.BIN - Screen area recoloring inline subroutine
DEMO20.BAS - Demonstration program source code
TBWIND20.DOC - This document file.
Assembly language source code for all BIN files is included
for all those interested. Any suggestion for improvements to
the code would be appreciated, as I do not profess to be good
at Assembly Language.
USING TBWINDO
Include the TBWINDO.INC program in your program with
the following statement:
$INCLUDE "TBWINDO.INC"
Dimension the array for screen saves(see below).
Set the SNOCHK% variable (see below).
You invoke the routines by means of a CALL with a list of
parameters, rather than a GOSUB.
Using the MAKEWINDOW procedure:
CALL MAKEWINDOW(ROW%,COL%,ROWS%,COLS%,ATTR%,BRDRSEL%,SHADOW%,ZOOM%)
Where: ROW - the screen row of the upper left hand corner of your
desired window. Value should be between 2 and 23
(for reasons explained below). WARNING - the subroutines
doe not check for proper values. You must check these
yourself or accept the consequences.
COL - the screen column of the upper left hand corner. Value
should be between 2 and 79.
ROWS - the number of rows long the window should be.
COLS - the number of columns wide the window should be.
ATTR - the attribute of the window colors.
BRDRSEL - the border you desire around the window. Valid
selections in this release are:
0 - No Frame (just a border of BACKground
color.
1 - Single Line Frame
2 - Double Line Frame
3 - Single Horizontal Line, Double Vertical
Line Frame
4 - Single Vertical Line, Double Horizontal
Line Frame
SHADOW - Another "switch" to indicate if the window should
have a black "shadow" under it offset down and to
the left. This gives a three-dimensional effect
that seems to "raise" the window away from the
screen. A value of 1 indicates a shadow is desired
while a value of 0 means no shadow.
ZOOM - A "switch" used to indicate to the subroutine if
the window should "grow" from a small box at the
midpoints of the coordinates to full size. A value
of 1 indicates the window should grow. A value of
0 indicates it should not.
using the TITLEWINDOW procedure:
CALL TITLEWINDOW(LOC%,TITLE$)
Where: LOC - Indicates where the title should be placed. Valid
selections are:
1 - Top left hand corner
2 - Top center
3 - Top right hand corner
4 - Lower left hand corner
5 - Lower center
6 - Lower right hand corner
TITLE - The string data you would like printed.
NOTE: The TITLEWINDOW procedure uses the coordinates
from the most recent use of MAKEWINDOW. Use this
procedure only after a call has been made to
MAKEWINDOW.
Using the FNATTR% function:
FNATTR%(FORE%,BACK%)
Where: FORE - is the foreground color. Any Turbo Basic color
number is valid.
BACK - is the backgound color. Any Turbo Basic background
color number is valid.
FNATTR% returns the attribute of the colors specified.
Using the SAVESCRN procedure:
First you must define an integer array with a dimension
of 2000 (allowing for 4000 bytes) for each screen you store, early
in the program. If you plan on saving screens three deep then the
array must be 6000.
When making the call to SAVESCRN, you must pass the location of
this array as follows:
10 DIM SCRDATA%(2000)
.
80 SNOCHK%=0:'Test retrace (1 will not test retrace)
90 FIRST%=VARPTR(SCRDATA%(0))
100 CALL SAVESCRN(SNOCHK%,FIRST%)
Also, since the SAVESCRN operation 'loses' the position of the
cursor, you should preserve it prior to making the call if you
need it as follows:
90 OLDX=CSRLIN:OLDY=POS(0)
The RESTSCRN procedure is used in exactly the same way:
200 CALL RESTSCRN(SNOCHK%,FIRST%)
and if necessary, the cursor position can be restored by using
the following statement:
210 LOCATE OLDX,OLDY
Using the CALCATTR procedure:
CALL CALCATTR(FORE%,BACK%,ATTR%)
Where: FORE - Is the foreground color. Valid numbers are 0-31.
BACK - Is the background color. Valid numbers are 0-7.
ATTR - The attribute is returned in this variable.
CALL CALCATTR(15,1,ATTR%)
Y% = ATTR%
Using the RECOLOR procedure:
CALL RECOLOR(OLDATTR%,NEWATTR%,SNOCHK%)
Where: OLDATTR - Is the attribute of the areas on the screen
you wish to change.
NEWATTR - Is the attribute of the color you want.
SNOCHK - Snow checking switch.
X% = SCREEN(1,1,1) ' RETURNS CURRENT SCREEN ATTRIBUTE
CALL CALCATTR(14,4,ATTR%) ' CALCULATE NEW ATTRIBUTE
CALL RECOLOR(X%,ATTR%,SNOCHK%)
This will recolor everything on the screen that has
the same attribute a the upper left corner of the screen
to a foreground of 14 and a background of 4.
All of the above variables (with the exception of TITLE$) must
either be declared globally as integers by means of a DEFINT
statement early in the program; or must have the specific
integer identifier (%) attached wherever they appear in the
program. The BASIC compiler is picky about this; so be sure to
verify that the type assignment is correct.
TBWINDO requires no special handling when it comes to compiling
your program. Just make certain that all of your variables
passing parameters to the TBWINDO subroutine are identified as
integers, and you will be able to proceed with the compile
operation as with any other program.
ACKNOWLEDGEMENTS
I would like to express my thanks to Dave Evers (BASWIN22),
Tom Hanlin (ADVBAS33) and Jim LeMay (WINDOW33). The routines
presented are patterned after routines that were written by
them for MicroSoft Quick Basic and Borland Turbo Pascal.
Rick Fothergill
141 Oak Hill Road
Pittsfield, MA 01201
(413) 442-2456
GEnie Address: R.FOTHERGILL
Compuserve: 76210,443
TBWINDO QUICK REFERENCE
MakeWindow(Row%,Col%,Rows%,Cols%,Attr%,BrdrSel%,Shadow%,Zoom%)
TitleWindow(Loc%,Title$)
FNAttr%(Fore%,Back%)
SaveScrn(SnoChk%,VarPtr(Scrn%(??)))
RestScrn(SnoChk%,VarPtr(Scrn%(??)))
ReColor(OldAttr%,NewAttr%,SnoChk%)
CalcAttr(Fore%,Back%,Attr%)
Scroll(ULRow%,ULCol%,LRRow%,LRCol%,Rows%,Dir%)
Qprint(Row%,Col%,StrDat$,SnoChk%,Attr%)
QprintC(Row%,ColLeft%,ColRight%,StrDat$,SnoChk%,Attr%)
QFill(Row%,Col%,Rows%,Cols%,Char%,SnoChk%,Attr%)
QAttr(Row%,Col%,Rows%,Cols%,SnoChk%,Attr%)
QBox(Row%,Col%,Rows%,Cols%,Attr%,BrdrSel%)