Objects of this class manage the print preview process.
The object is passed a wxPrintout object, and the wxPrintPreview object itself is passed to a wxPreviewFrame object. Previewing is started by initializing and showing the preview frame. Unlike wxPrinter::Print(), flow of control returns to the application immediately after the frame is shown.
- Note
- The preview shown is only exact on Windows. On other platforms, the wxDC used for preview is different from what is used for printing and the results may be significantly different, depending on how is the output created. In particular, printing code relying on wxDC::GetTextExtent() heavily (for example, wxHtmlEasyPrinting and other wxHTML classes do) is affected. It is recommended to use native preview functionality on platforms that offer it (OS X, GTK+).
- See Also
- Printing Framework Overview, wxPrinterDC, wxPrintDialog, wxPrintout, wxPrinter, wxPreviewCanvas, wxPreviewControlBar, wxPreviewFrame
|
| wxPrintPreview (wxPrintout *printout, wxPrintout *printoutForPrinting=NULL, wxPrintDialogData *data=NULL) |
| Constructor.
|
|
| wxPrintPreview (wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data) |
|
| ~wxPrintPreview () |
| Destructor.
|
|
virtual wxPreviewCanvas * | GetCanvas () const |
| Gets the preview window used for displaying the print preview image.
|
|
virtual int | GetCurrentPage () const |
| Gets the page currently being previewed.
|
|
virtual wxFrame * | GetFrame () const |
| Gets the frame used for displaying the print preview canvas and control bar.
|
|
virtual int | GetMaxPage () const |
| Returns the maximum page number.
|
|
virtual int | GetMinPage () const |
| Returns the minimum page number.
|
|
virtual wxPrintout * | GetPrintout () const |
| Gets the preview printout object associated with the wxPrintPreview object.
|
|
virtual wxPrintout * | GetPrintoutForPrinting () const |
| Gets the printout object to be used for printing from within the preview interface, or NULL if none exists.
|
|
virtual bool | IsOk () const |
| Returns true if the wxPrintPreview is valid, false otherwise.
|
|
virtual bool | PaintPage (wxPreviewCanvas *canvas, wxDC &dc) |
| This refreshes the preview window with the preview image.
|
|
virtual bool | Print (bool prompt) |
| Invokes the print process using the second wxPrintout object supplied in the wxPrintPreview constructor.
|
|
virtual bool | RenderPage (int pageNum) |
| Renders a page into a wxMemoryDC.
|
|
virtual void | SetCanvas (wxPreviewCanvas *window) |
| Sets the window to be used for displaying the print preview image.
|
|
virtual bool | SetCurrentPage (int pageNum) |
| Sets the current page to be previewed.
|
|
virtual void | SetFrame (wxFrame *frame) |
| Sets the frame to be used for displaying the print preview canvas and control bar.
|
|
virtual void | SetPrintout (wxPrintout *printout) |
| Associates a printout object with the wxPrintPreview object.
|
|
virtual void | SetZoom (int percent) |
| Sets the percentage preview zoom, and refreshes the preview canvas accordingly.
|
|
| wxObject () |
| Default ctor; initializes to NULL the internal reference data.
|
|
| wxObject (const wxObject &other) |
| Copy ctor.
|
|
virtual | ~wxObject () |
| Destructor.
|
|
virtual wxClassInfo * | GetClassInfo () const |
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
|
|
wxObjectRefData * | GetRefData () const |
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
|
|
bool | IsKindOf (const wxClassInfo *info) const |
| Determines whether this class is a subclass of (or the same class as) the given class.
|
|
bool | IsSameAs (const wxObject &obj) const |
| Returns true if this object has the same data pointer as obj.
|
|
void | Ref (const wxObject &clone) |
| Makes this object refer to the data in clone.
|
|
void | SetRefData (wxObjectRefData *data) |
| Sets the wxObject::m_refData pointer.
|
|
void | UnRef () |
| Decrements the reference count in the associated data, and if it is zero, deletes the data.
|
|
void | UnShare () |
| This is the same of AllocExclusive() but this method is public.
|
|
void | operator delete (void *buf) |
| The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
|
|
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0) |
| The new operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
|
|
Constructor.
Pass a printout object, an optional printout object to be used for actual printing, and the address of an optional block of printer data, which will be copied to the print preview object's print data.
If printoutForPrinting is non-NULL, a "Print..." button will be placed on the preview frame so that the user can print directly from the preview interface.
Use IsOk() to check whether the wxPrintPreview object was created correctly.