Adding Boxes to a Menu

Boxes can be used to separate a group of menu fields from the rest of the menu fields.

Designer: Boxes can be added to your menu in the Designer. See the Designer User's Guide for more information.

Code: To define a box for a menu form, use the background box definition function, bg_boxdef():

BG_BOXPTR bg_boxdef(wn_rb, wn_cb, rowq, colq, att, bdrp, fmp)
 
int wn_rb;
/* Form row to begin drawing box
*/
int wn_cb;
/* Form column to begin drawing box
*/
int rowq;
/* Number of rows to make box
*/
int colq;
/* Number of columns to make box
*/
UCHAR att;
/* Video attribute to use to draw box
*/
BORDERPTR bdrp;
/* Border to use for box
*/
FORMPTR fmp;
/* Pointer to menu form to draw box on
*/

In the call, you specify the window coordinates where you want the upper-left corner of the box to start (wn_rb and wn_cb), the size of the box (rowq and colq), the type of characters to use to draw the box (bdrp), and the attribute to use to draw the box border (att). The box is not filled in with the specified attribute.

Possible border types for the box are shown in Table 21.2. If you want to create your own border type, see Chapter 25, "Changing the Appearance of Windows," for more information.

Table 21.2: Border Types

Border Pointer Type of Border
BDR_SLNP Single-line border
BDR_DLNP Double-line border
BDR_SPACEP Space character border
BDR_DOTP Stippled block graphics character or dot border
BDR_STARP Asterisk border
BDR_SOLIDP Solid block graphics character or space border


Border appearance is operating system dependent. In PCDOS or OS/2, single- and double-line boxes use the proper intersection characters when intersecting other single or double lines or boxes. In terminal versions, intersection characters are used only when lines of the same type intersect.

There are a number of limitations associated with output of block graphics characters in terminal versions. See Chapter 54, "Writing Portable Code," for more information on border-drawing, line-drawing and the block graphics attribute if you are using a terminal-based version of Vermont Views.


Home Contents Previous Next