home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / BORDDRWT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-28  |  1.1 KB  |  54 lines

  1. /*
  2.       borddrwt.c        5/7/87
  3.  
  4.     % bd_DrawTitle()
  5.  
  6.     OWL 1.2
  7.     Copyright (c) 1986, 1987, by Oakland Group, Inc.
  8.     ALL RIGHTS RESERVED.
  9.  
  10.     Revision History:
  11.     -----------------
  12.      7/27/88 jmd     Upgraded to new border stuff
  13.      8/13/88 jmd     Changed name to bord_DrawTitle
  14.     11/13/88 jmd     removed test for negative row
  15.      3/31/89 ted    Renamed from bdtools.c.
  16.  
  17.      3/28/90 jmd    ansi-fied
  18. */
  19.  
  20. #include "oakhead.h"
  21. #include "disppriv.h"
  22. #include "bordobj.h"
  23. #include "bordod.h"
  24. /* -------------------------------------------------------------------------- */
  25.  
  26. void bord_DrawTitle(ptd_struct *ptd, int row, int col, char *title, byte attr, int width)
  27. /*
  28.     Draws the title at row and column.
  29.     Breaks at newlines
  30. */
  31. {
  32.     char *p, *t, temp;
  33.  
  34.     if (title == NULL) {
  35.         return;
  36.     }
  37.  
  38.     p = title;
  39.     do {
  40.         t = p;
  41.         while (*p != '\n' && *p != '\0') {
  42.             p++;
  43.         }
  44.         temp = *p;
  45.         *p = '\0';
  46.         ptd_DrawString(ptd, row, col, t, attr, width);
  47.         row++;
  48.         *p = temp;
  49.     }
  50.     while(*p++ != '\0' && *p != '\0');
  51. }
  52. /* -------------------------------------------------------------------------- */
  53.  
  54.