CK_Object
|
+----CK_Component
|
+----CK_Manager
|
+----CK_ClipWindow
The CK_ClipWindow is like a CK_BBoard,
except that it can only have one child. The clip window's width and height should
be explicitly set by the application. The intended use of the clip window is
to provide a clipping window for a component that might be very large, such
as a large CK_RowColumn. When used in conjunction
with CK_ScrollHandle components, a scroll
window can be achieved. One of the example programs provided with the Chilkat
SDK demonstrates this.
The clip window can have a transparent
background, a solid-color background, or a bitmap background. A bitmap background
can be drawn tiled, to cover the entire clip window. It is possible to set horizontal
and vertical borders using the CP_BorderX
and CP_BorderY properties. As an example,
if a clip window was created with CP_Width
= 100, CP_Height = 100, CP_BorderX
= 10, and CP_BorderY = 10, then the
child would be clipped to a 90x90 pixel window.
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.
Examples of creating a clip
window:
CK_Bitmap *texture;
RGBQUAD bg;
bg.rgbRed = bg.rgbBlue = bg.rgbGreen = 0
// Create a clip window with a black background
CK_ClipWindow *c1 = (CK_ClipWindow *) CreateComponent(CT_ClipWindow, 0,
CP_BgColor, &bg,
CP_BorderX, 10,
CP_BorderY, 10,
0);
// Create a clip window with a tiled bitmap as the background.
CK_ClipWindow *c2 = (CK_ClipWindow *) CreateComponent(CT_ClipWindow, 0,
CP_Bitmap, texture,
CP_TiledBitmap, 1
0);