Writing a Row of Characters

A function is provided to write a certain character-attribute pair, a certain character, or a certain attribute in rows. You can use this function to fill an area of the window with a block graphic character or highlight part of a window with a certain attribute.

Output starts at the specified position and continues on the row until the specified number of characters is written. If the end of the row is reached and there are still more characters to write, output goes to the beginning of the next row. When the end of the window buffer is reached, output stops. The window write options are not respected, so no scrolling occurs and the virtual cursor does not move.

v_chattrow() returns the number of characters left to write. If 0 is returned, the specified number of characters were written.

To write a row of characters using the window attribute, use the video row quantity of characters with attribute function, v_chattrow():

int v_chattrow(wn_row, wn_col, ch, att, q, mv_type, wnp)
 
int wn_row;
/* Row of window to start writing at
*/
int wn_col;
/* Column of window to start writing at
*/
UCHAR ch;
/* Character to write
*/
UCHAR att;
/* Attribute to use to write character
*/
int q;
/* Quantity of characters to write
*/
int mv_type;
/* Type of move:  CH, CHATT, ATT
*/
WINDOWPTR wnp;
/* Pointer to window to write to
*/

For the argument q, you can specify ENDROW to write characters to the end of the current row, or ENDWN to fill the rest of the window buffer with the specified character.

The type of move, mv_type, is interpreted as follows:

CH Writes just the characters to the window without changing the attributes in the window. The specified attribute is ignored.
CHATT Writes the character using the specified attribute. If you want to use the window attribute, specify the name of the window attribute explicitly or use wnp->att.
ATT Writes just the attribute to the window. The specified string is ignored.

For example, to fill a window with the block graphics character CH_LIGHTSHADE, call the following:

WINDOWPTR wnp;

...

wnp = wn_def(0, 0, 10, 80, LNORMAL, BDR_SLNP);

v_chattrow(0, 0, CH_LIGHTSHADE, 0, ENDWN, CH, wnp);

wn_up(wnp);

Because mv_type is set to CH, the specified attribute is ignored


Home Contents Previous Next