home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / MNUSYS22.ZIP / MNSSHELL.BAS < prev    next >
BASIC Source File  |  1994-01-13  |  4KB  |  142 lines

  1. 'Menusys / Menulib Shell
  2. '
  3. 'Use this program as a shell for writing your
  4. 'own programs that incorporate Menusys and Menulib
  5. 'routines.  It should be compilable as-is, however,
  6. 'providing limited functionality as a demonstration.
  7.  
  8. '---------------------
  9. 'Tell PB to link in
  10. 'necessary routines
  11. '---------------------
  12.  
  13. $compile exe
  14. $link "menusys.pbu"
  15. $link "menulib.pbu"
  16. $float procedure
  17.  
  18. '----------------------------
  19. 'Declare Public Variables for
  20. 'MENUSYS and MENULIB - include
  21. 'in ALL programs that use
  22. 'Menusys/Menulib routines.
  23. '----------------------------
  24.  
  25. public mouse%, segment&        'Mouse Flag and Video Segment
  26. public msx%, msy%, lb%, rb%    'Mouse X and Y pos, Left/Right Buttons
  27. public topcount%, bottomcount% 'Top/Bottom Menu Counts
  28. public mainclr%, mainbckg%     '"Main" Screen Colors
  29. public clr%, bckg%             'Temporary (Current) Colors
  30. public clr1%, clr2%, clr3%     'Alternate Character Colors
  31. public bckg1%, bckg2%, bckg3%  'Alternate Background Colors
  32. public helpfn$, progname$      'Help File and Program Name
  33.                    'Help filename should contain path as
  34.                    'well as main filename.  Leave helpfn$
  35.                    'undefined for no help.
  36.  
  37. '---------------------
  38. 'Check Mouse and Video -
  39. 'This sets the PUBLIC
  40. 'variables declared
  41. 'in the last section to
  42. 'specific values.
  43. '---------------------
  44.  
  45. CALL mhardreset(ms%, nb%)
  46. IF ms% = 0 THEN mouse% = 0 ELSE mouse% = 1
  47. segment& = vidseg&
  48. IF segment& = &HB000 THEN
  49.     mainclr% = 7: mainbckg% = 0
  50.     clr1% = 0: clr2% = 15
  51.     clr3% = 0
  52.     bckg1% = 7: bckg2% = 7
  53.     bckg3% = 7
  54. ELSE
  55.     mainclr% = 15: mainbckg% = 1
  56.     clr1% = 0: clr2% = 15
  57.     clr3% = 8
  58.     bckg1% = 7: bckg2% = 7
  59.     bckg3% = 3
  60. END IF
  61.  
  62.  
  63. '--------------
  64. 'Read Menu Data
  65. '--------------
  66.  
  67. topcount% = 2: bottomcount% = 4  'Number of TOP (bar) and
  68.                          'BOTTOM (box) menus.
  69.  
  70. REDIM menu$(0 : topcount%, 1 : bottomcount%)
  71. REDIM help$(1 : topcount%, 1 : bottomcount%)
  72. REDIM menutype%(1 : topcount%, 1 : bottomcount%)
  73. REDIM menucount%(1 : topcount%)
  74.  
  75. RESTORE menudatapoint
  76.  
  77. FOR t% = 1 TO topcount%
  78.     READ menu$(0, t%)
  79. NEXT t%
  80.  
  81. FOR t% = 1 TO topcount%
  82.     READ menucount%(t%)
  83.     FOR u% = 1 TO menucount%(t%)
  84.         READ menu$(t%, u%)
  85.     NEXT u%
  86. NEXT t%
  87.  
  88. FOR t% = 1 TO topcount%
  89.     FOR u% = 1 TO menucount%(t%)
  90.     READ help$(t%, u%)
  91.     NEXT u%
  92. NEXT t%
  93.  
  94.  
  95. '---------------------------------
  96. 'Substitute the following with
  97. 'your own program.
  98. '---------------------------------
  99.  
  100. color mainclr%, mainbckg%  'Main Screen Colors
  101. cls
  102. CALL MENUSYS(menu$(), help$(), menucount%(), menutype%(), topchoice%, bottomchoice%)
  103. locate 10,1
  104. print "Top Menu: ";topchoice%
  105. print "Bottom Menu: ";bottomchoice%
  106. END
  107.  
  108.  
  109. '---------------------
  110. 'Menu Data Starts Here
  111. '---------------------
  112.  
  113. menudatapoint:
  114.  
  115. '--------------------------------------------
  116. 'TOP MENU BAR SELECTION TITLES (Enclose The
  117. 'Hot-Key Letter to Highlight in Parentheses).
  118. 'Set topcount% to number of top menu entries
  119. 'before reading (2 entries, in this case.)
  120.  
  121. DATA "  (F)ile", "  (E)dit"
  122.  
  123. '--------------------------------------------
  124. 'BOX MENU TITLES (For each box menu: Number of Entries
  125. 'followed by the text for the entries.  Use "-" for horiz.
  126. 'line.  Set bottomcount% to MAXIMUM number of bottom menu
  127. 'entries (should be >= topcount% - quirk of the program).
  128. 'bottomcount% = 3, in this case.
  129.  
  130. DATA 3,(N)ew Program, "-", (O)pen Program
  131. DATA 2, (U)ndo, (C)ut
  132.  
  133. '--------------------------------------------
  134. 'BOX MENU HELP
  135. 'Must correspond to (be in the same order and
  136. 'the same quantity as) the Box Menu Titles, including
  137. 'the "-" corresponding to the "-" entries in the box
  138. 'menu titles.
  139.  
  140. DATA Removes currently loaded program from memory, "-", Loads new program into memory
  141. DATA Restores current edited line to its original condition, Deletes selected text and copies it to buffer
  142.