home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / SHRBOX.PRG < prev    next >
Encoding:
Text File  |  1991-04-23  |  1.3 KB  |  49 lines

  1. /*
  2.     Program: SHRBOX()
  3.     System: GRUMPFISH LIBRARY
  4.     Author: Greg Lief
  5.     Copyright (c) 1988-90, Greg Lief
  6.     Clipper 5.x Version
  7.     Compile instructions: clipper shrbox /n/w/a
  8.     Draws the incredible shrinking box
  9. */
  10.  
  11. //───── begin preprocessor directives
  12.  
  13. #include "grump.ch"
  14.  
  15. //───── end preprocessor directives
  16.  
  17. function shrbox(ntop, nleft, nbottom, nright, ndelay, ccolor)
  18. local medver, medhor, dom, ii, jj, oldcolor := setcolor(ccolor)
  19. default ndelay to 20
  20. if iscolor()    // one needs a color monitor to get the full effect
  21.    medver := int(((nbottom - ntop) + 1) /2)   // determine vertical median
  22.    medhor := int(((nright - nleft) + 1) /2)   // determine horizontal median
  23.    dom := max(medver, medhor)
  24.    for ii = dom to 1 step -1
  25.       for jj = 1 to ndelay   // slow down implosion
  26.       next
  27.  
  28.       //───── blank out previous box outline
  29.       @ ntop, nleft, nbottom, nright box space(9)
  30.       if ii < medver
  31.          ntop++
  32.          nbottom--
  33.       endif
  34.       if ii < medhor
  35.          nleft++
  36.          nright--
  37.       endif
  38.    next
  39. endif
  40. //───── blank out remaining box area
  41. scroll(ntop, nleft, nbottom, nright, 0)
  42. setcolor(oldcolor)
  43. return NIL
  44.  
  45. * end function ShrBox()
  46. *--------------------------------------------------------------------*
  47.  
  48. * eof shrbox.prg
  49.