home *** CD-ROM | disk | FTP | other *** search
- '********************************************************************
- 'POPMENUV.BAS - A SAMPLE POP-UP MENU INSIDE A WINDOW
- '********************************************************************
- REM $DYNAMIC
- DEFINT A-Z 'Make all variables integers by default.
- CALL QWINIT(4) 'Need to call this command before using any QW commands.
-
- DIM SHARED w(2000) 'Dimension an integer array for our window.
- DIM SHARED menu$(200) 'Define String array to hold menu items
- CLS 'Clear the screen.
- style = 6 'Make menu border solid.
- battr = &H71 'Set attribute for border = Bright Blue on Cyan.
- cattr = &H36 'Set attribute for characters = Yellow on Cyan.
- barattr = &H17 'Set attribute for bar on right side of menu.
- x1 = 25 'Left side of window.
- x2 = 55 'Right side.
- y1 = 6 'Top of window.
- y2 = 16 '& Bottom.
- options = 200 'Set # of items in menu = 200
-
- '---- Setup string array with menu items ----
- FOR i = 0 TO options
- menu$(i) = " 000000" + MID$(STR$(i), 2)
- NEXT i
-
- '---- Open a window to put the menu in ----
- id = 1
- CALL WOPEN(x1, y1, x2, y2, style, battr, "POPMENUV", w(), id)
- CALL WCOLOR(id, cattr)
-
- relpos = 3 'Start at item 3 of menu
- CALL POPMENUV(id, relpos, barattr, options, VARPTR(menu$(0)), result, flag)
- LOCATE 20, 1
- PRINT "Selected menu option: "; result, menu$(result)
- PRINT "Exit flag: "; flag
- PRINT " Press any key..."
- WHILE INKEY$ = "": WEND
- CALL WCLOSE(id)
- END
-
-