September 2016
Intermediate to advanced
588 pages
12h 22m
English
The PrintPreviewDocument class displays the pages of the document parent window. The OnKeyDown method closes the document when the user presses the
Esc
key. The OnSize method adjusts the physical size of the page so that the page always fits inside the window. The OnVerticalScroll method shifts the pages when the user scrolls up or down, and OnPaint calls OnPrint of the parent document for each page.
PrintPreviewDocument.h:
namespace SmallWindows {
class PrintPreviewDocument : Document {
public:
PrintPreviewDocument(StandardDocument* parentDocument,
int page = 1, Size pageSize = USLetterPortrait);
bool OnKeyDown(WORD key, bool shiftPressed,
bool controlPressed);
The OnSize function is overridden only to neutralize its functionality ...
Read now
Unlock full access