<< Return to Main Index

< Return to Class Index

CGXControl::Draw

virtual void Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);

pDC

Points to the device context.

rect

Specifies the cell rectangle.

nRow

Specifies the row id.

nCol

Specifies the column id.

style

A reference to the composed style of the cell.

pStandardStyle

Points to the standard-style of the grid.

Remarks

Override this method to draw the cell.

When drawing cells, it is necessary to determine if the specified cell (with nRow and nCol) is the current cell and if it is active.

If your control is associated with a CWnd (e.g., a CGXEditControl with a CEdit) and the specified cell is the current cell and if your control is active, you should position the CWnd and redraw it by calling Invalidate( ) and UpdateWindow( ). Take a look at the CGXEditControl implementation of this method for an example.

Otherwise, you can simply draw the cell.

Please note that you should first call DrawBackground to draw the background and 3d-effects specified in the composed style-object (pStyle).

The base-class version of this method calls OnInitChildren and loops through the CGXChild list and calls each child’s Draw method.

See Also

CGXControl::DrawBackground CGXControl::IsActive CGXControl::OnInitChildren CGXChild

CGXControl

Class Overview | Class Members