These controls share the same STATIC class with static text controls, and are even simpler than their cousins, except that creating them requires the use of the winclass, winstyle, and winstylex parameters, which are otherwise not commonly needed.
The sample program GUILIN in EXLIB:[908,24] illustrates most of the combinations of these control types (see the sample screen shot below), all of which are created with variations of the following code:
xcall AUI,AUI_CONTROL,CTLOP_ADD, NUL_CTLID, NUL_CTEXT$, NUL_CSTATE, ctype, NUL_CMD$, NUL_FUNC$, NUL_CSTATUS, srow,scol,erow,ecol,NUL_FGC, NUL_BGC, NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, NUL_PARENTID,"STATIC", ss'style, NUL_WINSTYLEX
In this example we make extensive use of NUL_xxx placeholder parameters, including for the ctlid and cstatus return parameters which we don't care about here.
The different styles of lines and boxes are accomplished by setting DWSTYLE to one of the following values (defined in ashell.def):
Symbol |
Value |
Description |
---|---|---|
SS_BLACKRECT |
4 |
Black rectangle. |
SS_GRAYRECT |
5 |
Gray rectangle. |
SS_WHITERECT |
6 |
White rectangle. |
SS_BLACKFRAME |
7 |
Black frame. |
SS_GRAYFRAME |
8 |
Gray frame. |
SS_WHITEFRAME |
9 |
White frame. |
SS_ETCHEDFRAME |
12 |
Etched frame. |
These maybe be combined with the above:
Symbol |
Value |
Description |
---|---|---|
SS_TYPEMASK |
&h000F |
Mask for extracting type. |
SS_CENTERIMAGE |
&h0200 |
Static option, sunken. |
SS_SUNKEN |
&h1000 |
Center image with static control. |
The second set (with the "sunken" look) is accomplished by adding SS’SUNKEN to one of the above:
Note that MBF_ALTPOS can be used with horizontal line controls to shift their position from the middle of the cell to the bottom of the cell. Millirows can also be used for finer adjustments; see the GUILIN sample for details.