A SERVICE OF

logo

{
minPage = 0;
maxPage = 0;
selFromPage = selToPage = 0;
}
P intPage must be overridden to print the contents of each page, band (ifr
banding is enabled), or window. P intPage for TWindowP intout looks liker r
this:
void TWindowPrintout::PrintPage(int, TRect& rect, unsigned)
{
// Conditionally scale the DC to the window so the printout // will resemble
the window
//
int prevMode;
TSize oldVExt, oldWExt;
if (Scale) {
prevMode = DC->SetMapMode(MM_ISOTROPIC);
TRect windowSize = Window->GetClientRect();
DC->SetViewportExt(PageSize, &oldVExt);
DC->SetWindowExt(windowSize.Size(), &oldWExt);
DC->IntersectClipRect(windowSize);
DC->DPtoLP(rect, 2);
}
// Call the window to paint itself
Window->Paint(*DC, FALSE, rect);
// Restore changes made to the DC
if (Scale) {
DC->SetWindowExt(oldWExt);
DC->SetViewportExt(oldVExt);
DC->SetMapMode(prevMode);
}
}
SetBanding is called with banding enabled:
printout.SetBanding(TRUE);
HasPage is called after every page is printed, and by default returns FALSE,
which means only one page will be printed. This function must be
overridden to return TRUE while pages remain in multipage documents.
P inting window contentsr
The simplest kind of printout to generate is a copy of a window because,
windows don’t have multiple pages, and window objects already know
how to draw themselves on a device context.
282
OWL P ogrammer’ Guider s