home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / tools / codeit / demom1.bas < prev    next >
BASIC Source File  |  1992-05-27  |  5KB  |  156 lines

  1. DECLARE SUB PDTestSUB ()
  2. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3. 'DEMOM1.BAS Copyright (C) 1991-1992, Clear Software. ALL RIGHTS RESERVED.
  4. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5.  
  6. '$INCLUDE: 'CITOOLS.BI'
  7. '$INCLUDE: 'CIMENU1.BI'
  8. '$INCLUDE: 'CIMOUSE.BI'
  9.  
  10. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  11.  
  12. DEFINT A-Z
  13.  
  14. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  15.  
  16. CONST TRUE = -1, FALSE = 0
  17.  
  18. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  19.  
  20.  
  21.     PDTestSUB
  22.  
  23. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  24. 'Hide the mouse and clean up the screen before exiting.
  25. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  26.  
  27.     MouseHide
  28.     COLOR 7, 0
  29.     CLS
  30.     END
  31.  
  32. SUB PDTestSUB
  33.  
  34. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  35. 'Dimention the arrays for the pull down menu descriptions. Notice the
  36. 'dimentions are (1 TO 20).
  37. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  38.  
  39.     DIM pd1$(1 TO 20)
  40.     DIM pd2$(1 TO 20)
  41.  
  42. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  43. 'Initialize the mouse driver.
  44. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  45.     MouseInit
  46.  
  47. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  48. 'Clear the screen and paint the background with the ScreenPaint SUB.
  49. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  50.  
  51.     CLS
  52.     COLOR 15, 1
  53.     ScreenPaint 1, 80, 1, 23, ""
  54.  
  55. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  56. 'Now set the menu definitions.
  57. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  58.  
  59.     PullDownDefine 1, 0, 1, "Options", 1
  60.     PullDownDefine 1, 1, 1, "Get The Heck Out Of Dodge", 1
  61.     PullDownDefine 1, 2, 1, "Beem Me Up Scotty", 9
  62.     PullDownDefine 1, 3, 1, "Frankly Scarlet,....", 1
  63.     PullDownDefine 1, 4, 1, "-", 1
  64.     PullDownDefine 1, 5, 1, "Exit", 2
  65.  
  66.     PullDownDefine 2, 0, 1, "Foods", 1
  67.     PullDownDefine 2, 1, 1, "Green, Brown, and Yellow Stuff", 1
  68.     PullDownDefine 2, 2, 1, "Lima Beens", 1
  69.     PullDownDefine 2, 3, 1, "-", 1
  70.     PullDownDefine 2, 4, 1, "Prunes", 1
  71.     PullDownDefine 2, 5, 1, "Liver and Onions", 11
  72.  
  73.  
  74.     PullDownColors 15, 7, 1, 7, 1, 7, 11, 0, 8, 7, 15, 15
  75.  
  76.  
  77. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  78. 'Set the area, colors and contents for the menu descriptions.
  79. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  80.  
  81.     PullDownTitleDescript "<Enter=Accept>  <Arrow=Next Title>  <Escape=Exit>"
  82.     PullDownDescriptArea 23, 2, 78, 0, 3
  83.  
  84.     pd1$(1) = " Riding of into the sunset (watch for saddle sores)"
  85.     pd1$(2) = " You watch too much TV"
  86.     pd1$(3) = " You finish it"
  87.     pd1$(4) = ""
  88.     pd1$(5) = " Get rid of this screen and it's bad pun's"
  89.  
  90.     PullDownDescript 1, pd1$()
  91.  
  92.     pd2$(1) = " What they used to serve us in the school cafeteria"
  93.     pd2$(2) = " The human equivelent of furr balls"
  94.     pd2$(3) = ""
  95.     pd2$(4) = " One of the `Active' food groups"
  96.     pd2$(5) = " Mom's way of getting revenge"
  97.  
  98.     PullDownDescript 2, pd2$()
  99.  
  100. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  101. 'Show the menu bar and turn on the mouse cursor.
  102. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  103.  
  104.     PullDownTitleOn
  105.     MouseShow
  106.  
  107.  
  108. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  109. 'Enter the main loop and poll for a user event (mouse or keyboard). If one
  110. 'takes place then go to the PDGetMenuAction GOSUB to determin which menu
  111. 'choice was chosen.
  112. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  113.  
  114.     PDDONE = FALSE
  115.  
  116.     WHILE NOT PDDONE
  117.         kb$ = PullDownPoll$
  118.         WHILE PullDownInfo(0)
  119.             GOSUB PDGetMenuAction
  120.         WEND
  121.     WEND
  122.  
  123. EXIT SUB
  124.  
  125. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  126. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  127. 'FInd out which menu choice was chosen and act on it.
  128. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  129.  
  130. PDGetMenuAction:
  131.  
  132.     menu = PullDownInfo(1)
  133.     item = PullDownInfo(2)
  134.  
  135.     SELECT CASE menu
  136.  
  137.         CASE 1                      'The first menu was chosen.
  138.             SELECT CASE item
  139.                 CASE 1
  140.  
  141.                 CASE 5                  'If Exit was chosen set the exit flag
  142.                     PDDONE = TRUE       'to TRUE.
  143.  
  144.             END SELECT
  145.             
  146.         CASE 2                      'The second menu was chosen.
  147.  
  148.     END SELECT
  149.  
  150. RETURN
  151.  
  152. '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  153.  
  154. END SUB
  155.  
  156.