home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol11n01.zip / ABOUT.PRG next >
Text File  |  1991-08-29  |  2KB  |  73 lines

  1. ***********************************************************************
  2. * ABOUT.PRG                                         FoxPro 1.02
  3. * Demonstrate hidden mouse buttons and scrolling window messages
  4. ***********************************************************************
  5. SET ECHO OFF
  6. SET TALK OFF
  7. CLEAR
  8. pcmag="PC Magazine PC Magazine PC Magazine PC Magazine PC Magazine "+;
  9.       "PC Magazine PC Mag"
  10. @ 0,0,24,79 BOX
  11. i = 1
  12. DO WHILE i <=23
  13.    @ i,1 SAY pcmag
  14.    i = i + 1
  15. ENDDO
  16.  
  17. oldc = SET('CURSOR')
  18. SET CURSOR OFF
  19. phrase = "*** PC Magazine Databases *** PC Magazine Databases "
  20. phrase = phrase + "*** PC Magazine Databases *** PC Magazine Databases ***"
  21.  
  22. DEFINE WINDOW mbox FROM 6,15 TO 16,64 DOUBLE SHADOWS COLOR SCHEME 5
  23. ACTIVATE WINDOW mbox
  24. DO FILLWIN                                 && Fill window with text
  25.  
  26. x = INKEY(10,"M")                          && Pause for 10 seconds,
  27.                                            && check for mouse click
  28. IF x == 151                                && If mouse was single clicked
  29.    row = MROW()                            && Get mouse row position
  30.    col = MCOL()                            && Get mouse column position
  31.  
  32.    * Check mouse position, to see if it was clicked on "hidden button"
  33.  
  34.    IF row < 2 .AND. col < 2 .AND. row <> -1 .AND. col <> -1
  35.  
  36.       width = WCOLS()                      && Get width of the window
  37.  
  38.       * If phrase is shorter than window width, pad it with spaces
  39.  
  40.       IF LEN(phrase) < width
  41.          phrase = LEFT(phrase + SPACE(width), width)
  42.       ENDIF
  43.       midrow = INT(WROWS()/2)              && Pick the middle row
  44.  
  45.       DO WHILE .T.
  46.          @ midrow-1,0 SAY SPACE(width) COLOR W+/R
  47.          @ midrow +1,0 SAY SPACE(width) COLOR W+/R
  48.          @ midrow, 0 SAY LEFT(phrase,width) COLOR W+/R
  49.  
  50.          phrase = SUBSTR(phrase,2) + LEFT(phrase,1)   && Move front to back
  51.  
  52.          delay = INKEY(.1,"M")             && Short delay, get click or key
  53.          IF delay != 0                     && Quit with any keypress or click
  54.             DO FILLWIN
  55.             EXIT
  56.          ENDIF
  57.  
  58.       ENDDO
  59.    ENDIF
  60. ENDIF
  61. RELEASE WINDOW mbox                        && Release the window
  62. SET CURSOR &oldc                           && Restore cursor setting
  63. CLEAR
  64. RETURN
  65.  
  66. PROCEDURE FILLWIN
  67. CLEAR
  68. @ 1,16 SAY "The About Box"
  69. @ 3,8 SAY "Can you find the hidden button?"
  70. @ 5,17 SAY "PC Magazine"
  71. @ 7,19 SAY "Databases"
  72. RETURN
  73.