home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / SHADOWB.PRG < prev    next >
Encoding:
Text File  |  1991-07-02  |  1.5 KB  |  53 lines

  1. /*
  2.    Program: SHADOWBOX()
  3.    System: GRUMPFISH LIBRARY
  4.    Author: Greg Lief
  5.    Copyright (c) 1988-90, Greg Lief
  6.    Clipper 5.01 version
  7.    Compile instructions: clipper shadowb /n/w/a
  8.    Draws shadowed box
  9.    Calls: BOX_TITLE()      (Function in BOXTITLE.PRG)
  10. */
  11.  
  12. //───── begin preprocessor directives
  13.  
  14. #include "grump.ch"
  15.  
  16. //───── end preprocessor directives
  17.  
  18. function Shadowbox(ntop, nleft, nbottom, nright, ntype, ctitle, ;
  19.                    lcrossbar, ccolor)
  20. local boxstring, ret_val
  21. //───── establish defaults
  22. default ntype to 1
  23. default ctitle to []
  24. lcrossbar := (lcrossbar != NIL)
  25. //───── limit border # to 6 to avoid array crash
  26. boxstring := BOXFRAMES[if(ntype > 6, 1, ntype)]
  27.  
  28. //───── construct array containing coordinates & contents of screen
  29. //───── area underneath this box - this can be used with byebyebox()
  30. ret_val := { ntop, nleft, nbottom + 1, nright + 2, ;
  31.              savescreen(ntop, nleft, nbottom + 1, nright + 2) }
  32.  
  33. //───── draw shadow if coordinates are valid
  34. if nbottom < maxrow() .and. nright < maxcol() - 1
  35.    gfattr(ntop + 1, nright + 1, nbottom + 1, nright + 2, 8)
  36.    gfattr(min(nbottom + 1, maxrow() - 1), nleft + 2, nbottom + 1, nright + 2, 8)
  37. endif
  38.  
  39. //───── draw box outline
  40. @ ntop, nleft, nbottom, nright box boxstring color ccolor
  41.  
  42. //───── draw title if requested
  43. if len(ctitle) > 0
  44.    box_title(ntop, nleft, nright, ctitle, boxstring, lcrossbar, ccolor)
  45. endif
  46.  
  47. return (ret_val)
  48.  
  49. * end function ShadowBox()
  50. *--------------------------------------------------------------------*
  51.  
  52. * eof shadowb.prg
  53.