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

  1. /*
  2.  * File......: BARBOX.PRG
  3.  * Author....: Martin Colloby
  4.  * BBS.......: The Dark Knight Returns
  5.  * Net/Node..: 050/069
  6.  * User Name.: Martin Colloby
  7.  * Date......: 18/4/93
  8.  * Revision..: 1.0
  9.  *
  10.  * This is an original work by Martin Colloby and is placed in the public
  11.  * domain.
  12.  *
  13.  * Modification history:
  14.  * ---------------------
  15.  *
  16.  * $Log$
  17.  *
  18.  */
  19.  
  20.  
  21. /*  $DOC$
  22.  *  $FUNCNAME$
  23.  *      GT_BARBOX()
  24.  *  $CATEGORY$
  25.  *      Video
  26.  *  $ONELINER$
  27.  *      Display a box containing a bar area
  28.  *  $SYNTAX$
  29.  *      GT_BarBox( nTop , nLeft , cTitle )
  30.  *  $ARGUMENTS$
  31.  *      nTop   - Top row of box
  32.  *      nLeft  - Left column of box (-1 to centre)
  33.  *      cTitle - Title of box
  34.  *  $RETURNS$
  35.  *      NIL
  36.  *  $DESCRIPTION$
  37.  *      Similar to GT_BarInit(), but doesn't clear the screen.  This function
  38.  *      displays a shadowed box containing the bar area, with the title
  39.  *      written over the top left side of the box
  40.  *  $EXAMPLES$
  41.  *
  42.  *  $SEEALSO$
  43.  *
  44.  *  $INCLUDE$
  45.  *      GT_LIB.CH
  46.  *  $END$
  47.  */
  48.  
  49. *
  50. #include "GT_lib.ch"
  51.  
  52. FUNCTION GT_BarBox( nTop , nLeft , cTitle )
  53.  
  54. /*****************************************************************************
  55.  Purpose - Initialise a moving bar chart box
  56.  Returns - None
  57.  Author  - Martin Colloby
  58.  Created - 05/08/91
  59. ******************************************************************************
  60.  Parameters - nTop
  61.               nLeft
  62.               cTitle - Title for screen
  63.  Privates   - None
  64.  Locals     - None
  65.  Externals  - None
  66. *****************************************************************************/
  67.  
  68. LOCAL nRight
  69. LOCAL nBottom
  70.  
  71. DEFAULT nTop  TO MAXROW() - 5
  72. DEFAULT nLeft TO 20
  73.  
  74. nLeft := IIF( nLeft > MAXCOL() - 47 , 20 , nLeft )
  75. nLeft := IIF( nLeft == -1 , 20 , nLeft )
  76.  
  77. nRight  := nLeft + 46
  78. nBottom := nTop  + 4
  79.  
  80. cTitle := LEFT( cTitle , 27 )
  81.  
  82. GT_ColorSet( C_NORMAL )
  83. * Output a blank box with a title
  84. @ nTop , nLeft  CLEAR TO nBottom , nRight
  85. @ nTop , nLeft , nBottom , nRight BOX B_DOUBLE
  86. @ nTop , nLeft + 2 SAY cTitle
  87. GT_Shadow( nTop , nLeft , nBottom , nRight )
  88.  
  89. * Output the skeleton of the bar chart
  90. @ nBottom - 3 , nLeft + 2 SAY "                                           "
  91. @ nBottom - 2 , nLeft + 2 SAY "┌──────┬───────┬───────┬───────┬───────┐   "
  92. @ nBottom - 1 , nLeft + 2 SAY "0      20      40      60      80      100%"
  93.  
  94. RETURN NIL
  95. *
  96.