Older Newer
Mon, 17 Dec 2007 13:26:55 . . . . afh [corrections to enable level]


Changes by last author:

Added:
= createCtl =

== Syntax ==

:createCtl(int n, int c, string t, int x, int y, int w, int h, int s, int sx, int p, int e)

== Arguments ==

:n

::Index number to give this control.

:c

::Class of control to create.

:t

::Text label for the control.

:x

::X-axis position, the left-most position of the control (in DBUs)

:y

::Y-axis position, the upper-most position of the control (in DBUs)

:w

::Width of the control (in DBUs)

:h

::Height of the control (in DBUs)

:s

::Style parameters for the control.

:sx

::Extended style parameters for this control.

:p

::Properties to give this control.

:e

::Enable level of the control.

== Description ==

:This function creates a new user control. Unlike the control definitions at the start of your source code, createCtl can create controls at runtime from within your filter code. In conjunction with the deleteCtl function, for example, you can dynamically create and destroy user controls.

<code>

</code>

:The class c should be one of the following predefined values: CC_STANDARD, CC_SCROLLBAR, CC_TRACKBAR, CC_CHECKBOX, CC_PUSHBUTTON, CC_GROUPBOX, CC_RADIOBUTTON, CC_LISTBOX, CC_COMBOBOX, CC_OWNERDRAW, CC_STATICTEXT, CC_FRAME, CC_RECT, CC_BITMAP, CC_IMAGE, CC_ICON.

<code>

</code>

:For x, y, w, and h, a value of -1 means use the default value.

<code>

</code>

:The style of the user control differs from control to control, but you can try using:

<code>

</code>

||CC_CHECKBOX || use s=BS_CHECKBOX (2), BS_AUTOCHECKBOX (3), BS_3STATE (5), or BS_AUTO3STATE (6) ||

||CC_GROUPBOX || use s=BS_GROUPBOX (7) ||

||CC_RADIOBUTTON || use s=BS_RADIOBUTTON (4) or BS_AUTORADIOBUTTON (9) ||

||CC_COMBOBOX || use s=CBS_SIMPLE (1), CBS_DROPDOWN (2), or CBS_DROPDOWNLIST (3) ||

||CC_OWNERDRAW || use s=BS_OWNERDRAW (11) ||

||CC_FRAME || use s=SS_BLACKFRAME (7), SS_GRAYFRAME (8), SS_WHITEFRAME (9), or SS_ETCHEDFRAME (18) ||

||CC_RECT || use s=SS_BLACKRECT (4), SS_GRAYRECT (5), or SS_WHITERECT (6) for black, gray, or white fill ||

||CC_STATICTEXT || use s=SS_LEFT (0) for left-aligned text, SS_CENTER (1) for center-aligned text, SS_RIGHT (2) for right-aligned text, or SS_LEFTNOWORDWRAP (12) for left-aligned text with no word wrap. This corresponds to the LEFT, CENTER, RIGHT, and LEFTNOWORDWRAP styles in control definitions. ||

||rest of the user controls || use s=0 ||

<code>

</code>

:The extended style of the control may differ depending on class type, but generally you can set the value to 0 (for default settings), WS_EX_DLGMODALFRAME (1) for a MODALFRAME-like look, WS_EX_CLIENTEDGE (0x200) for a sunken 3D-look, and WS_EX_STATICEDGE (0x20000) for a 3D border. (check this??)

<code>

</code>

:The enable level can be any of 0 (for invisible and disabled), 1 (for visible but disabled), or 3 (for visible and enabled).

== Example ==

<code>

createCtl(0, CC_PUSHBUTTON, "Oh boy", 200, 20, 40, 30, 0, 1, 0, 3);

createCtl(4, CC_CHECKBOX, "Disrupt color", -1, -1, -1, -1, 3, 0, 0, 3);

</code>

== Also see ==

:clearCtlProperties, deleteCtl, setCtlProperties

== Comments ==

Add your own comments here.