<< Return to Main Index

< Return to Class Index

CGXGridCore::OnGridPrint

virtual void OnGridPrint(CDC* pDC, CPrintInfo* pInfo);

pDC

Points to the printer device context.

pInfo

Points to a CPrintInfo structure that describes the current print job.

Remarks

Called by the MFC framework to print or preview a page of the document. For each page being printed, the MFC framework calls this function immediately after calling the OnPrepareDC member function. The page being printed is specified by the m_nCurPage member of the CPrintInfo structure that pInfo points to.

The default implementation retrieves the rows and columns to be printed for the specified page, sets an internal variable that specifies that the grid is printing and draws the grid to the printer device context by calling OnDrawTopLeftBottomRight. After printing headers and footers, the grid resets the variable for the printing-mode.

In CGXGridCore, the values returned by some methods depend on whether the grid is in printing-mode or not. For example, the GetTopRow and GetLeftCol methods return the first row and column for the given page as long as the grid is in printing-mode, but after resetting the printing-mode they return their original values.

The printing rectangle where the grid should be printed on the page is calculated with OnAdjustPrintRectangle. Headers and footers are drawn with OnPrintHeaderAndFooter.

Control-Factory Specific ->

This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the ImplementPrinting method from within the control factory class' InitializeGridComponents method will make the concrete implementation of this method available to your application.

If no concrete implementation is available this method performs no action. A warning will be displayed in the debug window.

END Control-Factory Specific

See Also

CGXGridCore::OnGridBeginPrinting CGXGridCore::OnGridEndPrinting CGXGridCore::OnAdjustPrintRectangle CGXGridCore::OnPrintHeaderAndFooter CGXGridCore::GetLeftCol CGXGridCore::OnDrawTopLeftBottomRight

CGXGridCore

Class Overview | Class Members