Displaying Border Text

A title is a special case of border text. A window can have only one title. However, you can add other border text to the window by calling the set window border text function, sw_bdrtxt(). You can create a total of twelve separate border texts (including the title) per window. Each border text can have its own attribute.

Code: To specify the text to appear in the window border, its video attribute and its location, use the set window border text function, sw_bdrtxt():

int sw_bdrtxt(textp, border, justify, att, wnp)
 
UCHAR *textp;
/* Pointer to a text string
*/
int border;
/* Border to place text string in
*/
int justify;    
/* How to justify the string in the border 
*/
UCHAR att;
/* Attribute for this border text
*/
WINDOWPTR wnp;
/* Pointer to the window the text is for
*/

For textp, specify the border text string for that border location.

For border, specify the side of the window that will contain the border text: LEFT, RIGHT, TOP, or BOTTOM.

For justify, specify how to justify the text within the specified side of the window:

LEFT Left-justifies the text within a horizontal border
RIGHT Right-justifies the text within a horizontal border
CENTER Centers the text within the specified border
TOP Top-justifies the text within a vertical border
BOTTOM Bottom-justifies the text within a vertical border

For att, specify an attribute for the text, or NOCHANGE to use the border atribute.

The next time the window is displayed or its border is updated with v_bdr(), the updated border text will be displayed.

If the window does not have a border, no border text will be displayed. If a border is added, the text will automatically appear in it.

If you add two pieces of border text to the same location in the same window, the first border text is removed. In addition, if you add a title to the window in the same location as an existing border text, the border text is removed.

Note: The border text does not cover any corner character or the character adjacent to the corner character. Therefore, the maximum length that can be displayed in a horizontal border is the number of columns in the window minus four (4); the maximum length that can be displayed in a vertical border is the number of rows in the window minus four. If the border text is too long to fit in the border, Vermont Views will display as much of the border text as possible. The displayed text is truncated immediately after the last full word that fits in the border. If the border text is one word, the displayed text is truncated so that it fits in the border. Vermont Views does not truncate the actual string passed into sw_bdrtxt(); it simply does not display the entire string if the string is too long to fit in the border. If the user resizes the window, Vermont Views recalculates and again displays as much of the text as will fit in the border.


Home Contents Previous Next