home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Basic / QWINDO.ZIP / POPMENUH.BAS < prev    next >
Encoding:
BASIC Source File  |  1990-01-01  |  1.6 KB  |  39 lines

  1. '********************************************************************
  2. 'POPMENUH.BAS - A SAMPLE SCROLLABLE, HORIZONTAL MENU INSIDE A WINDOW
  3. '********************************************************************
  4. REM $DYNAMIC
  5. DEFINT A-Z              'Make all variables integers by default.
  6. DIM w(2000)             'Dimension an integer array for our window.
  7. CALL QWINIT(4)          'Need to call this command before using any QW commands.
  8. CLS                     'Clear the screen.
  9.  
  10. DIM SHARED menu$(200)   'Define String array to hold menu items
  11. style = 6               'Make menu border solid.
  12. battr = &H12            'Set attribute for window border = Green on Blue.
  13. cattr = &H17            'Set attribute for characters = White on Blue.
  14. barattr = &H17          'Set attribute for bar on bottom of menu.
  15. x1 = 15                 'Left side of window.
  16. x2 = 65                 'Right side.
  17. y1 = 6                  'Top of window.
  18. y2 = 16                 '& Bottom.
  19. options = 200           'Set # of items in menu = 200
  20. position = 2            'Initial position of bar in menu = item 2
  21. menuwidth = 15          'Set width of each item in the menu.
  22.  
  23. '---- Setup string array with menu items ----
  24. FOR i = 0 TO options
  25.     menu$(i) = " 000000" + MID$(STR$(i), 2)
  26. NEXT i
  27.  
  28.  
  29. '---- Open Window for our menu ----
  30. id = 1
  31. CALL WOPEN(x1, y1, x2, y2, style, battr, "POPMENUH", w(), id)
  32. CALL WCOLOR(id, cattr)
  33.  
  34. CALL POPMENUH(id, position, menuwidth, options, barattr, VARPTR(menu$(0)), result, flag)
  35. LOCATE 1, 1
  36. PRINT "Selected menu option: "; result, menu$(result), "Exit flag: "; flag; : END
  37. END
  38.  
  39.