LL_CMND_OBJECT

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
1: object is not to be drawn (in this case hidden)

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;