Product Home Class IndexDownload

CK_Frame

CK_Object
   |
   +----CK_Component
           |
           +----CK_Manager
                   |
                   +----CK_Frame

A frame is a manager component that can only have one child. A frame can have a transparent background, a solid color background, or a bitmap background. If both the background color (CP_BgColor) and the background bitmap (CP_Bitmap) properties are set, the bitmap will take precedence.

The frame automatically takes the size of its child. Because of this, the CP_Width and CP_Height properties should never be explicitly set. The frame can set a border around its child by setting the CP_BorderX and CP_BorderY properties. The total size of the frame is the combined size of the child component plus the borders.

Properties

Examples of creating a frame:

extern CK_Bitmap *texture;
RGBQUAD bg;

bg.rgbRed = bg.rgbBlue = bg.rgbGreen = 0

// Create a frame that puts a 5-pixel wide black border around its child.
CK_Frame *frame1 = (CK_Frame *) CreateComponent(CT_Frame, 0,
    CP_BgColor, &bg,
    CP_BorderX, 5,
    CP_BorderY, 5,
    0);

// Create a frame that has no border, but just serves to place a texture bitmap
// under the child component.
CK_Frame *frame2 = (CK_Frame *) CreateComponent(CT_Frame, 0,
    CP_Bitmap, texture,
    CP_TiledBitmap, 1,
    0);