[Previous] [Contents] [Index] [Next]

PgDrawBevelBox(), PgDrawIBevelBox()

Draw a beveled box

Synopsis:

int  PgDrawBevelBox( PhRect_t const *rect,
                     PgColor_t secondary,
                     short width,
                     int flags );

int  PgDrawIBevelBox( int x1, int y1,
                      int x2, int y2,
                      PgColor_t secondary,
                      short width,
                      int flags );

Description:

These functions build a command in the draw buffer to draw a beveled box. This box is used for the outlines of buttons and panes.

The upper and left edges of the box are drawn in the current stroke color; the lower and right edges are drawn in the secondary color. The width argument determines the thickness of the lines.


Note: For PgDrawBevelBox(), the width parameter must be <= 15.

When you increase the thickness, the lines grow toward the middle of the beveled box. The maximum width is given by Pg_BEVEL_MAX.

The flags argument must be one of the following:


Note: PgDrawBevelBox() requires a pointer to a PhRect_t structure, whereas PgDrawIBevelBox() takes individual arguments.

Returns:

0
Success.
-1
The draw buffer is too small to hold the current draw state and the draw command.

Examples:

The following example:

DrawBevelBox() {
    PhRect_t r = { 8, 8, 152, 112 };
    PgSetFillColor( Pg_GREY );
    PgSetStrokeColor( Pg_WHITE );
    PgDrawBevelBox( &r, Pg_DGREY, 4, 
                    Pg_DRAW_FILL_STROKE );
}

will draw:

PgDrawBevelBox

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgDrawBeveled(), PgDrawRect(), PgSetFillColor(), PgSetFillDither(), PgSetFillTransPat(), PgSetStrokeColor(), PgSetStrokeDither(), PgSetStrokeTransPat()


[Previous] [Contents] [Index] [Next]