home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / tbwindow.zip / TBDEMO32.BAS < prev    next >
BASIC Source File  |  1987-09-29  |  9KB  |  344 lines

  1. 'Demonstration of TBWINDO
  2. $INCLUDE "TBWINDO.INC"
  3.  
  4. key off
  5. out &H3d9,1
  6. call qfill(1,1,25,80,32,fnattr(7,1))
  7. for m = 1 to 3
  8.   for i = 1 to 29
  9.     j = rnd(1)*69
  10.     k = rnd(1)*19
  11.     f = rnd(1)*14
  12.     b = rnd(1)*6
  13.     call makewindow(k+1,j+1,5,11,fnattr(f+1,b+1),2,0,0)
  14.     call prtcwindow(2,"WINDOW")
  15.   next
  16.   if (m = 3) then delay 3 else delay 1
  17.   for x = LI to 1 step -1
  18.   call removewindow
  19.   next
  20. next
  21. 'Put up opening screen
  22. '4 windows of different colors and a Title Window
  23. call makewindow(4,15,10,30,fnattr(4,3),4,1,1)
  24. call makewindow(3,36,13,40,fnattr(15,2),3,1,1)
  25. call makewindow(9,10,13,40,fnattr(0,5),2,1,1)
  26. call makewindow(12,42,11,36,fnattr(3,4),1,1,1)
  27.  
  28. call makewindow(3,5,7,40,fnattr(0,7),2,1,1)
  29.  
  30. call prtcwindow(3,"Presenting...")
  31. delay 4
  32. call makewindow(8,20,7,40,fnattr(0,7),2,1,1)
  33. call prtcwindow(1,"T B W I N D O")
  34. call prtcwindow(2,"3.2")
  35. call prtcwindow(4,"Windowing Routines for the")
  36. call prtcwindow(5,"Borland Turbo BASIC Compiler")
  37.  
  38. delay 3
  39. call makewindow(17,55,7,24,fnattr(0,6),1,1,1)
  40. call prtwindow(1,2,"By:")
  41. call prtcwindow(3,"Rick Fothergill")
  42. call prtcwindow(4,"141 Oak Hill Road")
  43. call prtcwindow(5,"Pittsfield, MA 01201")
  44.  
  45.  
  46. delay 4
  47.  
  48. call makewindow(5,5,10,32,fnattr(15,1),2,1,0)
  49.  
  50. call prtcwindow(1,"Including ...")
  51. call prtcwindow(3,"*** Window Tools ***")
  52. call prtcwindow(5,"A collection of routines")
  53. call prtcwindow(6,"for integration into your")
  54. call prtcwindow(7,"own programs.")
  55.  
  56. delay 4
  57. call makewindow(8,25,10,32,fnattr(15,1),2,1,0)
  58.  
  59. call prtwindow(1,2," * * * * * * * * * * * * * ")
  60. call prtwindow(3,2,"Stand by for a guided tour")
  61. call prtwindow(5,2,"through the many facets of")
  62. call prtwindow(7,2,"this exciting program.")
  63. delay 2
  64. for x = 1 to 9
  65. call removewindow
  66. next
  67. call makewindow(9,16,8,52,fnattr(0,7),2,0,0)
  68.  
  69.  
  70. call prtwindow(1,2,"The basic  purpose of TBWINDO is to provide")
  71. call prtwindow(2,2,"the  fundamental  routines for  implementing")
  72. call prtwindow(3,2,"simple 'windowing' into your Turbo BASIC pro-")
  73. call prtwindow(4,2,"grams.   With  just a few simple statements,")
  74. call prtwindow(5,2,"you can 'pop-up'  a colored  window onto the")
  75. call prtwindow(6,2,"screen; just like this ...")
  76.  
  77. delay 3
  78. call clearwindow
  79.  
  80. call prtwindow(2,2,"The window can be a solid panel of any of")
  81. call prtwindow(4,2,"the BASIC background colors; such as ...")
  82.  
  83. delay 4
  84.  
  85. call makewindow(2,2,7,35,fnattr(1,2),0,0,0)
  86.  
  87. delay 3
  88. call removewindow
  89. call clearwindow
  90.  
  91. call prtwindow(2,2,"or it can be surrounded by a 'frame' in any")
  92. call prtwindow(4,2,"of five styles...")
  93.  
  94. delay 3
  95.  
  96. call makewindow(5,5,8,35,fnattr(9,5),1,0,0)
  97. call titlewindow(1,"[ Frame Style 1 ]")
  98. call makewindow(8,8,8,35,fnattr(12,3),2,0,0)
  99. call titlewindow(2,"[ Frame Style 2 ]")
  100. call makewindow(11,11,8,35,fnattr(15,4),3,0,0)
  101. call titlewindow(3,"[ Frame Style 3 ]")
  102. call makewindow(14,14,8,35,fnattr(0,6),4,0,0)
  103. call titlewindow(1,"[ Frame Style 4 ]")
  104. call makewindow(17,17,8,35,fnattr(0,2),5,0,0)
  105. call titlewindow(3,"[ Frame Style 5 ]")
  106.  
  107. delay 4
  108. for x = 1 to 5
  109. call removewindow
  110. next
  111. call clearwindow
  112.  
  113. call prtwindow(1,2,"The frame itself can be in any one of the")
  114. call prtwindow(2,2,"BASIC foreground colors. It can even blink")
  115. call prtwindow(3,2,"if you want...")
  116.  
  117. delay 3
  118. for i=0 to 15
  119.   label$="[ Color:"+str$(i)+" ]"
  120.   j=rnd(1)*50
  121.   k=rnd(1)*12
  122.   call makewindow(k+1,j+1,7,25,fnattr(i,5),4,2,0)
  123.   call titlewindow(2,label$)
  124.   delay .5
  125. next
  126. call makewindow(7,20,7,25,fnattr(31,5),4,2,0)
  127. call titlewindow(2,"[ Color: 31 ]")
  128.  
  129. delay 4
  130. for x = 1 to 17
  131. call removewindow
  132. next
  133.  
  134. call clearwindow
  135. call prtcwindow(5,"The window itself can be presented in many")
  136. call prtcwindow(6,"different ways. It can be flat...")
  137.  
  138. delay 3
  139.  
  140. call makewindow(1,2,11,30,fnattr(15,4),1,0,0)
  141.  
  142. delay 3
  143. call removewindow
  144. call clearwindow
  145. call prtcwindow(5,"or it can have a black shadow underneath; giving")
  146. call prtcwindow(6,"a three-dimensional effect...")
  147. delay 3
  148. call makewindow(5,5,10,30,fnattr(14,5),2,1,0)
  149. call qprintc(7,5,35,"Left Shadow",fnattr(15,5))
  150. delay 2
  151. call makewindow(5,40,10,30,fnattr(0,2),2,2,0)
  152. call qprintc(7,40,70,"Right Shadow",fnattr(15,2))
  153. delay 2
  154. call removewindow
  155. call removewindow
  156. call clearwindow
  157. call prtcwindow(2,"Titles may be placed in any")
  158. call prtcwindow(3,"of six different locations,")
  159. call prtcwindow(4,"or any combination.")
  160. delay 2
  161. call makewindow(2,5,10,70,fnattr(15,5),2,1,0)
  162. for x = 1 to 6
  163.   title$ = "[ Location"+str$(x)+" ]"
  164.   call titlewindow(x,title$)
  165.   delay 1
  166. next
  167. delay 3
  168. call removewindow
  169. call clearwindow
  170. call prtcwindow(3,"Windows can be zoomed")
  171. call prtcwindow(4,"onto the screen.")
  172. delay 2
  173. call makewindow(2,2,15,60,fnattr(0,2),2,0,1)
  174. delay 2
  175. call makewindow(13,10,10,60,fnattr(1,3),3,0,1)
  176. delay 2
  177. call makewindow(7,33,10,45,fnattr(14,5),1,0,1)
  178. delay 2
  179. call makewindow(7,10,12,63,fnattr(15,4),2,1,1)
  180. call prtcwindow(5,"W O W !!!")
  181. delay 3
  182. for x = 1 to 4
  183. call removewindow
  184. next
  185. call clearwindow
  186. call prtwindow(1,2,"Once you have your window on the screen, simply")
  187. call prtwindow(2,2,"use calls to PrtWindow or PrtCWindow to put text")
  188. call prtwindow(3,2,"in them.  A call to ClearWindow will erase the")
  189. call prtwindow(4,2,"contents of the window ...   ")
  190. delay 3
  191.  
  192.  
  193. call clearwindow
  194. call prtwindow(1,2,"Just as easily as you can create the window!")
  195. call prtwindow(2,2,"In fact, all of the commands of TBWINDO are")
  196. call prtwindow(3,2,"very  easy to use.  Here is a call to create")
  197. call prtwindow(4,2,"this window ...")
  198. call prtwindow(5,2,"   CALL MAKEWINDOW(8,14,8,52,fnattr(0,7),2,0,1)")
  199. delay 5
  200.  
  201. call clearwindow
  202.  
  203. call prtwindow(1,2,"Each window is stored as a result of a call to")
  204. call prtwindow(2,2,"MakeWindow.  To restore the screen to it's")
  205. call prtwindow(3,2,"original contents, simply call RemoveWindow.")
  206. call prtwindow(4,2,"Here is a good example . . .")
  207. delay 5
  208. call makewindow(3,5,15,45,fnattr(0,2),4,1,1)
  209. call prtcwindow(6,"This is the first level ...")
  210. delay 2
  211. call makewindow(6,29,17,50,fnattr(15,4),4,1,1)
  212. call prtcwindow(6,"This is the second level ...")
  213. delay 2
  214. call makewindow(9,22,15,35,fnattr(0,3),4,1,1)
  215. call prtcwindow(7,"This is the third level ...")
  216. delay 2
  217. call prtcwindow(7,"Now to go back ...           ")
  218. delay 1
  219. call removewindow
  220. delay 1
  221. call removewindow
  222. delay 1
  223. call removewindow
  224. delay 2
  225. call clearwindow
  226. call prtwindow(2,2,"Next is a demonstration of the MakeMenu")
  227. call prtwindow(3,2,"procedure which will create a point and")
  228. call prtwindow(4,2,"shoot type menu.")
  229. delay 3
  230. call removewindow
  231.  
  232. out &H03d9,7
  233. call qfill(1,1,25,80,32,fnattr(0,7))
  234. call mainmenu
  235. out &H03d9,0
  236.  
  237. sub mainmenu
  238. shared item$(),itemcount,startpos
  239. shared curntpos,done
  240. done = 0
  241. curntpos = 0
  242. call makewindow(5,20,7,40,fnattr%(15,1),2,2,0)
  243. call titlewindow(2,"[ MAIN MENU ]")
  244. while not done
  245.   oldcurntpos = curntpos
  246.   item$(1) = "Pop Screen 1"
  247.   item$(2) = "Pop Screen 2"
  248.   item$(3) = "Pop Screen 3"
  249.   item$(4) = "Second Menu Demo"
  250.   item$(5) = "Exit"
  251.   itemcount = 5
  252.   startpos = 1
  253.   call makemenu
  254.   select case curntpos
  255.     case 1 'screen 1
  256.       call popscreen1
  257.     case 2 ' screen 2
  258.       call popscreen2
  259.     case 3 ' screen 3
  260.       call popscreen3
  261.     case 4 ' second menu
  262.       call secondmenu
  263.     case else
  264.       call removewindow
  265.       curntpos = oldcurntpos
  266.       out &H03d9,1
  267.       call qfill(1,1,25,80,32,fnattr(15,1))
  268.       color 0,7
  269.       call makewindow(9,16,8,52,fnattr(0,7),2,0,0)
  270.       locate 10,18:print "Please see the source code and documentation"
  271.       locate 11,18:print "for how to create and use menu windows in"
  272.       locate 12,18:print "your programs...."
  273.       delay 5
  274.       done = -1
  275.     end select
  276. wend 'done
  277. call removewindow
  278. end sub
  279.  
  280. sub popscreen1
  281. call makewindow(8,10,7,60,fnattr(0,6),2,1,1)
  282. call titlewindow(2,"[ SELECTION 1 ]")
  283. call qprintc(10,10,70,"This is selection no. 1",fnattr(0,6))
  284. call qprintc(11,10,70,"Press enter to return to main menu...",fnattr(15,6))
  285. while not instat
  286. wend
  287. a$=inkey$
  288. call removewindow
  289. end sub
  290.  
  291. sub popscreen2
  292. call makewindow(8,10,7,60,fnattr(0,3),2,1,1)
  293. call titlewindow(2,"[ SELECTION 2 ]")
  294. call qprintc(10,10,70,"This is selection no. 2",fnattr(0,3))
  295. call qprintc(11,10,70,"Press enter to return to main menu...",fnattr(0,3))
  296. while not instat
  297. wend
  298. a$=inkey$
  299. call removewindow
  300. end sub
  301.  
  302. sub popscreen3
  303. call makewindow(8,10,7,60,fnattr(14,5),2,1,1)
  304. call titlewindow(2,"[ SELECTION 3 ]")
  305. call qprintc(10,10,70,"This is selection no. 3",fnattr(14,5))
  306. call qprintc(11,10,70,"Press enter to return to main menu...",fnattr(14,5))
  307. while not instat
  308. wend
  309. a$=inkey$
  310. call removewindow
  311. end sub
  312.  
  313. sub secondmenu
  314. shared item$(),itemcount,startpos
  315. shared curntpos,done
  316. call makewindow(7,25,6,40,fnattr%(14,2),2,2,0)
  317. call titlewindow(2,"[ SECOND MENU DEMO ]")
  318. done = 0
  319. oldcurntpos = curntpos
  320. curntpos = 0
  321. while not done
  322.   item$(1) = "Pop Screen 1"
  323.   item$(2) = "Pop Screen 2"
  324.   item$(3) = "Pop Screen 3"
  325.   item$(4) = "Exit"
  326.   itemcount = 4
  327.   startpos = 3
  328.   call makemenu
  329.   select case curntpos
  330.     case 1 'screen 1
  331.       call popscreen1
  332.     case 2 ' screen 2
  333.       call popscreen2
  334.     case 3 ' screen 3
  335.       call popscreen3
  336.     case else
  337.       call removewindow
  338.       curntpos = oldcurntpos
  339.       done = -1
  340.   end select
  341. wend 'done
  342. done = 0
  343. end sub
  344.