[Classes] [Prev] [Next] [Methods]

CBrush

Methods Index

Heritage
Description
Usage
Protected Data Members
CBrush Attributes
Public Methods
Constructor, Destructor, and Initializer Methods
Helper Operators
State Methods

CBrush


Heritage

Superclass: None

Subclassess: None


Description

The CBrush class encapsulates XVT brushes. A CBrush object describes the color and the pattern used to fill the interior of the following shapes: rectangle, rounded rectangle, oval, pie, and polygon. A CPen object is used to draw the perimeter of these closed shapes.

The color is indicated by RGB values. XVT uses a 24-bit number to specify a color. The 24 bits are divided into three 8-bit values for the red, green, and blue components.

For your convenience, XVT provides symbols for the brush colors listed in Table 1. You can use other colors if you wish. However, if your target platform doesn't flexibly support color, XVT recommends that you use one of the predefined colors.

The pattern specifies the brush pattern, which has the allowable values shown in Table 2.

Table 1. Predefined XVT Portability Toolkit Color Variables
Color Symbol Color
#define COLOR_INVALID
Error return
#define COLOR_RED
Red
#define COLOR_GREEN
Green
#define COLOR_BLUE
Blue
#define COLOR_CYAN
Cyan
#define COLOR_MAGENTA
Magenta
#define COLOR_YELLOW
Yellow
#define COLOR_BLACK
Black
#define COLOR_DKGRAY
Dark Gray
#define COLOR_GRAY
Gray
#define COLOR_LTGRAY
Light Gray
#define COLOR_WHITE
White

Table 2. Predefined XVT Portability Toolkit Brush Patterns
Pattern Symbol Brush Pattern
PAT_SOLID
Solid fill
PAT_HOLLOW
Hollow
PAT_HORZ
Horizontal
PAT_VERT
Vertical
PAT_FDIAG
Forward diagonal
PAT_BDIAG
Backward diagonal
PAT_CROSS
Crisscross
PAT_DIAGCROSS
Diagonal crisscross

Note: Open spaces of a pattern are drawn in the object's background color.

See Also: For information on defining the perimeter of closed shapes, see CPen. For information on other "environmental" attributes, see CEnvironment.


Usage

CBrush aBrush(COLOR_RED, PAT_SOLID);

CBRUSH anXVTBrush = aBrush;
xvt_dwin_set_cbrush(itsXVTWindow, &anXVTBrush);

xvt_dwin_set_back_color(itsXVTWindow,
aBrush.GetColor());

Protected Data Members

CBrush Attributes

CBRUSH itsBrush; The brush


Public Methods

Constructor, Destructor, and Initializer Methods

CBrush();
CBrush(COLOR theColor, PAT_STYLE thePattern);
CBrush(CBRUSH theBrush);
CBrush(const CBrush &theBrush);
CBrush & operator = (const CBrush &theBrush);
~CBrush();

Helper Operators

operator CBRUSH () const;
CBrush & operator = (CBRUSH theBrush);

State Methods

void IBrush(COLOR theColor, PAT_STYLE thePattern);
void SetColor(COLOR theColor);
void SetPattern(PAT_STYLE thePattern);
COLOR GetColor(void) const;
PAT_STYLE GetPattern(void) const;
This is a free floating class. There are no inherited methods.



[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.