CK_Object
|
+----CK_Component
|
+----CK_Manager
|
+----CK_RowColumn
The CK_RowColumn component is a
manager that lays out its children in a row or in a column. The row-column can
have any number of children, and its width and height are determined by the
children. Because of this, the CP_Width
and CP_Height properties should never
be explicitly set by the application.
The row-column can have a transparent
background, a solid color background, or a bitmap background. If the background
is a bitmap, it can be tiled to cover the entire row-column. If the bitmap (CP_Bitmap)
property is set, the CP_BgColor property
will be ignored.
The CP_BorderX
and CP_BorderY properties can be set
to provide a border around the entire row-column. The CP_ComponentSpacing
property can be used to set the spacing between each child in the row-column.
The total size of a row-column is determined by the children, the borders, and
the spacing. Unless the border or spacing properties are set, the default is
0.
The CP_LayoutDirection
property can be set to CV_LayoutHorizontal or CV_LayoutVertical
so that the children in arranged in a horizontal or vertical row. If the children
are layed out horizontally, the CP_VerticalAlign
property can be set to align the tops of the children, the bottoms, or the centers.
Likewise, if the children are layed out vertically, the CP_HorizontalAlign
property can be set to align the left sides, the right sides, or the centers.
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 row-column.
- 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 row-column to draw the bitmap. This
is 0 by default.
- CP_BitmapY
- The Y offset from the top of the row-column to draw the bitmap.
This is 0 by default.
- CP_BorderX
- The width in pixels of the border on the left and right sides of the entire
row-column component.
- CP_BorderY
- The height in pixels of the border on the top and bottom of the
entire row-column 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_ComponentSpacing
- The number of pixels between each child component in the row-column.
- CP_Cursor
- The cursor to be displayed when the mouse pointer is over the component.
(v1.02)
- CP_Height
- Never set explicitly because the height is determined by the child components,
spacing, and borders. The height can be obtained after the row-column is created
by getting the value of this property.
- CP_HorizontalAlign
- Used when children are layed out vertically. Tells whether the
children should be left-edge aligned, right-edge aligned, or centered. Possible
values are CV_HorizAlignCenter, CV_HorizAlignLeft, and CV_HorizAlignRight.
- CP_LayoutDirection
- Determines whether to layout the children horizontally or vertically. Can
be CV_LayoutHorizontal or CV_LayoutVertical.
- 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 row-column.
- CP_VerticalAlign
- Used when children are layed out horizontally. Tells whether children should
be top aligned, bottom aligned, or vertically centered. Possible values are
CV_VertAlignBottom, CV_VertAlignTop, and CV_VertAlignCenter.
- CP_Width-
Never set explicitly because the width is determined by the child components,
spacing, and borders. The width can be obtained after the row-column 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 row-column:
CK_Bitmap *texture;
RGBQUAD bg;
bg.rgbRed = bg.rgbBlue = bg.rgbGreen = 0
// Create a row-column with a black background
CK_RowColumn *rc1 = (CK_RowColumn *) CreateComponent(CT_RowColumn, 0,
CP_BgColor, &bg,
CP_LayoutDirection, CV_LayoutHorizontal,
CP_VerticalAlign, CV_VertAlignCenter,
CP_ComponentSpacing, 10,
CP_BorderX, 10,
CP_BorderY, 10,
0);
// Create a row-column with a tiled bitmap as the background.
CK_BBoard *bb2 = (CK_BBoard *) CreateComponent(CT_BBoard, 0,
CP_Bitmap, texture,
CP_TiledBitmap, 1
CP_LayoutDirection, CV_LayoutVertical,
0);