CK_Object
|
+----CK_Component
|
+----CK_Manager
|
+----CK_BBoard
This is a bulletin-board manager
component. A bulletin board can have any number of children. It has a fixed
size, which means that the width and height properties must be set. A bulletin
board draws its children at each child's CP_RelativeX, CP_RelativeY coordinates
relative to the upper left corner of the bulletin board. If a child component
extends beyond the edges of the bulletin board, it will be clipped and only
the non-clipped portion of the child will be visible. It is allowable for a
bulletin board to have children located completely outside the boundaries of
the bulletin board.
If children of a bulletin board
overlap each other, the order of drawing each child can be controlled by setting
each child's CP_ZOrder property. The bulletin board will draw child components
with the lower Z-order first.
The background of a bulletin board
can be filled with a solid color, or it can be a bitmap. It is possible to draw
the bitmap tiled so as to fill then entire background. If both the CP_BgColor
and CP_Bitmap properties are set, the background color will be ignored because
the background bitmap was specified.
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 bulletin board. Setting
the CP_Bitmap does not change the bulletin boards height or width as it does
with label components.
- 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 bulletin board to draw the bitmap.
This is 0 by default.
- CP_BitmapY
- The Y offset from the top of the bulletin board to draw the bitmap.
This is 0 by default.
- 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
- The height in pixels of the bulletin board. The width and height must be
set for all bulletin boards.
- 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 bulletin board.
- CP_Width
- The width in pixels of the bulletin board. The width and height must be
set for all bulletin boards.
- 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 bulletin
board:
CK_Bitmap *texture;
RGBQUAD bg;
bg.rgbRed = bg.rgbBlue = bg.rgbGreen = 0
// Create a solid-black bulletin board.
CK_BBoard *bb1 = (CK_BBoard *) CreateComponent(CT_BBoard, 0,
CP_BgColor, &bg,
CP_Width, 640,
CP_Height, 480,
0);
// Create a bulletin board with a tiled bitmap as the background.
CK_BBoard *bb2 = (CK_BBoard *) CreateComponent(CT_BBoard, 0,
CP_Bitmap, texture,
CP_TiledBitmap, 1
CP_Width, 640,
CP_Height, 480,
0);