home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / progbas / baswind4.arj / BASWIN22.ZIP / DEMO1.BAS next >
BASIC Source File  |  1987-01-28  |  12KB  |  260 lines

  1.                  'Demo of BASWIND2 modules and BWTOOLS
  2.  
  3.                  key off:color 7,1:cls
  4.                  dim scrn%(6000)
  5.          'Put up opening screen
  6.                  '4 windows of different colors and a Title Window
  7.  
  8.                  call makewind(5,15,13,45,4,4,3,0,1,"")
  9.                  call makewind(4,36,15,75,3,15,2,0,1,"")
  10.                  call makewind(10,10,21,50,2,0,5,0,1,"")
  11.                  call makewind(13,42,22,78,1,3,12,0,1,"")
  12.  
  13.                  call makewind(9,20,14,60,2,0,7,0,1,"")
  14.  
  15.                  color 0,7:locate 11,35:print"Presenting...";
  16.                  seconds=4:gosub waitsec
  17.  
  18.                  call makewind(9,20,14,60,0,0,7,0,0,"")
  19.                  call makewind(9,20,14,60,2,0,7,1,0,"")
  20.                  locate 10,33:print "B A S W I N D 2"
  21.                  locate 12,28:print"Windowing Routines for the"
  22.                  locate 13,26:print"Microsoft QuickBASIC Compiler"
  23.  
  24.                  seconds=3:gosub waitsec
  25.  
  26.                  call makewind(15,55,19,75,1,0,6,0,1,"")
  27.                  color 0,6
  28.                  locate 15,65:print "By"
  29.                  locate 17,61:print "Dave Evers"
  30.                  locate 18,57:print "2500 Larch Rd. #58"
  31.                  locate 19,57:print "Quincy, IL  62301"
  32.  
  33.                  seconds=4:gosub waitsec
  34.  
  35.                  call makewind(8,25,15,55,2,7,1,1,0,"")
  36.  
  37.                  color 15,1
  38.                  locate 8,35:print "Including ..."
  39.                  locate 10,30:print "*** Window Tools ***"
  40.                  locate 12,28:print "A collection of routines"
  41.                  locate 13,28:print "for integration into your"
  42.                  locate 14,28:print "own programs.
  43.  
  44.                  seconds=4:gosub waitsec
  45.  
  46.                  call makewind(8,25,15,55,2,7,1,0,0,"")
  47.  
  48.                  locate 8,25:print  "   * * * * * * * * * * * * * "
  49.                  locate 10,28:print "Stand by for a guided tour"
  50.                  locate 12,28:print "through the many facets of"
  51.                  locate 14,28:print "this exciting program."
  52.  
  53.                  seconds=3:gosub waitsec
  54.  
  55.                  cls
  56.  
  57.                  call makewind(9,15,16,65,2,0,7,0,1,"")
  58.  
  59.                  color 0,7
  60.  
  61.                  locate 10,18:print "The basic  purpose of BASWIND2 is to provide"
  62.                  locate 11,18:print "the  fundamental  routines for  implementing"
  63.                  locate 12,18:print "simple 'windowing' into your QuickBASIC pro-"
  64.                  locate 13,18:print "grams.   With  just a few simple statements,"
  65.                  locate 14,18:print "you can 'pop-up'  a colored  window onto the"
  66.                  locate 15,18:print "screen; just like this ..."
  67.  
  68.                  seconds=3:gosub waitsec
  69.  
  70.                  call makewind(3,50,8,79,1,15,4,0,0,"")
  71.  
  72.                  seconds=3:gosub waitsec
  73.  
  74.                  call makewind(9,15,16,65,2,0,7,0,0,"")
  75.  
  76.                  locate 12,18:print"The window can be a solid panel of any of
  77.                  locate 14,18:print"the BASIC background colors; such as ..."
  78.  
  79.                  seconds=4:gosub waitsec
  80.  
  81.                  call makewind(2,3,8,35,0,1,2,0,0,"")
  82.  
  83.                  seconds=3:gosub waitsec
  84.  
  85.                  call makewind(9,15,16,65,2,0,7,0,0,"")
  86.  
  87.                  locate 12,18:print"or it can be surrounded by a 'frame' in any"
  88.                  locate 13,18:print"of four styles..."
  89.  
  90.                  seconds=3:gosub waitsec
  91.  
  92.                  call makewind(5,6,11,37,1,9,5,0,0,"Frame Style 1")
  93.                  call makewind(8,9,14,40,2,12,3,0,0,"Frame Style 2")
  94.                  call makewind(11,12,17,43,3,15,4,0,0,"Frame Style 3")
  95.                  call makewind(14,15,20,46,4,0,6,0,0,"Frame Style 4")
  96.  
  97.                  seconds=3:gosub waitsec
  98.  
  99.                  color 7,1
  100.                  cls
  101.                  call makewind(9,15,16,65,2,0,7,0,1,"")
  102.  
  103.                  color 0,7
  104.                  locate 10,18:print "The frame itself can be in any one of the"
  105.                  locate 11,18:print "BASIC foreground colors. It can even blink"
  106.                  locate 12,18:print "if you want..."
  107.  
  108.                  seconds=3:gosub waitsec
  109.                  for i=0 to 15
  110.                      clr%=i
  111.                      label$="Color:"+str$(i)
  112.  
  113.                      call makewind(15,10,23,45,4,clr%,5,0,0,label$)
  114.                      seconds=.5:gosub waitsec
  115.                  next i
  116.                  call makewind(15,10,23,45,4,127,5,0,0,"Color: 127")
  117.  
  118.                  seconds=4:gosub waitsec
  119.  
  120.                  color 7,1
  121.                  cls
  122.  
  123.                  call makewind(9,15,16,65,2,0,7,0,1,"")
  124.                  color 0,7
  125.                  locate 14,18:print "The window itself can be presented in many"
  126.                  locate 15,18:print "different ways. It can be flat..."
  127.  
  128.                  seconds=3:gosub waitsec
  129.  
  130.                  call makewind(2,2,11,32,1,15,4,0,0,"")
  131.  
  132.                  seconds=3:gosub waitsec
  133.  
  134.                  call makewind(9,15,16,65,2,0,7,0,0,"")
  135.                  locate 14,17:print "or it can have a black shadow underneath; giving"
  136.                  locate 15,17:print "a three-dimensional effect..."
  137.                  seconds=3:gosub waitsec
  138.                  call makewind(2,35,11,55,2,15,5,0,1,"")
  139.  
  140.                  seconds=3:gosub waitsec
  141.  
  142.                  color 7,1
  143.                  cls
  144.                  color 0,7
  145.  
  146.                  call makewind(9,15,16,65,2,0,7,0,1,"")
  147.                  locate 12,18:print "For a particularly dramatic effect, the window"
  148.                  locate 13,18:print "can 'grow' onto the screen..."
  149.  
  150.                  seconds=3:gosub waitsec
  151.                  call makewind(8,10,17,70,2,15,4,1,0,"")
  152.                  color 15,4
  153.                  locate 12,37:print "W O W !!!
  154.                  seconds=3:gosub waitsec
  155.  
  156.                  color 0,7
  157.                  call makewind(9,15,16,65,2,0,7,0,1,"")
  158.                  locate 10,18:print "Once you have your window on the screen, simply"
  159.                  locate 11,18:print "use LOCATE, COLOR,  and PRINT statements to put"
  160.                  locate 12,18:print "text in them. Another call with the same param-"
  161.                  locate 13,18:print "eters as the first ...
  162.                  seconds=3:gosub waitsec
  163.                  call makewind(9,15,16,65,2,0,7,0,0,"")
  164.                  locate 10,18:print "will erase the window for new text. But suppose"
  165.                  locate 11,18:print "that instead of clearing the window,  you would"
  166.                  locate 12,18:print "rather SCROLL the data inside either up or down,"
  167.                  locate 13,18:print "and put a new line of text on either the top or"
  168.                  locate 14,18:print "bottom line; as the case might be..."
  169.                  seconds=3:gosub waitsec
  170.  
  171.                  call scroll(9,15,16,65,1,1,"   NEVER FEAR . . .  ")
  172.                  seconds=1:gosub waitsec
  173.                  call scroll(9,15,16,65,1,1,"")
  174.                  seconds=1:gosub waitsec
  175.                  call scroll(9,15,16,65,1,1,"   The SCROLL routine will do just that!  You can")
  176.                  seconds=1:gosub waitsec
  177.                  call scroll(9,15,16,65,1,1,"   scroll lines of text  -  ")
  178.                  seconds=1:gosub waitsec
  179.                  call scroll(9,15,16,65,1,1,"                            UP")
  180.                  seconds=1:gosub waitsec
  181.                  call scroll(9,15,16,65,1,1,"                            UP")
  182.                  seconds=1:gosub waitsec
  183.                  call scroll(9,15,16,65,1,1,"                            UP")
  184.                  seconds=1:gosub waitsec
  185.                  call scroll(9,15,16,65,1,-1,"")
  186.                  seconds =1:gosub waitsec
  187.                  call scroll(9,15,16,65,1,-1,"")
  188.                  seconds=1:gosub waitsec
  189.                  call scroll(9,15,16,65,1,-1,"")
  190.                  seconds=1:gosub waitsec
  191.                  call scroll(9,15,16,65,1,-1,"                      or  DOWN")
  192.                  seconds=1:gosub waitsec
  193.                  call scroll(9,15,16,65,1,-1,"                          DOWN")
  194.                  seconds=1:gosub waitsec
  195.                  call scroll(9,15,16,65,1,-1,"                          DOWN")
  196.                  seconds=1:gosub waitsec
  197.                  call makewind(9,15,16,65,2,0,7,1,0,"")
  198.                  locate 10,18:print "just as easily as you can create the window!"
  199.                  locate 11,18:print "In fact, all of the commands of BASWIND2 are"
  200.                  locate 12,18:print "very  easy to use.  Here is a call to create"
  201.                  locate 13,18:print "this window ..."
  202.                  locate 15,18:print "   CALL MAKEWIND(9,15,16,65,2,0,7,0,1,'')"
  203.                  seconds=4:gosub waitsec
  204.                  call makewind(9,15,16,65,2,0,7,0,0,"")
  205.                  locate 11,18:print "And this is the call used to perform the SCROLL"
  206.                  locate 12,18:print "operation ..."
  207.                  locate 14,18:print "       CALL SCROLL(9,15,16,65,1,1,'')
  208.                  seconds=3:gosub waitsec
  209. here:            clear
  210.                  call makewind(9,15,16,65,2,0,7,0,0,"")
  211.                  locate 10,18:print "An even simpler command allows you to save the"
  212.                  locate 11,18:print "contents of the screen  into an integer array;"
  213.                  locate 12,18:print "so that  you can place a window  on the screen"
  214.                  locate 13,18:print "and then quickly remove it; leaving the under-"
  215.                  locate 14,18:print "lying  information as it was.  Here is  a good"
  216.                  locate 15,18:print "example . . ."
  217.          where%=varptr(scrn%(0))
  218.          call savescrn(1,where%)
  219.                  seconds=3:gosub waitsec
  220.                  call makewind(4,4,13,42,4,0,2,0,1,"")
  221.                  locate 9,10:color 0,2:print "This is the first level ..."
  222.                  seconds=2:gosub waitsec
  223.          where%=varptr(scrn%(2000))
  224.          call savescrn(1,where%)
  225.                  call makewind(7,30,18,79,4,15,4,0,1,"")
  226.                  locate 12,40:color 15,4:print "This is the second level ..."
  227.                  seconds=2:gosub waitsec
  228.          where%=varptr(scrn%(4000))
  229.          call savescrn(1,where%)
  230.                  call  makewind(10,25,22,55,4,12,3,0,1,"")
  231.                  locate 16,27:color 12,0:print "This is the third level ..."
  232.                  seconds=2:gosub waitsec
  233.                  locate 16,27:print "Now to go back ...           "
  234.                  seconds=2:gosub waitsec
  235.          where%=varptr(scrn%(4000))
  236.          call restscrn(1,where%)
  237.                  seconds=1:gosub waitsec
  238.          where%=varptr(scrn%(2000))
  239.          call restscrn(1,where%)
  240.                  seconds=1:gosub waitsec
  241.          where%=varptr(scrn%(0))
  242.          call restscrn(1,where%)
  243.                  seconds=1:gosub waitsec
  244.                  call makewind(9,15,16,65,2,0,7,0,0,"")
  245.                  locate 9,18:color 0,7:print "The basic routines in the  BASWIND2  package"
  246.                  locate 10,18:          print "give you all you  need to create some power-"
  247.                  locate 11,18:          print "ful 'toolbox' modules to integrate into your"
  248.                  locate 12,18:          print "programs. But if you would rather not do all"
  249.          locate 13,18:          print "the work yourselves, please see the accomp- "
  250.          locate 14,18:          print "anying demo program DEMO2.EXE ...           "
  251.                  seconds=5:gosub waitsec
  252.  
  253.                  end
  254.  
  255. waitsec:         begintime=timer
  256.                  while endtime < begintime+seconds
  257.                  endtime=timer
  258.                  wend
  259.                  return
  260.