X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3d2d8da1d89c195cb44f95f267989118e205c7bf..763f55468e441e94e65a72b127c8fc2a48c91e91:/samples/printing/printing.cpp diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index bdc779878e..45703a7f3d 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -192,7 +192,12 @@ void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event)) wxPrinter printer(& printDialogData); MyPrintout printout("My printout"); if (!printer.Print(this, &printout, TRUE)) - wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK); + { + if (wxPrinter::GetLastError() == wxPRINTER_ERROR) + wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK); + else + wxMessageBox("You canceled printing", "Printing", wxOK); + } else { (*g_printData) = printer.GetPrintDialogData().GetPrintData();