Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Chart User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

7.3 Component Panel Appearance

The appearance of a component's background, border, and shadow are controlled by settings in the component's style data member.

SRGraphComponent::GetStyle() returns a pointer to the component's style object.

These functions control the general appearance of the component:

For example, the code below creates a title component with a gradient fill, a thick border, and a medium shadow.

The component style settings are discussed in the following sections.

7.3.1 Component Border Styles

Use SetComponentBorderStyle() to select the border styles presented in Table 5.

Table 4: Border styles

Border Style Description
CX_NO_BORDER  
CX_THIN_RAISED_BORDER The panel appears to be raised above the surface.
CX_THIN_SUNKEN_BORDER The panel is let into the surface.
CX_THIN_3D_BORDER The panel has beveled edges.
CX_THICK_RAISED_BORDER  
CX_THICK_SUNKEN_BORDER  
CX_THICK_3D_BORDER This style is similar to those above but is more pronounced.
CX_LINE_BORDER The border is a simple line whose color is determined by the frame color of the local style member.
CX_USER_BORDER User defined — override DrawCustomBorder()

7.3.2 Component Shadow Styles

The following shadow styles can be selected with SetComponentShadowStyle().

Table 5: Shadow styles

CX_NO_SHADOW
CX_THIN_SHADOW
CX_MEDIUM_SHADOW
CX_THICK_SHADOW
CX_USER_SHADOW User defined — override DrawCustomShadow()

7.3.3 Component Fill Styles

A component may be filled with a solid color, a color gradient, or a tiled or stretched image from the application's resources or a bitmap, DIB, or JPEG file. Components may also be left with no fill, in which case any data or text that the component displays on its foreground is superimposed on anything already on the page or window.

The following fill styles can be selected with SetComponentFillStyle().

Table 6: Fill styles

Fill Style Description
CX_NO_FILL No drawing takes place. The panel is transparent.
CX_SOLID_FILL The color in the m_RGBColorA member of the local style is used. See SRGraphStyle::SetColor(color).
CX_VERTICAL_FILL A vertical color gradient from the m_RGBColorA (top) to the m_RGBColorB (bottom) member of the local style is created. See SRGraphStyle::SetColor(a,b).
CX_HORIZONTAL_FILL Similar to the above setting but the gradient goes left to right.
CX_ANGLE_FILL A gradient is drawn at an angle determined by the m_dAngle member of the local style. See SRGraphStyle::SetAngle().
CX_RESOURCE_FILL Uses a bitmap resource from the application's resources to tile or stretch fill the panel. Tiling or stretching is controlled by SRGraphStyle::SetStretchMode(). The name of the resource is set by SRGraphStyle::SetResourceName().
CX_IMAGE_FILL Uses an image read from a bitmap, DIB, or JPEG file on disk. SetResourceName() and SetStretchMode() select the image file and how it is displayed.
CX_USER_FILL User defined — override DrawCustomRgnFill()

As noted, these fill styles may require the specification of other settings.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.