This page gives a summary description of each type of component available in the library. Applications create displayable interface components by calling the CreateComponent global function.
CT_AdjustmentLayer
CT_BBoard
CT_ClipWindow
CT_Frame
CT_Label
CT_LineEdit
CT_RowColumn
CT_ScaledLabel
CT_ScrollHandle
CT_Viewport
CK_Label objects are probably the most commonly used interface component. They can be used to display non-editable text or bitmaps. They can also be programmed to behave as buttons by reacting to button up/down events. See CK_Label.
Properties
- CP_BgColor - Fill background with this color if no bitmap is present.
- CP_Bitmap - Bitmap to be rendered. The width & height of the label is automatically set to the width and height of the bitmap. Any text is drawn over the bitmap.
- CP_BitmapRect - Specifies a rectangular portion (CK_Rect) of the CP_Bitmap to be used. Otherwise the entire bitmap is used. (v1.02)
- CP_BorderX - The width in pixels of the border on the left and right sides of the label component. The text will not spill into the border. The border is included in the total width of the component.
- CP_BorderY - The height in pixels of the border on the top and bottom of the label component. The text will not spill into the border. The border is included in the total height of the 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_FgColor - Color of the text to be drawn. Only applies if the font is a CK_WindowsFont object.
- CP_Font - Font to be used in drawing the text. The default Windows font is used if no font property is set.
- CP_Height - Must be set if no bitmap is present. If a bitmap is present, the height will be set to the bitmap's height.
- CP_HorizontalAlign - Text can be left justified, centered, or right justified.
- 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_Text - The text to be drawn. If not set, then no text is drawn.
- CP_VerticalAlign - Vertical alignment of the text. Text can be top aligned, bottom aligned, or centered.
- CP_Width - Must be set if no bitmap is present. If a bitmap is present, the width will be set to the bitmap's width.
- 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.
A bulletin board is very often the top-level component of a screen. It is a manager component that can have any number of children. Each child component is drawn at the child's CP_RelativeX and CP_RelativeY coordinates relative to the top-left corner of the bulletin board. The bulletin board can have an optional bitmap that can serve as a background. The bitmap can be tiled. See CK_BBoard.
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.
A row-column component can layout it's children in a horizontal or vertical row. The size of the row-column is determined by the size of the children, the spacing between the children, and possibly a border surrounding the children. When the children are of different sizes, the row-column can align the children in different ways, such as top-aligned or centered. An optional bitmap can be specified to be drawn as a background. See CK_RowColumn.
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.
A frame is a manager component that can have one and only one child. It can also have a border, and optionally a bitmap or solid-color background. The width and height of the frame is determined by the sizeo f the child and the border size. See CK_Frame.
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 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.
A clip window is like a frame, except that the width and height are not determined by the child component. Like a frame, the clip window can only have one child, but the width and height of the clip window must be explicitly set. The clip-window is useful for providing a windowed view of a component that may be very large, such as a large row-column. The child component is drawn at the child's CP_RelativeX, CP_RelativeY property values, relative to the top-left corner of the clip-window. This behavior makes it possible to implement a scroll window by updating the child's relative X,Y properties in reaction to mouse movement in a CT_ScrollHandle component. See CK_ClipWindow.
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 clip window.
- 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 - The height in pixels of the clip-window. The width and height of the clip window are explicitly set, and is not determined by the size of the child component.
- 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 - The width in pixels of the clip-window. The width and height of the clip window are explicitly set, and is not determined by the size of the child component.
- 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.
A line-edit component is the same as a CT_Label, with the added ability to edit the text. When the left mouse button is clicked on the line-edit, the caret begins blinking and the line-edit will have keyboard focus. A right button click on the component will cause the keyboard focus to be lost, and the caret will stop blinking. The properties of the line-edit are the same as that for labels, with two additional properties: CP_BlinkDelay and CP_Caret. See CK_LineEdit.
Properties
- CP_BlinkDelay - The number of milliseconds between each caret blink.
- CP_Caret - A bitmap to be used as the blinking caret. If no caret is specified, the underscore character of the line-edit's font will be used.
The viewport component provides a rectangular area in which the application can provide the rendering. The CK_Viewport class will call the application's CK_Render callback object to do the rendering whenever the component is drawn. The proper way to update the contents of the viewport would be to mark the component as dirty using the CK_Component::setDirty() method, and then let the Chilkat engine redraw the viewport component.
A viewport component might be used to contain a tiled map. See CK_Viewport.
Properties
- 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 viewport.
- 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_Render - A pointer to a CK_Render object provided by the application that renders the contents of the viewport.
- CP_Width - The width in pixels of the viewport.
- 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.
A scroll handle component is actually both the scroll handle, and the channel. The channel can be vertical or horizontal. The CP_Bitmap property sets the bitmap for the handle. When the left mouse button is clicked on the handle and dragged, the handle will move. When the mouse button is released, the focus is lost and the handle will stop moving.
If a background bitmap for the channel is desired, the scroll handle can be placed in a frame (CK_Frame) that contains the background bitmap. See CK_ScrollHandle.
Properties
- CP_Bitmap - The bitmap representing the handle that moves within the channel.
- CP_BitmapRect - Specifies a rectangular portion (CK_Rect) of the CP_Bitmap to be used. Otherwise the entire bitmap is used. (v1.02)
- 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_ChannelLength - The logical length of the channel. Can be any positive number greater than 0. If the channel length is 100, then the handle position be 0 when the handle is at the top (or left) of the channel, and 99 when the handle is at the bottom (or right) of the channel.
- CP_Cursor - The cursor to be displayed when the mouse pointer is over the component. (v1.02)
- CP_HandlePosition - Represents the current logical position of the scroll handle. Setting this property will cause the scroll handle to move to that location.
- CP_Height - The height of the scroll channel. If the layout direction is horizontal, then the height is determined by the height of the handle bitmap.
- CP_LayoutDirection - Can be either CV_LayoutVertical or CV_LayoutHorizontal.
- 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_Width - The width of the scroll channel. If the layout direction is vertical, then the width is determined by the width of the handle bitmap.
- 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.
An adjustment layer component provides a number of pixel-modifying overlay effects. This component can have only one child. The child component is drawn first before the effect is applied. Currently there are two simple effects, lightening and darkening. The adjustment layer will automatically take the same width and height as it's child.
It should be noted that the pixel-modifying effect must read the pixel values from the render surface, and then write the modified pixel. Performance will vary depending on where the render surface is located. If the surface scenario is to render directly to the primary surface's back buffer in video memory, then performance will be slower because reading from video memory is slow. Ideally, the surface scenario should place the render surface in system memory when this component is used.
The library performs the pixel adjustments in optimized assembly code. See CK_AdjustmentLayer.
Properties
- CP_AdjustmentType - Adjustment types can be ADJUST_NONE, ADJUST_LIGHTEN, or ADJUST_DARKEN.
- CP_AdjustmentVal - For lightening and darkening effects, this represents the percentage of lightening or darkening.
- 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 is automatically set to that of the child component.
- 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_Width - The width is automatically set to that of the child component.
- 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.
The scaled label component can display a stretched or shrunken bitmap. The width and height of this component is explicitly set, and the bitmap will be stretched to this size.
In the Beta release of the library, the bitmap must be 16 bits per pixel or greater. See CK_ScaledLabel.
Properties
- CP_Bitmap - The bitmap to be scaled to the component's width and height. The bitmap can be either shrunken or enlarged.
- CP_BitmapRect - Specifies a rectangular portion (CK_Rect) of the CP_Bitmap to be used. Otherwise the entire bitmap is used. (v1.02)
- 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 of the component. The bitmap is scaled to this height.
- 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_Width - The width of the component. The bitmap is scaled to this width.
- 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.