home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / clipper / gt_shado.prg < prev    next >
Text File  |  1993-10-14  |  2KB  |  102 lines

  1. /*
  2.     File......: GT_Shadow.prg
  3.     Author....: Martin Bryant
  4.     BBS.......: The Dark Knight Returns
  5.     Net/Node..: 050/069
  6.     User Name.: Martin Bryant
  7.     Date......: 04/02/93
  8.     Revision..: 1.0
  9.  
  10.     This is an original work by Martin Bryant and is placed
  11.     in the public domain.
  12.  
  13.     Modification history:
  14.     ---------------------
  15.  
  16.     Rev 1.0 04/02/93
  17.     PD Revision.
  18. */
  19.  
  20. /*  $DOC$
  21.  *  $FUNCNAME$
  22.  *      GT_SHADOW()
  23.  *  $CATEGORY$
  24.  *      Video
  25.  *  $ONELINER$
  26.  *      Function to display a shadow around a box
  27.  *  $SYNTAX$
  28.  *      GT_Shadow(<nTop>,<nLeft>,<nBottom>,<nRight>) -> lSuccess
  29.  *  $ARGUMENTS$
  30.  *      <nTop>,<nLeft>,<nBottom> and <nRight> are the
  31.  *      co-ordinates of the box. The shadow will be drawn
  32.  *      two spaces below and to the right.
  33.  *  $RETURNS$
  34.  *      GT_Shadow() returns logical success.
  35.  *  $DESCRIPTION$
  36.  *      Function to display a shadow to the bottom and
  37.  *      right of a box.
  38.  *  $EXAMPLES$
  39.  *      GT_Shadow(10,05,15,20)
  40.  *  $SEEALSO$
  41.  *
  42.  *  $INCLUDE$
  43.  *
  44.  *  $END$
  45.  */
  46.  
  47. #include "GT_LIB.ch"
  48.  
  49. #define SHADOW  CHR(08)
  50.  
  51. FUNCTION GT_Shadow(nTop,nLeft,nBottom,nRight)
  52.  
  53. LOCAL cTemp := ''
  54. LOCAL lSuccess := .F.
  55. LOCAL nCount := 0
  56.  
  57. Default nTop to -1
  58. Default nLeft to -1
  59. Default nBottom to -1
  60. Default nRight to -1
  61.  
  62. // Adjust
  63. nTop ++
  64. nLeft += 2
  65. nRight += 2
  66. nBottom ++
  67.  
  68. IF nBottom <= MAXROW() .AND. nRight <= MAXCOL()
  69.  
  70.     // Horizontal line
  71.     FOR nCount := nLeft TO nRight
  72.  
  73.         cTemp := SUBSTR(SAVESCREEN(nBottom,nCount,nBottom, ;
  74.             nCount),1,1) + SHADOW
  75.         RESTSCREEN(nBottom,nCount,nBottom,nCount,cTemp)
  76.  
  77.     NEXT
  78.  
  79.     nRight --
  80.  
  81.     // Vertical lines
  82.     FOR nCount := nTop TO nBottom
  83.         cTemp := SUBSTR(SAVESCREEN(nCount,nRight,nCount, ;
  84.             nRight),1,1) + SHADOW
  85.         RESTSCREEN(nCount,nRight,nCount,nRight,cTemp)
  86.     NEXT
  87.     nRight ++
  88.     FOR nCount := nTop TO nBottom
  89.         cTemp := SUBSTR(SAVESCREEN(nCount,nRight,nCount, ;
  90.             nRight),1,1) + SHADOW
  91.         RESTSCREEN(nCount,nRight,nCount,nRight,cTemp)
  92.     NEXT
  93.  
  94.     lSuccess :=.T.
  95.  
  96. ENDIF
  97.  
  98. /*
  99.     End of GT_Shadow()
  100. */
  101. RETURN(lSuccess)
  102.