[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2013-06-24T18:06:23-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/3708 2013-06-24T18:06:23-05:00 2013-06-24T18:06:23-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22666#p22666 <![CDATA[Menu question]]>

Code:

  REMDEFINT A-ZMenuBackground& = _LOADIMAGE("smallroad.png", 32)MainMenu& = _NEWIMAGE(640, 480, 32)SCREEN MainMenu&'--------------------- FONT ---------------------------------------TTfont$ = "timesbd"height& = 32style$ = ""fnt& = _LOADFONT(TTfont$ + ".ttf", height&, style$)IF fnt& = 0 THEN BEEP_FONT fnt&DIM SHARED mx%, my%, mbl%, mbm%, mbr%DIM SHARED OOption%GOSUB MakBoxesGOSUB MakLabels_MOUSESHOWDO    _LIMIT 30    a$ = INKEY$    _PUTIMAGE , MenuBackground&, MainMenu&    MousePoll    COLOR _RGB32(255, 255, 255)    LOCATE 1, 1    PRINT mx%, my%, mbl%, mbm%, mbr%    GOSUB MakBoxes    GOSUB MakLabels    GOSUB MenuOption    IF mbl% = -1 THEN        IF OOption% <> 0 THEN            GOSUB OtherPrograms        END IF    END IF    _DISPLAYLOOP UNTIL _KEYDOWN(27)SLEEPSYSTEM'------------------------- Gosubs  -----------------------------------------------------------------OtherPrograms:SELECT CASE OOption%    CASE 1        CLS        COLOR _RGB32(255, 0, 255)        _PRINTMODE _KEEPBACKGROUND        _PRINTSTRING (220, 100), "Animal Sounds", MainMenu&        _DISPLAY        DO: LOOP UNTIL _KEYDOWN(32)        OOption% = 0        a$ = INKEY$        WHILE a$ <> "": a$ = INKEY$: WEND    CASE 2        CLS        COLOR _RGB32(255, 255, 0)        _PRINTMODE _KEEPBACKGROUND        _PRINTSTRING (220, 100), "Lets Paint", MainMenu&        _DISPLAY        DO: LOOP UNTIL _KEYDOWN(32)        OOption% = 0        a$ = INKEY$        WHILE a$ <> "": a$ = INKEY$: WEND    CASE 3        CLS        COLOR _RGB32(0, 255, 255)        _PRINTMODE _KEEPBACKGROUND        _PRINTSTRING (220, 100), "Letter Sounds", MainMenu&        _AUTODISPLAY        DO: LOOP UNTIL _KEYDOWN(32)        OOption% = 0        a$ = INKEY$        WHILE a$ <> "": a$ = INKEY$: WEND    CASE 4        CLS        COLOR _RGB32(255, 255, 255)        _PRINTMODE _KEEPBACKGROUND        _PRINTSTRING (220, 100), "QUIT", MainMenu&        _AUTODISPLAY        DO: LOOP UNTIL _KEYDOWN(32)        OOption% = 0        a$ = INKEY$        WHILE a$ <> "": a$ = INKEY$: WENDEND SELECTRETURNMenuOption:'check for hoverIF mx% > 120 AND mx% < 520 THEN    SELECT CASE my%        CASE 100 TO 131            LINE (120, 100)-(520, 131), _RGB32(255, 255, 0), BF            COLOR _RGB32(0, 0, 0)            _PRINTMODE _KEEPBACKGROUND            _PRINTSTRING (220, 100), "Animal Sounds", MainMenu&            OOption% = 1        CASE 163 TO 194            LINE (120, 164)-(520, 195), _RGB32(255, 255, 0), BF            COLOR _RGB32(0, 0, 0)            _PRINTMODE _KEEPBACKGROUND            _PRINTSTRING (220, 164), "Lets Paint", MainMenu&            OOption% = 2        CASE 226 TO 257            LINE (120, 228)-(520, 259), _RGB32(255, 255, 0), BF            COLOR _RGB32(0, 0, 0)            _PRINTMODE _KEEPBACKGROUND            _PRINTSTRING (220, 228), "Letter Sounds", MainMenu&            OOption% = 3        CASE 289 TO 320            LINE (120, 292)-(520, 323), _RGB32(255, 255, 0), BF            OOption% = 1            COLOR _RGB32(0, 0, 0)            _PRINTMODE _KEEPBACKGROUND            _PRINTSTRING (220, 292), "QUIT", MainMenu&            OOption% = 4        CASE ELSE            OOption% = 0            GOSUB MakBoxes            GOSUB MakLabels    END SELECTELSE    OOption% = 0END IFRETURNMakBoxes:x1 = 120: y1 = 100FOR t = 1 TO 4    LINE (x1, y1)-(x1 + 400, y1 + 31), _RGB32(211, 211, 211), BF    y1 = y1 + 64NEXT tRETURNMakLabels:COLOR _RGB32(0, 0, 0)_PRINTMODE _KEEPBACKGROUND_PRINTSTRING (220, 100), "Animal Sounds", MainMenu&_PRINTSTRING (220, 164), "Lets Paint", MainMenu&_PRINTSTRING (220, 228), "Letter Sounds", MainMenu&_PRINTSTRING (220, 292), "QUIT", MainMenu&RETURN'------------------------- Call Subs ---------------------------------------------------------------SUB MousePoll ()DO WHILE _MOUSEINPUT    mx% = _MOUSEX: my% = _MOUSEY: mbl% = _MOUSEBUTTON(1): mbr% = _MOUSEBUTTON(2): mbm% = _MOUSEBUTTON(3)LOOPEND SUB  
the image is attached,
Ok, now I think if we just do it this way, rather then also posting eache program that the menu is supposed to run,
this would be the "Animal sounds" file name: animalsounds.bas , or a sub name ? "animalsounds",

Code:

PRINT "This is the animal sounds program"PLAY "abcde"PRINT "END OF PROGRAM" END '///or return, I am not sure how to do that , so it would go back to the main menu when the user quits
I think, if I see, how it works or needs to be, so it runs, this simple code, as "animalsounds" then I can also use the same, to run the real programs,..I suppose each one will be in a SUB, or the could be compiled, and shell to them, not sure about the best way to do that,..
If anyone can help on this, it would be greatly appreciated,..
thanks from Garry
smallroad.png

Statistics: Posted by GarryRicketson — Mon Jun 24, 2013 6:06 pm


]]>