Task:
Enables the programmer to draw something before or after List & Label into or near the object rectangle or to hide the object during printing.
This function allows many modifications to objects and is the so-called "do-it-all" for object representations.
Activation:
LlSetOption(hJob, LL_OPTION_CALLBACKMASK, <other Flags> | LL_CB_OBJECT);
Parameters:
lParam points to an scLlObject structure:
_nSize: Size of the structure, sizeof(scLlObject)
_nType: Type of object:
Object |
Meaning |
LL_OBJ_TEXT |
Text |
LL_OBJ_RECT |
Rectangle |
LL_OBJ_LINE |
Line object |
LL_OBJ_BARCODE |
Barcode object |
LL_OBJ_DRAWING |
Drawing object |
LL_OBJ_TABLE |
Table |
LL_OBJ_RTF |
RTF object |
LL_OBJ_TEMPLATE |
Template bitmap |
LL_OBJ_ELLIPSE |
Ellipse/Circle |
_lpszName: Name of the object. Either the name given in the Designer or a text like "TABLE (<Rectangle measures>)" - the text which is printed in the status line of the Designer for this object if it is selected.
_bPreDraw: TRUE for a call before List
& Label draws the object.
FALSE for a call after List & Label has
drawn the object.
_hPaintDC: Device Context for the print
_hRefDC: Device Context for references
_rcPaint: Rectangle in which the object is drawn. The mapping mode is in the normal drawing units, mm/10, inch/100 or inch/1000.
Return Value (_lResult):
Value of _bPreDraw |
_lResult |
TRUE |
0: okay |
FALSE |
always 0 |
Hints:
In this callback no List & Label function may be called which will produce output (LlPrint(), etc.)! Functions like LlPrintGetCurrentPage() or LlPrintGetOption() are allowed. See: Hints on the use of GDI objects.
This function is called twice per object, once with _bPreDraw = TRUE, then with _bPreDraw = FALSE.
_rcPaint may vary between these calls if the object size becomes smaller (text, table object) or the appearance condition does not match!
_bPreDraw = TRUE:
Use: you can draw an individual background or hide the object.
If you change _rcPaint, these modifications will have consequences for the size of the object, as the object is drawn by List & Label in the given rectangle.
_bPreDraw = FALSE:
Use: you can draw an individual background and/or shade, as only then is the true size of the object known.
The rectangle _rcPaint is the correct object rectangle. If you change _rcPaint then this affects the linked objects, as the data from _rcPaint is used as object rectangle, which might influence the coordinates of spatially linked objects!
Example:
case LL_CMND_OBJECT:
pSCO =
(PSCLLOBJECT)pSC->_lParam;
if (pSCO->_nType == LL_OBJ_RECT
&&
pSCO->_bPreDraw == FALSE)
{
FillRect(pSCO->_hPaintDC, pSCF->_rcPaint,
GetStockObject(LTGRAY_BRUSH);
}
break;