Class that draws a rounded rectangle, using Windows API GDI calls.
A rounded rectangle is a region whose location is determined by the Left, Top, Right and Bottom properties of this class. The angles of the corners of the rectangle are always drawn at 90 degrees. The corners of the rectangle are rounded off based on the value of the Height and Width properties. The routines in this class allow you to draw the rounded rectangle by calling the Windows API RoundRect function.
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CGDIRoundRect class
|
|
BorderColor
|
Property
|
Sets the value of the color used to draw the rounded rectangle
|
|
BorderWidth
|
Property
|
Sets the value of the BorderWidth used to draw the rounded rectangle
|
|
Bottom
|
Property
|
Sets the Bottom location of the rounded rectangle
|
|
BrushStyle
|
Property
|
Sets the current style used to fill the rounded rectangle.
The value of this property should be set to one of the Windows API Brush Style constants (BS_SOLID, BS_HOLLOW, BS_HATCHED etc.) which are exposed as EnumRoundRectBrushStyles constants in this class.
|
|
FillColor
|
Property
|
Gets the current value of the color used to fill the rounded rectangle
|
|
ForegroundMixMode
|
Property
|
Gets the current value of the ForegroundMixMode property, which defines how colors from the pen and the colors in the existing image are to be combined.
The value should be one of the enumerated raster op values exposed in EnumRoundRectRasterOps, or the equivalent VB "DrawModeConstants", such as vbCopyPen, vbXorPen etc. See "Drawing Constants" in the VB on-line help.
|
|
HatchStyle
|
Property
|
Gets the current value of the style used to fill the rounded rectangle when the BrushStyle is set to hatched.
The value of this property should be set to one of the Windows API Hatch Style constants (HS_HORIZONTAL, HS_BDIAGONAL, HS_CROSS etc.) which are exposed as EnumRoundRectHatchStyles constants in this class.
|
|
Height
|
Property
|
Gets the height of the ellipse used to draw rounded corners of the rectangle.
This value controls how "rounded" the rounded corners of the rectangle will be (i.e. where the ellipse used to draw the corner is located.)
|
|
Left
|
Property
|
Gets the Left location of the rounded rectangle
|
|
PenStyle
|
Property
|
Gets the value of the style used to draw the rounded rectangle.
The value of this property should be set to one of the Windows API Pen Style constants (PS_SOLID, PS_DASHDOT etc.) which are exposed as EnumRoundRectPenStyles constants in this class.
|
|
Right
|
Property
|
Gets the Right location of the rounded rectangle
|
|
Top
|
Property
|
Gets the Top location of the rounded rectangle
|
|
Width
|
Property
|
Sets the width of the ellipse used to draw rounded corners of the rectangle.
This value controls how "rounded" the rounded corners of the rectangle will be (i.e. where the ellipse used to draw the corner is located.)
|
|
Class_Initialize
|
Initialize
|
Set initial values to defaults which may be overridden with property settings
|
|
Draw3DRoundRect
|
Method
|
Draws two rounded rectangles on a selected device so that they create a 3D effect.
This method ignores the regular BorderColor and FillStyle properties, and instead uses the colors which are passed to it to draw a 3D rounded rectangle.
|
|
DrawRoundRect
|
Method
|
Draw a rounded rectangle on a selected device.
|
|
TranslateVBColor
|
Private
|
Translates VB color constants for system colors into GDI equivalents.
VB color constants, such as vbRed, or vbBlue, or values returned using the QBColor() or RGB() functions, can be used directly for the color values used with Windows API calls. However, the VB color constants for system colors (vbButtonFace, vb3DShadow etc.) do not map correctly to those expected by Windows. This wrapper function accepts either form of constant, and translates the value, if necessary, into the equivalent value expected by the Windows GDI subsystem.
|