home *** CD-ROM | disk | FTP | other *** search
- /*
- ptdchar.c 7/11/88
-
- % Character oriented window painting code for use by border windows.
- By Ted.
-
- OWL 1.1
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 7/27/88 jmd Converted DrawLine to take an opbox
- 8/22/88 jmd Fixed HZ line bug in DrawLine
- 9/08/89 gam Added minimum check in call to ptd_PlotTextBuf
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- /* -------------------------------------------------------------------------- */
-
- void ptd_DrawString(ptd, row, col, string, attr, slen)
- ptd_struct *ptd;
- int row;
- int col;
- char *string;
- byte attr;
- int slen;
- {
- /*
- Draws string into window ptd->win, clipped into box ptd->relboxp,
- at row, col. Pads string w/ blanks out to slen, or clips it at slen.
- */
- ofont_type font;
- opcoord x, y;
- int len;
-
- font = win_GetFont(ptd->win);
-
- x = col * ofont_GetWidth(font);
- y = (row+1) * ofont_GetHeight(font);
-
- len = strlen(string);
- ptd_PlotTextbuf(ptd, x, y, string, attr, omin(len, slen));
-
- if (slen > len) {
- x += len * ofont_GetWidth(font);
- ptd_PlotChar(ptd, x, y, ' ', attr, slen - len);
- }
- }
- /* -------------------------------------------------------------------------- */
-
-