home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / mouse / mousemnu / mousesam.bas < prev    next >
Encoding:
BASIC Source File  |  1987-07-05  |  1.2 KB  |  43 lines

  1.   KEY OFF:COLOR 7,1:CLS
  2.   DIM SCRN%(2000),ITEM$(100),TAGGED%(100),TAG$(100),MSGDAT$(5)
  3.   DIM MLINE$(6)
  4.  
  5.   DEF FNS$(S!)=RIGHT$(STR$(S!),LEN(STR$(S!))+(S!>=0))
  6.   LOCATE 8,5:PRINT "This is MOUSEMNU - It uses the mouse to Pull-down 1-6 menues. When the"
  7.   LOCATE 9,5:PRINT "mouse is 'clicked' at a Menu Bar, a Pull-Down menu is displayed as long"
  8.   LOCATE 10,5:PRINT "as the mouse button is held. A highlighted bar follows the mouse cursor"
  9.   LOCATE 11,5:PRINT "to indicate items to be selected.  This routine is similar (look and feel)"
  10.   LOCATE 12,5:PRINT "to the user interface of QuickBASIC Version 3.0 ..."
  11.  
  12.   SECONDS=10:GOSUB WAITSEC
  13.  
  14.   CLS
  15.   DIM MAXSIZE%(15),MAXITEMS%(15),ITEMS$(5,15)
  16.   FOR I=0 TO 4
  17.     MLINE$(I)="MENU#"+FNS$(I+1)
  18.     FOR J=0 TO 9
  19.       ITEMS$(I,J)="  MENU"+STR$(I+1)+" ITEM"+STR$(J+1)+"  "
  20.     NEXT J
  21.   NEXT I
  22.  
  23.   FOR I=0 TO 4
  24.     MAXSIZE%(I)=15
  25.     MAXITEMS%(I)=10
  26.   NEXT I
  27.   
  28.   CALL MOUSEMNU(MLINE$(),7,0,12,5,MAXSIZE%(),MAXITEMS%(),ITEMS$(),MENUSLCT%,ITEMSLCT%)
  29.   LOCATE 23,10:PRINT "RETURNED VALUE IS MENU: ";MENUSLCT%;" ITEM: ";ITEMSLCT%;"   ";
  30.  
  31.   SECONDS=5:GOSUB WAITSEC
  32.  
  33.  
  34.   COLOR 7,1:CLS
  35.  
  36.   END
  37.  
  38. WAITSEC:         BEGINTIME=TIMER
  39.   WHILE ENDTIME < BEGINTIME+SECONDS
  40.     ENDTIME=TIMER
  41.   WEND
  42.   RETURN
  43.