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

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