OWLNext 7.0
Borland's Object Windows Library for the modern age
|
A simple kind of printout to generate is a copy of a window, because windows do not have multiple pages and window objects already know how to draw themselves on a device context.
To create a window printout object, construct a window printout object and pass it a title string and a pointer to the window you want printed, like this:
Often you want a window to create a printout of itself in response to a menu command. Here is the message response member function that responds to the print command in PRINTING.CPP:
This member function calls the printer object's Print member function, which passes a pointer to the parent window and a pointer to the printout object, and specifies whether or not a printer dialog box should be displayed.
TWindowPrintout prints itself by calling your window object's Paint member function (within TWindowPrintout::PrintPage), but with a printer device context instead of a display context.