22#include "print_dialog.h"
24PrintDialog::PrintDialog() {
26 m_initialized =
false;
37 data.SetOrientation(orientation);
38 m_print_data = wxPrintDialogData(data);
44 m_print_data.EnablePageNumbers(enable);
48 assert(m_initialized);
49 wxPrinter printer(&m_print_data);
50 if (!printer.Print(parent, output,
true)) {
51 if (wxPrinter::GetLastError() == wxPRINTER_ERROR) {
54 _(
"There was a problem printing.\nPerhaps your current printer is "
55 "not set correctly?"),
60 wxPrintData data = printer.GetPrintDialogData().GetPrintData();
61 m_print_data.SetPrintData(data);
Handle the print process and dialog.
void Initialize(wxPrintOrientation orientation)
Initialize the printer with default setup.
void Print(wxWindow *parent, wxPrintout *output)
Start print process and opens the print dialog.
void EnablePageNumbers(bool enable)
Print page numbers.
static PrintDialog & GetInstance()
Get instance to handle the print process,.
General purpose GUI support.