home *** CD-ROM | disk | FTP | other *** search
- '********************************************************************
- 'POPMENUH.BAS - A SAMPLE SCROLLABLE, HORIZONTAL MENU INSIDE A WINDOW
- '********************************************************************
- REM $DYNAMIC
- DEFINT A-Z 'Make all variables integers by default.
- DIM w(2000) 'Dimension an integer array for our window.
- CALL QWINIT(4) 'Need to call this command before using any QW commands.
- CLS 'Clear the screen.
-
- DIM SHARED menu$(200) 'Define String array to hold menu items
- style = 6 'Make menu border solid.
- battr = &H12 'Set attribute for window border = Green on Blue.
- cattr = &H17 'Set attribute for characters = White on Blue.
- barattr = &H17 'Set attribute for bar on bottom of menu.
- x1 = 15 'Left side of window.
- x2 = 65 'Right side.
- y1 = 6 'Top of window.
- y2 = 16 '& Bottom.
- options = 200 'Set # of items in menu = 200
- position = 2 'Initial position of bar in menu = item 2
- menuwidth = 15 'Set width of each item in the menu.
-
- '---- Setup string array with menu items ----
- FOR i = 0 TO options
- menu$(i) = " 000000" + MID$(STR$(i), 2)
- NEXT i
-
-
- '---- Open Window for our menu ----
- id = 1
- CALL WOPEN(x1, y1, x2, y2, style, battr, "POPMENUH", w(), id)
- CALL WCOLOR(id, cattr)
-
- CALL POPMENUH(id, position, menuwidth, options, barattr, VARPTR(menu$(0)), result, flag)
- LOCATE 1, 1
- PRINT "Selected menu option: "; result, menu$(result), "Exit flag: "; flag; : END
- END
-
-