home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / tb / tbwindo / tbd60.bas next >
BASIC Source File  |  1988-04-29  |  12KB  |  346 lines

  1. $INCLUDE "tbw60.def"
  2.  
  3.  WIDTH(40)
  4.  CALL Tbwborder(7)
  5.  CALL Tbwfill(1,1,25,40,32,FNAttr(0,7))
  6.  
  7.  CALL Makewindow(2,4,7,15,FNAttr(0,2),FNAttr(10,2),2,FNAttr(8,0),7,1)
  8.  CALL Tbwprint(5,9,"T",FNAttr(15,2))
  9.  CALL Tbwprint(5,10,"URBO",FNAttr(10,2))
  10.  DELAY(2)
  11.  CALL Makewindow(7,10,7,15,FNAttr(15,4),FNAttr(12,4),2,FNAttr(8,0),7,1)
  12.  CALL Tbwprint(10,15,"B",FNAttr(15,4))
  13.  CALL Tbwprint(10,16,"ASIC",FNAttr(12,4))
  14.  DELAY(2)
  15.  CALL Makewindow(12,16,7,15,FNAttr(0,3),FNAttr(11,3),2,FNAttr(8,0),7,1)
  16.  CALL Tbwprint(15,20,"W",FNAttr(15,3))
  17.  CALL Tbwprint(15,21,"INDOWS",FNAttr(11,3))
  18.  DELAY(2)
  19.  CALL Makewindow(17,22,7,15,FNAttr(15,1),FNAttr(9,1),2,FNAttr(8,0),7,1)
  20.  CALL Prtcwindow(3,"6.0")
  21.  DELAY(4)
  22.  CALL Removewindow
  23.  DELAY(1)
  24.  CALL Removewindow
  25.  DELAY(1)
  26.  CALL Removewindow
  27.  DELAY(1)
  28.  CALL Removewindow
  29.  WIDTH(80)
  30.  CALL Tbwborder(1)
  31.  CALL Tbwfill(1,1,25,80,32,FNAttr(7,1))
  32.  CALL Makewindow(4,15,10,30,FNAttr(4,3),FNAttr(4,3),4,FNAttr(8,0),1,1)
  33.  CALL Makewindow(3,36,13,40,FNAttr(15,2),FNAttr(15,2),3,FNAttr(8,0),1,1)
  34.  CALL Makewindow(9,10,13,40,FNAttr(0,5),FNAttr(0,5),2,FNAttr(8,0),1,1)
  35.  CALL Makewindow(12,42,11,36,FNAttr(3,4),FNAttr(3,4),1,FNAttr(8,0),1,1)
  36.  CALL Makewindow(3,5,7,40,FNAttr(0,7),FNAttr(1,7),2,FNAttr(8,0),1,1)
  37.  CALL Prtcwindow(3,"Presenting...")
  38.  DELAY(4)
  39.  CALL Makewindow(8,20,7,40,FNAttr(0,7),FNAttr(1,7),2,FNAttr(8,0),1,1)
  40.  CALL Prtcwindow(1,"T B W")
  41.  CALL Prtcwindow(2,"6.0")
  42.  CALL Prtcwindow(4,"Windowing Routines for the")
  43.  CALL Prtcwindow(5,"Borland Turbo BASIC Compiler")
  44.  DELAY(3)
  45.  CALL Makewindow(17,55,7,24,FNAttr(0,2),FNAttr(10,2),1,FNAttr(8,0),1,1)
  46.  CALL Prtwindow(1,2,"By:")
  47.  CALL Prtcwindow(3,"Rick Fothergill")
  48.  CALL Prtcwindow(4,"141 Oak Hill Road")
  49.  CALL Prtcwindow(5,"Pittsfield, MA 01201")
  50.  DELAY(4)
  51.  FOR x = 1 TO 7
  52.      CALL Removewindow
  53.  NEXT
  54.  CALL Tbwfill(1,1,25,80,32,FNAttr(0,7))
  55.  CALL Tbwborder(7)
  56.  done = 0
  57.  CALL Makebox(2,40,3,35,FNAttr(11,4),FNAttr(12,4),3,0,0,0)
  58.  CALL Tbwprintc(3,41,75,"TBW60 Demo",FNAttr(15,4))
  59.  CALL Makewindow(3,5,8,15,FNAttr(15,1),FNAttr(15,1),2,FNAttr(8,7),7,0)
  60.  CALL Titlewindow(2,FNAttr(15,1),"[ MAIN MENU ]")
  61.  curntpos = 0
  62.  WHILE NOT done
  63.        item$(1) = "Frames "
  64.        item$(2) = "Titles "
  65.        item$(3) = "Shadows"
  66.        item$(4) = "Effects"
  67.        item$(5) = "Menus  "
  68.        item$(6) = "Quit   "
  69.        itemcount = 6
  70.        startpos = 1
  71.        hlattr  = FNAttr(15,1)
  72.        flattr  = FNAttr(14,1)
  73.        flon = -1
  74.        bartype = 3
  75.        CALL Makemenu
  76.        SELECT CASE curntpos
  77.               CASE 1
  78.                    CALL Fdemo
  79.               CASE 2
  80.                    CALL Tdemo
  81.               CASE 3
  82.                    CALL Sdemo
  83.               CASE 4
  84.                    CALL Edemo
  85.               CASE 5
  86.                    CALL Mdemo
  87.               CASE ELSE
  88.                    CALL Removewindow
  89.                    curntpos = oldcurntpos
  90.                    CALL Tbwborder(1)
  91.                    CALL Tbwfill(1,1,43,80,32,FNAttr(15,1))
  92.                    CALL Makewindow(9,16,8,52,FNAttr(0,7),FNAttr(1,7),2,0,0,0)
  93.                    CALL Prtcwindow(3,"T B W")
  94.                    CALL Prtcwindow(4,"6.0")
  95.                    DELAY(3)
  96.                    CALL Removewindow
  97.                    done = -1
  98.        END SELECT
  99.  WEND
  100.  CALL Tbwborder(0)
  101.  CLS
  102.  
  103. SUB Fdemo
  104.  CALL Makewindow(4,6,6,25,FNAttr(15,3),FNAttr(15,3),1,0,0,0)
  105.  CALL Titlewindow(1,FNAttr(14,3),"[ Frame Style 1 ]")
  106.  CALL Makewindow(6,10,6,25,FNAttr(15,5),FNAttr(15,5),2,0,0,0)
  107.  CALL Titlewindow(2,FNAttr(14,5),"[ Frame Style 2 ]")
  108.  CALL Makewindow(8,14,6,25,FNAttr(15,4),FNAttr(15,4),3,0,0,0)
  109.  CALL Titlewindow(3,FNAttr(14,4),"[ Frame Style 3 ]")
  110.  CALL Makewindow(10,18,6,25,FNAttr(15,6),FNAttr(15,6),4,0,0,0)
  111.  CALL Titlewindow(1,FNAttr(14,6),"[ Frame Style 4 ]")
  112.  CALL Makewindow(12,22,6,25,FNAttr(15,2),FNAttr(15,2),5,0,0,0)
  113.  CALL Titlewindow(3,FNAttr(14,2),"[ Frame Style 5 ]")
  114.  CALL Makewindow(14,26,6,25,FNAttr(15,3),FNAttr(15,3),6,0,0,0)
  115.  CALL Titlewindow(1,FNAttr(14,3),"[ Frame Style 6 ]")
  116.  CALL Makewindow(16,30,6,25,FNAttr(15,5),FNAttr(15,5),7,0,0,0)
  117.  CALL Titlewindow(2,FNAttr(14,5),"[ Frame Style 7 ]")
  118.  CALL Makewindow(18,34,6,25,FNAttr(15,4),FNAttr(15,4),8,0,0,0)
  119.  CALL Titlewindow(3,FNAttr(14,4),"[ Frame Style 8 ]")
  120.  CALL Makewindow(6,44,3,30,FNAttr(15,2),FNAttr(0,2),2,FNAttr(8,7),7,0)
  121.  CALL Prtwindow(1,2,"Press and key to return...")
  122.  WHILE NOT INSTAT
  123.  WEND
  124.  a$ = INKEY$
  125.  FOR x = 1 TO 9
  126.      CALL Removewindow
  127.  NEXT
  128. END SUB
  129.  
  130. SUB Tdemo
  131.  CALL Makewindow(13,5,10,70,FNAttr(15,5),FNAttr(15,5),2,FNAttr(8,7),7,0)
  132.  CALL Prtcwindow(5,"Titles may be placed in any of six different locations.")
  133.  FOR x=1 TO 6
  134.      msg$ = STR$(x)
  135.      msg$ = "[ LOCATION "+msg$+" ]"
  136.      CALL Titlewindow(x,FNAttr(11,5),msg$)
  137.      DELAY(1)
  138.  NEXT
  139.  CALL Makewindow(6,44,3,30,FNAttr(15,2),FNAttr(0,2),2,FNAttr(8,7),7,0)
  140.  CALL Prtwindow(1,2,"Press and key to return...")
  141.  WHILE NOT INSTAT
  142.  WEND
  143.  a$ = INKEY$
  144.  CALL Removewindow
  145.  CALL Removewindow
  146. END SUB
  147.  
  148. SUB Sdemo
  149.  CALL Makewindow(13,5,10,70,FNAttr(15,5),FNAttr(15,5),2,FNAttr(8,7),7,0)
  150.  CALL Prtcwindow(5,"The window itself can be presented in many")
  151.  CALL Prtcwindow(6,"different ways. It can be flat...")
  152.  DELAY(3)
  153.  CALL Makewindow(7,10,10,30,FNAttr(15,3),FNAttr(0,3),1,0,0,0)
  154.  CALL Makewindow(7,45,10,30,FNAttr(15,2),FNAttr(0,2),1,0,0,0)
  155.  DELAY(3)
  156.  CALL Removewindow
  157.  CALL Removewindow
  158.  CALL Clearwindow
  159.  CALL Prtcwindow(4,"it can have one of many types of shadow underneath")
  160.  CALL Prtcwindow(6,"this is SOLID black - type 3 left and 4 right")
  161.  DELAY(3)
  162.  CALL Makewindow(7,10,10,30,FNAttr(15,3),FNAttr(0,3),2,0,3,0)
  163.  CALL Prtcwindow(7,"Left Shadow")
  164.  DELAY(2)
  165.  CALL Makewindow(7,45,10,30,FNAttr(15,2),FNAttr(0,2),2,0,4,0)
  166.  CALL Prtcwindow(7,"Right Shadow")
  167.  DELAY(2)
  168.  CALL Removewindow
  169.  CALL Removewindow
  170.  CALL Clearwindow
  171.  CALL Prtcwindow(6,"this is SHADOW black - type 1 left and 2 right")
  172.  DELAY(3)
  173.  CALL Makewindow(7,10,10,30,FNAttr(15,3),FNAttr(0,3),2,8,1,0)
  174.  CALL Prtcwindow(7,"Left Shadow")
  175.  DELAY(2)
  176.  CALL Makewindow(7,45,10,30,FNAttr(15,2),FNAttr(0,2),2,8,2,0)
  177.  CALL Prtcwindow(7,"Right Shadow")
  178.  DELAY(2)
  179.  CALL Removewindow
  180.  CALL Removewindow
  181.  CALL Clearwindow
  182.  CALL Prtcwindow(6,"this is LT. HATCH - type 5 left and 6 right")
  183.  DELAY(3)
  184.  CALL Makewindow(7,10,10,30,FNAttr(15,3),FNAttr(0,3),2,FNAttr(0,7),5,0)
  185.  CALL Prtcwindow(7,"Left Shadow")
  186.  DELAY(2)
  187.  CALL Makewindow(7,45,10,30,FNAttr(15,2),FNAttr(0,2),2,FNAttr(0,7),6,0)
  188.  CALL Prtcwindow(7,"Right Shadow")
  189.  DELAY(2)
  190.  CALL Removewindow
  191.  CALL Removewindow
  192.  CALL Clearwindow
  193.  CALL Prtcwindow(6,"this is MED. HATCH - type 7 left and 8 right")
  194.  DELAY(3)
  195.  CALL Makewindow(7,10,10,30,FNAttr(15,3),FNAttr(0,3),2,FNAttr(0,7),7,0)
  196.  CALL Prtcwindow(7,"Left Shadow")
  197.  DELAY(2)
  198.  CALL Makewindow(7,45,10,30,FNAttr(15,2),FNAttr(0,2),2,FNAttr(0,7),8,0)
  199.  CALL Prtcwindow(7,"Right Shadow")
  200.  DELAY(2)
  201.  CALL Removewindow
  202.  CALL Removewindow
  203.  CALL Clearwindow
  204.  CALL Prtcwindow(6,"this is HEAVY HATCH - type 9 left and 10 right")
  205.  DELAY(3)
  206.  CALL Makewindow(7,10,10,30,FNAttr(15,3),FNAttr(0,3),2,FNAttr(0,7),9,0)
  207.  CALL Prtcwindow(7,"Left Shadow")
  208.  DELAY(2)
  209.  CALL Makewindow(7,45,10,30,FNAttr(15,2),FNAttr(0,2),2,FNAttr(0,7),10,0)
  210.  CALL Prtcwindow(7,"Right Shadow")
  211.  DELAY(2)
  212.  CALL Removewindow
  213.  CALL Removewindow
  214.  CALL Clearwindow
  215.  CALL Prtcwindow(3,"Any combination of attributes and types")
  216.  CALL Prtcwindow(4,"can be used.")
  217.  CALL Makewindow(6,44,3,30,FNAttr(15,2),FNAttr(0,2),2,FNAttr(8,7),7,0)
  218.  CALL Prtwindow(1,2,"Press and key to return...")
  219.  WHILE NOT INSTAT
  220.  WEND
  221.  a$ = INKEY$
  222.  CALL Removewindow
  223.  CALL Removewindow
  224. END SUB
  225.  
  226. SUB Edemo
  227.  CALL Makewindow(13,5,10,70,FNAttr(15,5),FNAttr(15,5),2,FNAttr(8,7),7,0)
  228.  CALL Prtcwindow(3,"Windows can be popped")
  229.  CALL Prtcwindow(4,"onto the screen.")
  230.  DELAY(2)
  231.  CALL Makewindow(2,2,15,60,FNAttr(0,2),FNAttr(14,2),2,0,0,0)
  232.  DELAY(2)
  233.  CALL Makewindow(13,10,10,60,FNAttr(1,3),FNAttr(15,3),3,0,0,0)
  234.  DELAY(2)
  235.  CALL Makewindow(7,33,10,45,FNAttr(14,5),FNAttr(14,5),1,0,0,0)
  236.  DELAY(2)
  237.  DELAY(3)
  238.  FOR x = 1 TO 3
  239.      CALL Removewindow
  240.  NEXT
  241.  CALL Clearwindow
  242.  CALL Prtcwindow(3,"Windows can be zoomed")
  243.  CALL Prtcwindow(4,"onto the screen.")
  244.  DELAY(2)
  245.  CALL Makewindow(2,2,15,60,FNAttr(0,2),FNAttr(14,2),2,0,0,1)
  246.  DELAY(2)
  247.  CALL Makewindow(13,10,10,60,FNAttr(1,3),FNAttr(15,3),3,0,0,1)
  248.  DELAY(2)
  249.  CALL Makewindow(7,33,10,45,FNAttr(14,5),FNAttr(14,5),1,0,0,1)
  250.  DELAY(2)
  251.  CALL Makewindow(7,10,12,63,FNAttr(15,4),FNAttr(14,4),2,0,2,1)
  252.  CALL Prtcwindow(5,"HOW ABOUT THAT !!!")
  253.  DELAY(3)
  254.  FOR x = 1 TO 4
  255.      CALL Removewindow
  256.  NEXT
  257.  CALL Makewindow(6,44,3,30,FNAttr(15,2),FNAttr(0,2),2,FNAttr(8,7),7,0)
  258.  CALL Prtwindow(1,2,"Press and key to return...")
  259.  WHILE NOT INSTAT
  260.  WEND
  261.  a$ = INKEY$
  262.  CALL Removewindow
  263.  CALL Removewindow
  264. END SUB
  265.  
  266. SUB Flhelp
  267.  CALL Makewindow(14,10,9,55,FNAttr(0,2),FNAttr(0,2),2,FNAttr(8,7),7,1)
  268.  CALL Titlewindow(2,FNAttr(14,2),"[ FIRST LETTER ]")
  269.  CALL Prtwindow(1,2,"To activate First Letter control you must set two")
  270.  CALL Prtwindow(2,2,"variables.  FLOn must be set to true and you can")
  271.  CALL Prtwindow(3,2,"set FLattr to the desired color you wish.  Thats")
  272.  CALL Prtwindow(4,2,"all there is to it.  Just be sure all strings begin")
  273.  CALL Prtwindow(5,2,"with a different letter.")
  274.  CALL Prtwindow(7,2,"Press enter to return...")
  275.  WHILE NOT INSTAT
  276.  WEND
  277.  a$ = INKEY$
  278.  CALL Removewindow
  279. END SUB
  280.  
  281. SUB Barhelp
  282.  CALL Makewindow(14,10,9,55,FNAttr(0,2),FNAttr(0,2),2,FNAttr(8,7),7,1)
  283.  CALL Titlewindow(2,FNAttr(14,2),"[ MENUBARS ]")
  284.  CALL Prtwindow(1,2,"There are currently four menu bar types:")
  285.  CALL Prtwindow(2,2,"  0 - No visible bar    1 - Full width bar")
  286.  CALL Prtwindow(3,2,"  2 - String width bar  3 - Pointer")
  287.  CALL Prtwindow(4,2,"You control what type is active by setting BarType")
  288.  CALL Prtwindow(5,2,"equal to the type desired.")
  289.  CALL Prtwindow(7,2,"Press enter to return...")
  290.  WHILE NOT INSTAT
  291.  WEND
  292.  a$ = INKEY$
  293.  CALL Removewindow
  294. END SUB
  295.  
  296. SUB Generalhelp
  297.  CALL Makewindow(14,10,9,55,FNAttr(0,2),FNAttr(0,2),2,FNAttr(8,7),7,1)
  298.  CALL Titlewindow(2,FNAttr(14,2),"[ GENERAL ]")
  299.  CALL Prtwindow(1,2,"Remember MakeMenu is only a procedure executed in a")
  300.  CALL Prtwindow(2,2,"predefined window so all window effects can be used")
  301.  CALL Prtwindow(3,2,"to enhance your menu.  Including border and shadow,")
  302.  CALL Prtwindow(4,2,"as well as growing and all various color attribute")
  303.  CALL Prtwindow(5,2,"combinations.  The choices are almost endless!")
  304.  CALL Prtwindow(7,2,"Press enter to return...")
  305.  WHILE NOT INSTAT
  306.  WEND
  307.  a$ = INKEY$
  308.  CALL Removewindow
  309. END SUB
  310.  
  311. SUB Mdemo
  312. SHARED item$(),itemcount,curntpos,startpos,hlattr,flattr,bartype,flon
  313.  CALL Makewindow(6,50,6,17,FNAttr(14,5),FNAttr(14,5),2,FNAttr(8,7),7,0)
  314.  CALL Titlewindow(2,FNAttr(15,5),"[ MENUS ]")
  315.  done = 0
  316.  oldcurntpos = curntpos
  317.  curntpos = 0
  318.  WHILE NOT done
  319.        item$(1) = "First Letter"
  320.        item$(2) = "Menu Bars   "
  321.        item$(3) = "General     "
  322.        item$(4) = "Return      "
  323.        itemcount = 4
  324.        startpos = 1
  325.        hlattr = FNAttr(0,7)
  326.        flattr = FNAttr(15,5)
  327.        flon = -1
  328.        bartype = 1
  329.        CALL Makemenu
  330.        SELECT CASE curntpos
  331.               CASE 1
  332.                    CALL Flhelp
  333.               CASE 2
  334.                    CALL Barhelp
  335.               CASE 3
  336.                    CALL Generalhelp
  337.               CASE ELSE
  338.                    CALL Removewindow
  339.                    curntpos = oldcurntpos
  340.                    done = -1
  341.        END SELECT
  342.  WEND
  343.  done = 0
  344. END SUB
  345.  
  346.