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

  1. $include "TBWINDO.INC"
  2.  
  3. out &H03d9,7
  4. call qfill(1,1,25,80,32,fnattr(0,7))
  5. call mainmenu
  6. out &H03d9,0
  7.  
  8. sub mainmenu
  9. shared item$(),itemcount,startpos
  10. shared curntpos,done
  11. done = 0
  12. curntpos = 0
  13. call makewindow(5,20,7,40,fnattr%(15,1),2,2,0)
  14. call titlewindow(2,"[ MAIN MENU ]")
  15. while not done
  16.   oldcurntpos = curntpos
  17.   item$(1) = "Pop Screen 1"
  18.   item$(2) = "Pop Screen 2"
  19.   item$(3) = "Pop Screen 3"
  20.   item$(4) = "Second Menu Demo"
  21.   item$(5) = "Exit"
  22.   itemcount = 5
  23.   startpos = 1
  24.   call makemenu
  25.   select case curntpos
  26.     case 1 'screen 1
  27.       call popscreen1
  28.     case 2 ' screen 2
  29.       call popscreen2
  30.     case 3 ' screen 3
  31.       call popscreen3
  32.     case 4 ' second menu
  33.       call secondmenu
  34.     case else
  35.       call removewindow
  36.       curntpos = oldcurntpos
  37.       out &H03d9,1
  38.       call qfill(1,1,25,80,32,fnattr(15,1))
  39.       color 0,7
  40.       call makewindow(9,16,8,52,fnattr(0,7),2,0,0)
  41.       locate 10,18:print "Please see the source code and documentation"
  42.       locate 11,18:print "for how to create and use menu windows in"
  43.       locate 12,18:print "your programs...."
  44.       delay 5
  45.       done = -1
  46.     end select
  47. wend 'done
  48. call removewindow
  49. end sub
  50.  
  51. sub popscreen1
  52. call makewindow(8,10,7,60,fnattr(0,6),2,1,1)
  53. call titlewindow(2,"[ SELECTION 1 ]")
  54. call qprintc(10,10,70,"This is selection no. 1",fnattr(0,6))
  55. call qprintc(11,10,70,"Press enter to return to main menu...",fnattr(15,6))
  56. while not instat
  57. wend
  58. a$=inkey$
  59. call removewindow
  60. end sub
  61.  
  62. sub popscreen2
  63. call makewindow(8,10,7,60,fnattr(0,3),2,1,1)
  64. call titlewindow(2,"[ SELECTION 2 ]")
  65. call qprintc(10,10,70,"This is selection no. 2",fnattr(0,3))
  66. call qprintc(11,10,70,"Press enter to return to main menu...",fnattr(0,3))
  67. while not instat
  68. wend
  69. a$=inkey$
  70. call removewindow
  71. end sub
  72.  
  73. sub popscreen3
  74. call makewindow(8,10,7,60,fnattr(14,5),2,1,1)
  75. call titlewindow(2,"[ SELECTION 3 ]")
  76. call qprintc(10,10,70,"This is selection no. 3",fnattr(14,5))
  77. call qprintc(11,10,70,"Press enter to return to main menu...",fnattr(14,5))
  78. while not instat
  79. wend
  80. a$=inkey$
  81. call removewindow
  82. end sub
  83.  
  84. sub secondmenu
  85. shared item$(),itemcount,startpos
  86. shared curntpos,done
  87. call makewindow(7,25,6,40,fnattr%(14,2),2,2,0)
  88. call titlewindow(2,"[ SECOND MENU DEMO ]")
  89. done = 0
  90. oldcurntpos = curntpos
  91. curntpos = 0
  92. while not done
  93.   item$(1) = "Pop Screen 1"
  94.   item$(2) = "Pop Screen 2"
  95.   item$(3) = "Pop Screen 3"
  96.   item$(4) = "Exit"
  97.   itemcount = 4
  98.   startpos = 3
  99.   call makemenu
  100.   select case curntpos
  101.     case 1 'screen 1
  102.       call popscreen1
  103.     case 2 ' screen 2
  104.       call popscreen2
  105.     case 3 ' screen 3
  106.       call popscreen3
  107.     case else
  108.       call removewindow
  109.       curntpos = oldcurntpos
  110.       done = -1
  111.   end select
  112. wend 'done
  113. done = 0
  114. end sub
  115.