The default print preview capabilities are almost sufficient for Scribble’s needs. To some extent, Scribble’s print preview has already been enhanced when the printing capabilities were enhanced. Recall that in the override of OnPreparePrinting
you called the SetMaxPages function to specify the length of Scribble documents. This allows the framework to add a scroll bar to the preview window.
Another enhancement you can make is to change the number of pages displayed when preview mode is invoked.
To set the number of pages displayed in preview mode
OnPreparePrinting
member function in ScribbleView.cpp. Then add the following code to the end of the function:BOOL bRet = DoPreparePrinting (pInfo); // default preparation
pInfo->m_nNumPreviewPages = 2; //Preview 2 pages at a time
// Set this value after calling DoPreparePrinting to override
// value read from registry
return bRet;
The lines added here assign the value 2 to m_nNumPreviewPages
. This causes Scribble to preview both pages of the document at once: the title page (page 1) and the drawing page (page 2). Note the value for m_nNumPreviewPages
must be assigned after calling DoPreparePrinting
, because DoPreparePrinting
sets m_nNumPreviewPages
to the number of preview pages used the last time the program was executed; this value is stored in the application’s registry entry.