CPrtPreviewViewport Class

class CPrtPreviewViewport

This class implements a print preview viewport. It renders the IPrintable object contained by the model onto a page.

Defined in: PrintPreviewViewport.h

Class Members

virtual CSize GetVirtualSize() const

Get the total virtual size in logical units

CSize GetPaperSize() const

Get width and height of printed page in logical units.

CRect GetPrinterMargins() const

Get page margins in logical units.

virtual CSize GetPreviewPageOffset() const

Get minimum margins around page display area.

CRect GetPageBounds(const int nPageNo) const

Get bounds of a given page in logical units.

virtual void CenterPreviewPage()

Set logical origin so that virtual bounds are centered in viewport.

virtual void Draw(CDC* pDC)

Render to viewport to a device context.

virtual void DrawPage(CDC* pDC, const int nPageNo)

Render a given page to a device context.

virtual void DrawBackground(CDC* pDC)

Fill the viewport background.

virtual void OnInitialUpdate()

Called by framework before viewport is displayed.

virtual void OnUpdate(ISubject* pSubject, IMessage* pMsg)

Called when the model is changed.