Contents Up Previous Next

wxPrinter

This class represents the Windows or PostScript printer, and is the vehicle through which printing may be launched by an application. Printing can also be achieved through using of lower functions and classes, but this and associated classes provide a more convenient and general method of printing.

Derived from

wxObject

Include files

<wx/print.h>

See also

Printing framework overview, wxPrinterDC, wxPrintDialog, wxPrintout, wxPrintPreview.

Members

wxPrinter::wxPrinter
wxPrinter::~wxPrinter
wxPrinter::Abort
wxPrinter::CreateAbortWindow
wxPrinter::GetPrintData
wxPrinter::Print
wxPrinter::PrintDialog
wxPrinter::ReportError
wxPrinter::Setup


wxPrinter::wxPrinter

wxPrinter(wxPrintData* data = NULL)

Constructor. Pass an optional pointer to a block of print data, which will be copied to the printer object's print data.

See also

wxPrintData


wxPrinter::~wxPrinter

~wxPrinter()

Destructor.


wxPrinter::Abort

bool Abort()

Returns TRUE if the user has aborted the print job.


wxPrinter::CreateAbortWindow

void CreateAbortWindow(wxWindow* parent, wxPrintout* printout)

Creates the default printing abort window, with a cancel button.


wxPrinter::GetPrintData

wxPrintData& GetPrintData()

Returns the print data associated with the printer object.


wxPrinter::Print

bool Print(wxWindow *parent, wxPrintout *printout, bool prompt=TRUE)

Starts the printing process. Provide a parent window, a user-defined wxPrintout object which controls the printing of a document, and whether the print dialog should be invoked first.

Print could return FALSE if there was a problem initializing the printer device context (current printer not set, for example).


wxPrinter::PrintDialog

bool PrintDialog(wxWindow *parent)

Invokes the print dialog.


wxPrinter::ReportError

void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message)

Default error-reporting function.


wxPrinter::Setup

void Setup(wxWindow *parent)

Invokes the print setup dialog. Note that the setup dialog is obsolete from Windows 95, though retained for backward compatibility.