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

  1. /*
  2.     File......: GT_NewScreen.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_NEWSCREEN()
  23.  *  $CATEGORY$
  24.  *      Video
  25.  *  $ONELINER$
  26.  *      Completely redraw the screen with a header.
  27.  *  $SYNTAX$
  28.  *      GT_NewScreen([<cTitle>],[<cCopyRight>],<cVersion>],
  29.  *                   [<cMainColour>],[<cTopColour>])
  30.  *  $ARGUMENTS$
  31.  *      <cTitle> is the title tobe displayed centered.
  32.  *
  33.  *      <cCopyRight> is the message to be displayed top
  34.  *      left.
  35.  *
  36.  *      <cVersion> is the version number to be displayed
  37.  *      under <cCopyRight>.
  38.  *
  39.  *      <cMainColour> is the colour pair for the main
  40.  *      screen. A normal colour string may be used and the
  41.  *      first pair will be extracted.
  42.  *
  43.  *      <cTopColour> is the colour pair for the header of
  44.  *      the screen. A normal colour string may be used and
  45.  *      the first pair will be extracted.
  46.  *  $RETURNS$
  47.  *      .T. / .F. based on success.
  48.  *  $DESCRIPTION$
  49.  *      Completely redraw the screen with a header.
  50.  *  $EXAMPLES$
  51.  *      // Blank header
  52.  *      GT_NewScreen()
  53.  *
  54.  *      // Header with info using standard colours
  55.  *      GT_NewScreen( Stock Control',  ;
  56.  *                    '(C) ComputAssist 1989/93', ;
  57.  *                    'Rev 1.01a')
  58.  *  $SEEALSO$
  59.  *
  60.  *  $INCLUDE$
  61.  *
  62.  *  $END$
  63.  */
  64.  
  65. #include "GT_LIB.ch"
  66.  
  67. FUNCTION GT_NewScreen(cTitle,cCopyRight,cVersion, ;
  68.     cMainColour,cTopColour)
  69.  
  70. LOCAL cColour := SETCOLOR()
  71. LOCAL cDate := GT_TextDate(DATE())
  72.  
  73. Default cTitle to ''
  74. Default cCopyRight to ''
  75. Default cVersion to ''
  76. Default cMainColour to SETCOLOR()
  77. Default cTopColour to SETCOLOR()
  78.  
  79. //  Set colour to standard & clear screen
  80. SETCOLOR(cMainColour)
  81. DISPBOX(00,00,MAXROW(),MAXCOL(),'▒▒▒▒▒▒▒▒▒')
  82.  
  83. //  Set header
  84. SETCOLOR(cTopColour)
  85. SCROLL(00,00,01,MAXCOL(),0)
  86.  
  87. @ 00, 01 SAY cCopyRight
  88. @ 00, MAXCOL() - LEN(cDate) SAY cDate
  89.  
  90. @ 01, ((MAXCOL() - LEN(cTitle)) / 2) SAY cTitle
  91. @ 01, 01 SAY cVersion
  92.  
  93. //  Set colour back to standard
  94. SETCOLOR(cColour)
  95.  
  96. /*
  97.     End of GT_NewScreen()
  98. */
  99. RETURN(.T.) // 
  100.