// Purpose: interface of wxPreviewControlBar
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
Pass a print preview object plus other normal frame arguments.
The print preview object will be destroyed by the frame when it closes.
*/
- wxPreviewFrame(wxPrintPreview* preview, wxWindow* parent,
- const wxString& title,
+ wxPreviewFrame(wxPrintPreviewBase* preview, wxWindow* parent,
+ const wxString& title = "Print Preview",
const wxPoint& pos = wxDefaultPosition,
- const wxSize& size size = wxDefaultSize,
+ const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
- const wxString& name = "frame");
+ const wxString& name = wxFrameNameStr);
/**
Destructor.
Use IsOk() to check whether the wxPrintPreview object was created correctly.
*/
wxPrintPreview(wxPrintout* printout,
- wxPrintout* printoutForPrinting,
- wxPrintData* data = NULL);
+ wxPrintout* printoutForPrinting = NULL,
+ wxPrintDialogData* data = NULL);
/**
Destructor.
The implementation simply blits the preview bitmap onto
the canvas, creating a new preview bitmap if none exists.
*/
- bool PaintPage(wxPreviewCanvas* canvas, wxDC dc);
+ virtual bool PaintPage(wxPreviewCanvas* canvas, wxDC& dc);
/**
Invokes the print process using the second wxPrintout object
/**
Sets the current page to be previewed.
*/
- void SetCurrentPage(int pageNum);
+ virtual bool SetCurrentPage(int pageNum);
/**
Sets the frame to be used for displaying the print preview canvas
/**
Creates the default printing abort window, with a cancel button.
*/
- void CreateAbortWindow(wxWindow* parent, wxPrintout* printout);
+ virtual wxWindow* CreateAbortWindow(wxWindow* parent, wxPrintout* printout);
/**
Returns @true if the user has aborted the print job.
context (current printer not set, for example) or the user cancelled printing.
Call GetLastError() to get detailed information about the kind of the error.
*/
- bool Print(wxWindow* parent, wxPrintout* printout,
- bool prompt = true);
+ virtual bool Print(wxWindow* parent, wxPrintout* printout,
+ bool prompt = true);
/**
Invokes the print dialog.
/**
Default error-reporting function.
*/
- void ReportError(wxWindow* parent, wxPrintout* printout,
- const wxString& message);
+ virtual void ReportError(wxWindow* parent, wxPrintout* printout,
+ const wxString& message);
/**
Invokes the print setup dialog.
@beginWxPythonOnly
This method returns the output-only parameters as a tuple.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ In wxPerl this method takes no arguments and returns a
+ 2-element list (w, h).
+ @endWxPerlOnly
*/
void GetPPIPrinter(int* w, int* h) const;
@beginWxPythonOnly
This method returns the output-only parameters as a tuple.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ In wxPerl this method takes no arguments and returns a
+ 2-element list (w, h).
+ @endWxPerlOnly
*/
void GetPPIScreen(int* w, int* h) const;
four integers.
@endWxPythonOnly
*/
- void GetPageInfo(int* minPage, int* maxPage, int* pageFrom,
- int* pageTo);
+ virtual void GetPageInfo(int* minPage, int* maxPage, int* pageFrom,
+ int* pageTo);
/**
Returns the size of the printer page in millimetres.
@beginWxPythonOnly
This method returns the output-only parameters as a tuple.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ In wxPerl this method takes no arguments and returns a
+ 2-element list (w, h).
+ @endWxPerlOnly
*/
void GetPageSizeMM(int* w, int* h) const;
@beginWxPythonOnly
This method returns the output-only parameters as a tuple.
@endWxPythonOnly
+
+ @beginWxPerlOnly
+ In wxPerl this method takes no arguments and returns a
+ 2-element list (w, h).
+ @endWxPerlOnly
*/
void GetPageSizePixels(int* w, int* h) const;
/**
Returns @true if the printout is currently being used for previewing.
+
+ @see GetPreview()
*/
virtual bool IsPreview() const;
+ /**
+ Returns the associated preview object if any.
+
+ If this printout object is used for previewing, returns the associated
+ wxPrintPreview. Otherwise returns @NULL.
+
+ The returned pointer is not owned by the printout and must not be
+ deleted.
+
+ @see IsPreview()
+
+ @since 2.9.1.
+ */
+ wxPrintPreview *GetPreview() const;
+
/**
Set the user scale and device origin of the wxDC associated with this wxPrintout
so that one screen pixel maps to one device pixel on the DC.