SECEditViewport::DrawBlock

CSize SECEditViewport::DrawBlock(CDC* pDC, int nTabStops, int nX, int nY, int nLeftEgdeOffset, LPCTSTR lpszText, int nLength, int nCol, int nLineNo, SECEditColorInfo* pFontInfo, BOOL bShowWhitespace, BOOL bInSelection, int nSelStartCol, int nSelEndCol)

Draws a block of text, accounting for any selection and show whitespace attributes.

Defined in: SECEditViewport.cpp

Return Value

A CSize containing the size of the block that was rendered

Parameters

pDC

The DC on which to render this block of text.

nTabStops

The tab size in device units.

nX

The x coordinate of this block of text in logical units.

nY

The y coordinate of this this block of text in device units.

nLeftEgdeOffset

The distance in device units between 0 and the start of this line.

lpszText

Pointer to the text for this block. May not be NULL terminated.

nLength

The length of the text of this block, in TCHARs.

nCol

The column index on the given line that the block starts with.

nLineNo

The line pf text in which this block is contained.

pFontInfo

Pointer to the Font and Color information for this block.

bShowWhitespace

Indicates whether this block should show the whitespace characters.

bInSelection

Indicates if any part of this block is contained in a selection.

nSelStartCol

The starting column index of any selection on this line.

nSelEndCol

The ending column index of any selection on this line.

Comments

Draw Block breaks each block of text into smaller portions if required, due to selection or show whitespace states, and calls itself recursively to render these blocks of text. When the text is broken into the smallest possible block, RenderTextBlock is called to render the text.

Developer Notes

nXOffset is used to account for items such as the gutter spacing. Eventually the text will be rendered using TabbedTextOut and this value is used in calculating the tab expansion values.

See Also

SECEditViewport SECEditColorInfo Draw RenderBlockText