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

  1. /*
  2.     File......: GT_Window.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_WINDOW()
  23.  *  $CATEGORY$
  24.  *      Video
  25.  *  $ONELINER$
  26.  *      Display a boxed window on the screen.
  27.  *  $SYNTAX$
  28.  *      GT_Window(<nTop>,<nLeft>,<nBottom>,<nRight>, ;
  29.  *          [<cLines>],[<cColour>],[<cTitle>],[<lShadow>]) ;
  30.  *          => lSuccess
  31.  *  $ARGUMENTS$
  32.  *      <nTop>],[<nLeft>],[<nBottom>,<nRight>] are the
  33.  *      corners of the box.
  34.  *
  35.  *      <cColour> is an optional colour string.
  36.  *
  37.  *      <cBoxLines> are the optional box lines to use.
  38.  *
  39.  *      <cTitle> is the optional title.
  40.  *
  41.  *      <lShadow> shadow the box ?
  42.  *  $RETURNS$
  43.  *      .T. / .F. based on the success.
  44.  *  $DESCRIPTION$
  45.  *      Display a boxed window on the screen.
  46.  *  $EXAMPLES$
  47.  *      // Window, default colours, lines and shadow and no
  48.  *      // title
  49.  *      GT_Window(05,10,15,20)
  50.  *  $SEEALSO$
  51.  *
  52.  *  $INCLUDE$
  53.  *
  54.  *  $END$
  55.  */
  56.  
  57. #include "GT_LIB.ch"
  58.  
  59. FUNCTION GT_Window(nTop,nLeft,nBottom,nRight,cLines, ;
  60.     cColour,cTitle,lShadow)
  61.  
  62. LOCAL cSaveColour := SETCOLOR()
  63. LOCAL cTemp
  64.  
  65. Default nTop to -1
  66. Default nLeft to -1
  67. Default nBottom to -1
  68. Default nRight to -1
  69. Default cLines to BOX_SS
  70. Default cColour to SETCOLOR()
  71. Default cTitle to ''
  72. Default lShadow to .T.
  73.  
  74. SETCOLOR(cColour)
  75.  
  76. //  Shadow ?
  77. IF lShadow
  78.     lShadow := nBottom < Maxrow() .AND. ;
  79.         nRight < (Maxcol() - 1) .AND. ;
  80.         nTop > 2 .AND. nLeft > 1
  81. ENDIF
  82.  
  83. //  Draw !
  84. DISPBOX(nTop,nLeft,nBottom,nRight,cLines,cColour)
  85.  
  86. //  Title ?
  87. IF .NOT. EMPTY(cTitle)
  88.  
  89.     @ nTop, nLeft + 01 SAY SUBSTR(cLines,10,1) + ' ' + ;
  90.         cTitle + ' ' + SUBSTR(cLines,11,1)
  91.  
  92. ENDIF
  93.  
  94. //  Shadow ?
  95. IF lShadow
  96.  
  97.     GT_Shadow(nTop,nLeft,nBottom,nRight)
  98.  
  99. ENDIF
  100.  
  101. //  Restore
  102. SETCOLOR(cSaveColour)
  103.  
  104. /*
  105.     End of GT_Window()
  106. */
  107. Return(NIL) // 
  108.