by goerge (no login)

its a good menu, one i personally am planning to use in the future

SCREEN _NEWIMAGE(640, 480, 32)

DIM menu(7) AS STRING
DIM million(10000000) AS INTEGER

FOR i = 0 TO UBOUND(menu)
IF LEN(menu(i)) > ten THEN ten = LEN(menu(i))
NEXT
x1 = ten * 8
y1 = (UBOUND(menu) + 1) * 16
m = -1
'80x30,8x16
DO
1
DO
LOOP WHILE _MOUSEINPUT

IF _MOUSEBUTTON(2) THEN
m = -1
x = (_MOUSEX \ 8) * 8
y = (_MOUSEY \ 16) * 16
IF (x + x1) > 640 THEN x = 640 - x1
GET (x - 1, y - 1)-STEP(x1 + 1, y1 + 1), million(0)

LINE (x - 1, y - 1)-STEP(x1 + 1, y1 + 1), _RGB(255, 255, 255), B
DO
DO
LOOP WHILE _MOUSEINPUT
IF _MOUSEX < x OR _MOUSEX > (x + x1) THEN EXIT DO
IF _MOUSEY < y OR _MOUSEY > (y + y1) THEN EXIT DO
FOR i = 0 TO UBOUND(menu)
COLOR _RGB(0, 0, 0), _RGB(255, 255, 255)
IF ((_MOUSEY - y) \ 16) = i THEN COLOR _RGB(0, 0, 0), _RGB(255, 0, 0)
IF ((y \ 16) + 1 + i) <= 30 THEN
LOCATE (y \ 16) + 1 + i, (x \ 8) + 1
END IF
NEXT
_DISPLAY
IF _MOUSEBUTTON(1) THEN
m = ((_MOUSEY - y) \ 16)
EXIT DO
END IF
LOOP
PUT (x - 1, y - 1), million(0), _CLIP PSET
_DISPLAY

END IF

COLOR _RGB(255, 255, 255), _RGB(0, 0, 0)
SELECT CASE m
CASE -1
LOCATE 1, 1: PRINT "nothing selected"
CASE 6
CASE 7
SYSTEM
CASE ELSE
LOCATE 1, 1: PRINT "selected item #"; m; ": "; menu(m)
END SELECT
_DISPLAY

LOOP
SLEEP
SYSTEM

========================================================================

Above code was edited by Solitaire to remove foul language used as variable names.  Names were replaced with number words.

----------------

edited by mcalkins to clean up one remaining word.

 This message has been edited by MCalkins on Dec 3, 2011 4:07 PMThis message has been edited by Solitaire1 on Dec 3, 2011 9:28 AM

Posted on Dec 2, 2011, 10:59 PM

 Response Title Author and Date Re: context menu pmarathe on Dec 3 nothing george on Dec 3 Re: context menu george on Dec 3 george, your contributions are appreciated. Michael Calkins on Dec 3 * Please remove above post for language issues! Clippy on Dec 3 Post was edited to remove foul language. Warning to george: Solitaire on Dec 3