home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
utils
/
miscutil.zip
/
TBWINDOW.ZIP
/
DEMO20.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-07-27
|
10KB
|
318 lines
'Demonstration of TBWINDO
$INCLUDE "TBWINDO.INC"
key off
':color 7,1:cls
'Dimension array for screen saving
dim scrn%(6000)
'Tell TBWINDO whether to check for snow or not
SNOCHK%=1 '0=YES 1=NO
'Put up opening screen
'4 windows of different colors and a Title Window
call qfill(1,1,25,80,asc(" "),snochk%,fnattr%(7,1))
call makewindow(4,15,10,30,fnattr%(4,3),4,1,0)
call makewindow(3,36,13,40,fnattr%(15,2),3,1,0)
call makewindow(9,10,13,40,fnattr%(0,5),2,1,0)
call makewindow(12,42,11,36,fnattr%(3,4),1,1,0)
call makewindow(8,20,7,40,fnattr%(0,7),2,1,0)
color 0,7:locate 11,35:print"Presenting...";
delay 4
call makewindow(8,20,7,40,fnattr%(0,7),2,1,0)
locate 9,26:print" T B W I N D O"
locate 10,26:print" 2.0
locate 12,26:print" Windowing Routines for the"
locate 13,26:print"Borland Turbo BASIC Compiler"
delay 3
call makewindow(17,55,7,24,fnattr%(0,6),1,1,0)
color 0,6
locate 18,57:print "By:"
locate 20,57:print " Rick Fothergill"
locate 21,57:print " 141 Oak Hill Road"
locate 22,57:print "Pittsfield, MA 01201"
delay 4
call makewindow(8,25,10,32,fnattr%(7,1),2,0,1)
color 15,1
locate 9,35:print "Including ..."
locate 11,30:print "*** Window Tools ***"
locate 13,28:print "A collection of routines"
locate 14,28:print "for integration into your"
locate 15,28:print "own programs.
delay 4
call makewindow(8,25,10,32,fnattr%(7,1),2,0,0)
locate 9,28:print " * * * * * * * * * * * * * "
locate 11,28:print "Stand by for a guided tour"
locate 13,28:print "through the many facets of"
locate 15,28:print "this exciting program."
call recolor(fnattr%(15,1),fnattr%(13,1),snochk%)
for a% = 0 to 14
for b% = 0 to 7
call recolor(fnattr%(a%,b%),fnattr%(a%+1,b%),snochk%)
next b%
next a%
delay 3
'cls
call qfill(1,1,25,80,asc(" "),snochk%,fnattr%(7,1))
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
color 0,7
locate 10,18:print "The basic purpose of TBWINDO is to provide"
locate 11,18:print "the fundamental routines for implementing"
locate 12,18:print "simple 'windowing' into your Turbo BASIC pro-"
locate 13,18:print "grams. With just a few simple statements,"
locate 14,18:print "you can 'pop-up' a colored window onto the"
locate 15,18:print "screen; just like this ..."
delay 3
call makewindow(1,47,7,30,fnattr%(15,4),1,0,0)
delay 3
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
locate 12,18:print"The window can be a solid panel of any of
locate 14,18:print"the BASIC background colors; such as ..."
delay 4
call makewindow(1,2,7,35,fnattr%(1,2),0,0,0)
delay 3
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
locate 12,18:print"or it can be surrounded by a 'frame' in any"
locate 13,18:print"of four styles..."
delay 3
call makewindow(5,5,8,35,fnattr%(9,5),1,0,0)
call titlewindow(1,"[ Frame Style 1 ]")
call makewindow(8,8,8,35,fnattr%(12,3),2,0,0)
call titlewindow(2,"[ Frame Style 2 ]")
call makewindow(11,11,8,35,fnattr%(15,4),3,0,0)
call titlewindow(3,"[ Frame Style 3 ]")
call makewindow(14,14,8,35,fnattr%(0,6),4,0,0)
call titlewindow(1,"[ Frame Style 4 ]")
delay 4
color 7,1
'cls
call qfill(1,1,25,80,asc(" "),snochk%,fnattr%(7,1))
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
color 0,7
locate 10,18:print "The frame itself can be in any one of the"
locate 11,18:print "BASIC foreground colors. It can even blink"
locate 12,18:print "if you want..."
delay 3
for i=0 to 15
clr%=i
label$="[ Color:"+str$(i)+" ]"
call makewindow(14,10,11,35,fnattr%(clr%,5),4,0,0)
call titlewindow(2,label$)
delay 1
next i
call makewindow(14,10,11,35,fnattr%(31,5),4,0,0)
call titlewindow(2,"[ Color: 31 ]")
delay 4
color 7,1
'cls
call qfill(1,1,25,80,asc(" "),snochk%,fnattr%(7,1))
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
color 0,7
locate 14,18:print "The window itself can be presented in many"
locate 15,18:print "different ways. It can be flat..."
delay 3
call makewindow(1,2,11,30,fnattr%(15,4),1,0,0)
delay 3
call makewindow(9,16,8,52,fnattr%(0,7),2,0,0)
locate 14,17:print "or it can have a black shadow underneath; giving"
locate 15,17:print "a three-dimensional effect..."
delay 3
call makewindow(1,38,11,30,fnattr%(15,5),2,1,0)
delay 3
color 7,1
'cls
call qfill(1,1,25,80,asc(" "),snochk%,fnattr%(7,1))
color 0,7
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
locate 12,18:print "For a particularly dramatic effect, the window"
locate 13,18:print "can 'grow' onto the screen..."
delay 3
call makewindow(7,10,12,63,fnattr%(15,4),2,1,1)
color 15,4
locate 12,37:print "W O W !!!
delay 3
color 0,7
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
locate 10,18:print "Once you have your window on the screen, simply"
locate 11,18:print "use LOCATE, COLOR, and PRINT statements to put"
locate 12,18:print "text in them. Another call with the same param-"
locate 13,18:print "eters as the first ...
delay 3
call makewindow(9,16,8,52,fnattr%(0,7),2,0,0)
locate 10,18:print "will erase the window for new text. But suppose"
locate 11,18:print "that instead of clearing the window, you would"
locate 12,18:print "rather SCROLL the data inside either up or down,"
locate 13,18:print "and put a new line of text on either the top or"
locate 14,18:print "bottom line; as the case might be..."
delay 3
call scroll(10,17,14,66,1,6)
locate 14,18:print" NEVER FEAR . . . "
delay 1
call scroll(10,17,14,66,1,6)
delay 1
call scroll(10,17,14,66,1,6)
locate 14,18:print" The SCROLL routine will do just that! You can"
delay 1
call scroll(10,17,14,66,1,6)
locate 14,18:print" scroll lines of text - "
delay 1
call scroll(10,17,14,66,1,6)
locate 14,18:print" UP"
delay 1
call scroll(10,17,14,66,1,6)
locate 14,18:print" UP"
delay 1
call scroll(10,17,14,66,1,6)
locate 14,18:print" UP"
delay 1
call scroll(10,17,14,66,1,7)
delay 1
call scroll(10,17,14,66,1,7)
delay 1
call scroll(10,17,14,66,1,7)
delay 1
call scroll(10,17,14,66,1,7)
locate 10,18:print" or DOWN"
delay 1
call scroll(10,17,14,66,1,7)
locate 10,18:print" DOWN"
delay 1
call scroll(10,17,14,66,1,7)
locate 10,18:print" DOWN"
delay 1
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
locate 10,18:print "Just as easily as you can create the window!"
locate 11,18:print "In fact, all of the commands of TBWINDO are"
locate 12,18:print "very easy to use. Here is a call to create"
locate 13,18:print "this window ..."
locate 15,18:print " CALL MAKEWINDOW(8,14,8,52,fnattr%(0,7),2,0,1)"
delay 5
call makewindow(9,16,8,52,fnattr%(0,7),2,0,0)
locate 11,18:print "And this is the call used to perform the SCROLL"
locate 12,18:print "operation ..."
locate 14,18:print " CALL SCROLL(9,15,16,65,1,6)
delay 3
call makewindow(9,16,8,52,fnattr%(0,7),2,0,0)
locate 10,18:print "An even simpler command allows you to save the"
locate 11,18:print "contents of the screen into an integer array;"
locate 12,18:print "so that you can place a window on the screen"
locate 13,18:print "and then quickly remove it; leaving the under-"
locate 14,18:print "lying information as it was. Here is a good"
locate 15,18:print "example . . ."
call savescrn(SNOCHK%,scrn%(0))
delay 5
call makewindow(3,5,15,45,fnattr%(0,2),4,1,1)
locate 9,10:color 0,2:print "This is the first level ..."
delay 2
call savescrn(SNOCHK%,scrn%(2000))
call makewindow(6,29,17,50,fnattr%(15,4),4,1,1)
locate 12,40:color 15,4:print "This is the second level ..."
delay 2
call savescrn(SNOCHK%,scrn%(4000))
call makewindow(9,22,15,35,fnattr%(12,3),4,1,1)
locate 16,24:color 12,0:print "This is the third level ..."
delay 2
locate 16,24:print "Now to go back ... "
delay 1
call restscrn(SNOCHK%,scrn%(4000))
delay 1
call restscrn(SNOCHK%,scrn%(2000))
delay 1
call restscrn(SNOCHK%,scrn%(0))
delay 2
'cls
call qfill(1,1,25,80,asc(" "),snochk%,fnattr%(7,1))
call makewindow(4,15,10,30,fnattr%(4,3),4,0,1)
call makewindow(3,36,13,40,fnattr%(15,2),3,0,1)
call makewindow(9,10,13,40,fnattr%(0,5),2,0,1)
call makewindow(12,42,11,36,fnattr%(3,4),1,0,1)
call makewindow(9,16,8,52,fnattr%(0,7),2,0,1)
color 0,7
locate 10,21:print"This was the original opening screen."
locate 11,21:print"You can selectively change the color"
locate 12,21:print"of an area simply by changing the"
locate 13,21:print"attribute."
delay 1
call recolor(fnattr%(4,3),fnattr%(6,2),snochk%)
delay 2
call recolor(fnattr%(0,5),fnattr%(14,5),snochk%)
delay 2
call recolor(fnattr%(15,2),fnattr%(14,6),snochk%)
delay 2
call recolor(fnattr%(0,7),fnattr%(15,1),snochk%)
delay 2
call recolor(fnattr%(15,1),fnattr%(0,7),snochk%)
delay 2
call makewindow(9,16,8,52,fnattr%(0,7),2,0,0)
locate 10,21:print "These are the commands required:"
locate 11,21:print" call calcattr(0,7,x%) 'old"
locate 12,21:print" call calcattr(15,1,y%) 'new"
locate 13,21:print" call recolor(x%,y%,snochk%)"
delay 4
color 7,1
'cls
call qfill(1,1,25,80,asc(" "),snochk%,fnattr%(7,1))
call makewindow(9,16,8,52,fnattr%(0,7),2,2,0)
locate 10,18:color 0,7:print "The basic routines in the TBWINDO package"
locate 11,18: print "give you all you need to create some power-"
locate 12,18: print "ful 'toolbox' modules to integrate into your"
locate 13,18: print "programs. But if you would rather not do all"
locate 14,18: print "the work yourselves, please see the accomp- "
locate 15,18: print "anying demo program DEMO.EXE ... "
delay 5
end