You can assign a title to a window. The title is printed in the window border. You can specify the location and attribute of the title.
Designer: You can specify the title, title location, and attribute with the Designer, or you can assign them in your code at any point after you have read the window from the Designer library.
Code: To specify the title to appear in the window border, its video attribute and its location, use the set window title function, sw_title():
|
||
|
|
|
|
|
|
|
|
|
|
|
|
For stp, specify the string you want to appear in the border.
For att, specify the logical attribute to use for the title. For Designer windows, specify a logical attribute that is in the logical attribute table for the library. For windows defined in code, specify a logical attribute from the system logical attribute table, or from the logical attribute table attached to the window, if you attached one.
For loc, specify one of the following locations:
| TOPLEFT TOPCENTER TOPRIGHT BOTTOMLEFT BOTTOMCENTER BOTTOMRIGHT |
The title will not cover a corner character or the character adjacent to the corner character. For example, if you specify TOPLEFT as the location, the top border will contain the top left corner character and one border character, followed by your title text.
If the window does not have a border (border type is BDR_NULLP), no title will appear even if one is specified.
If you change the border title, attribute, or location for a window that is displayed, call v_bdr() to update the screen.
You can only have one title per window. If you call sw_title() a second time for the same window, the first title is removed.
Note: The title cannot cover any corner character or the character adjacent to the corner character. Therefore, the maximum length that can be displayed is the number of columns in the window minus four (4). If the title is too long to fit in the border, Vermont Views will display as much of the title text as possible. The displayed text is truncated immediately after the last full word that fits in the border. If the title 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_title(); 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.
Removing a Title from the Border