<< Return to Main Index

< Return to Class Index

GXDrawTextLikeMultiLineEdit

void GXDrawTextLikeMultiLineEdit(CDC* pDC, LPCTSTR lpszString, int nCount, CRect rect, UINT nFormat, LPRECT lpRectClip = NULL);

pDC

Points to the device context.

lpszString

Points to the text to be drawn.

nCount

Specifies the size of the text in bytes. You should pass -1 for a zero-terminated string.

rect

Drawing rectangle.

nFormat

DT_WORBREAKword break

lpRectClip

Specifies an optional clipping rectangle for the text. It may be NULL if the clipping area is the same as the drawing rectangle. The clipping rectangle must not be smaller than the drawing rectangle. Otherwise, the function will assert. The main purpose of this optional attribute is to let the function draw a right-most character even when it is outside the drawing rectangle.

Remarks

Draws text into the rectangle with the specified alignment. The text is drawn with the font and color settings selected into the device context.

The grid-component draws all static cells with GXDrawTextLikeMultiLineEdit. In effect, the user sees a normal edit control drawn in the cell. When the user clicks in the cell, the grid-component can compute the text-position of the mouse click with GXGetMultiLineTextPosUnderPt, activate the associated CEdit, and position the caret.

You can call this function if you want to draw a cell with multi-line and alignment options as offered by CEdit.

GXDrawTextLikeMultiLineEdit has been optimized not to use any clipping routines. Therefore only complete characters will be drawn. Clipping will only be used when only one character of the text can be drawn and the character is larger than the clipping rectangle.

See Also

CGXStatic CGXEditControl GXGetMultiLineTextPosUnderPt CGXDrawingAndFormatting

Macros

Class Overview | Class Members