Task:
Enables the programmer to modify the coloring of individual table fields.
Activation:
LlSetOption(hJob, LL_OPTION_TABLE_COLORING, LL_COLORING_PROGRAM)
In this way, the control of the coloring in tables is left to your program (the corresponding settings in the table characteristic dialog of the Designer won't appear).
or
LlSetOption(hJob, LL_OPTION_TABLE_COLORING,LL_COLORING_DONTCARE)
With this command, List & Label lets your program draw the background first of all, then it draws the background again (if allowed) with the field pattern defined in the Designer. This allows a kind of cooperation between the programmer and the user.
Parameters:
lParam points to an scllTableField structure:
_nSize: Size of structure, sizeof(scllTableField)
_nType: Type of field:
Value |
Meaning |
LL_TABLE_FIELD_HEADER |
Field is in the header line |
LL_TABLE_FIELD_BODY |
Field is in the data line |
LL_TABLE_FIELD_GROUP |
Field is in group header line |
LL_TABLE_FIELD_GROUPFOOTER |
Field is in group footer line |
LL_TABLE_FIELD_FILL |
Field is the filling area when the table has a fixed size and there is some free space below the last data line |
LL_TABLE_FIELD_FOOTER |
Field is in the footer line |
_hPaintDC: Device Context for the print and in the following callback definitions
_hRefDC: Device Context for the references
_rcPaint: Rectangle in which the field is to be drawn. The mapping mode is in the normal drawing units, mm/10, inch/100 or inch/1000.
_nLineDef: Number of line definition to be drawn.
_nIndex: Field index, 0-based (the first column has the index 0, the second 1, etc.)
_rcSpacing: Cell distances
_pszContents: This parameter provides the (evaluated) content of the cell currently being rendered, e.g. "Smith" for a column that contains a field Person.Lastname. You can use this parameter to handle certain values specifically.
Return Value:
0
Hints:
In this callback no List & Label functions may be called which will produce output (LlPrint(), etc.)!
If you select a GDI object in these DCs or make other changes, e.g. change the mapping mode, you should reverse the changes before ending the routine. Hint: the API functions SaveDC(), RestoreDC() can help considerably for complex changes (the used functions are Windows API function).
Example:
case LL_CMND_TABLEFIELD:
pSCF =
(PSCLLTABLEFIELD)pSC->_lParam;
if (pSCF->_nIndex ==
1)
{
FillRect(pSCF->_hPaintDC, pSCF->_rcPaint,
GetStockObject(LTGRAY_BRUSH);
}
pSC._lResult =
0;
break;