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
- CP_BgColor
- Fill background with this color if no bitmap is present.
- CP_Bitmap
- A CK_Bitmap to be drawn as the background for the frame.
- CP_BitmapRect
- Specifies a rectangular portion (CK_Rect) of the
CP_Bitmap to be used. Otherwise the entire bitmap is used. (v1.02)
- CP_BitmapX
- The X offset from the left edge of the frame to draw the bitmap. This is
0 by default.
- CP_BitmapY
- The Y offset from the top of the frame to draw the bitmap. This
is 0 by default.
- CP_BorderX
- The border width on the left and right sides of the child component.
- CP_BorderY
- The border height above and below the child component.
- CP_CallbackArg1
- An integer value to be passed to the screen's componentCB method
when an event occurs in this component.
- CP_CallbackArg2
- Same as CP_CallbackArg1.
- CP_Cursor
- The cursor to be displayed when the mouse pointer is over the component.
(v1.02)
- CP_Height
- Never explicitly set because the height is determined by the height of the
child component and the border. The height can be obtained after the frame
is created by getting the value of this property.
- CP_PaletteIndex
- If a bitmap is present, and it is 8-bit color, then this property will determine
which palette in the bitmap's palette set is to be used.
- CP_RelativeX
- Only used when this component is a child of a CK_BBoard or CK_ClipWindow.
It is the X position of the component relative to the parent's left edge.
- CP_RelativeY
- Only used when this component is a child of a CK_BBoard or CK_ClipWindow.
It is the Y position of the component relative to the parent's top edge.
- CP_TiledBitmap
- If TRUE, the background bitmap is tiled to fill the entire background of
the frame.
- CP_Width
- Never explicitly set because the width is determined by the width of the
child component and the border. The width can be obtained after the frame
is created by getting the value of this property.
- CP_X
- The absolute X-position, in screen coordinates, of the component. This can
only be set for the top-level component of a screen or a dialog.
- CP_Y
- The absolute Y-position, in screen coordinates, of the component. This can
only be set for the top-level component of a screen or a dialog.
- CP_ZOrder
- Used when this component is a child of a CK_BBoard. The CK_BBoard uses this
value to determine the order in which children are drawn. Smaller Z-order
values are drawn before larger Z-order values.
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);