Creating Your Own Border Types

Read this section if you want to define a border that is different from any that the Vermont Views system provides.

Borders are controlled by the typdef BORDER structure defined in the header file vv_sys.h. The structure contains members that specify the characters used for each character type used in the border.

typdef struct border_struct
 
{
 
*/
    UCHAR up_ch;
/* Upper horizontal character
*/
    UCHAR low_ch;
/* Lower horizontal character
*/
    UCHAR lft_ch;
/* Left vertical character
*/
    UCHAR rt_ch;
/* Right vertical character
*/
    UCHAR uplft_ch;
/* Upper left corner character
*/
    UCHAR uprt_ch;
/* Upper right corner character
*/
    UCHAR lowrt_ch;
/* Lower right corner character
*/
    UCHAR lowlft_ch;
/* Lower left corner character
*/
} BORDER, *BORDERPTR;
   

Code: To create your own borders, do the following:

Step 1: Define a global border structure of type Border:BORDER and initialize the structure members. For example, to define a border that is double-lined for the top and bottom border and single-lined for the side borders, you would add the following statement to your global declarations:

BORDER bdr_mix {205, 205, 179, 179, 213, 184, 190, 212};

The numbers 205, 179, 213, 184, 190 and 212 represent the ASCII characters for single and double lines.

Step 2: Create a #defined name to the pointer of your border structure. The system borders are #defined in vv_sys.h. For example:

#define BDR_MIXP &bdr_mix;

Now you can use BDR_MIXP as an argument where a Border:BORDERPTR is expected.

Alternatively, you can use the pointer to your border structure directly in the call. For example,

sw_bdr(&bdr_mix, NOCHANGE, wnp);


Home Contents Previous Next