Product Home Class IndexDownload

CK_RowColumn

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

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);