X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04a014a5d69a9345e563b4395768d61fc743b0c3..15f0ad701496612df8c145e8e46d4b38515c0bbf:/src/generic/printps.cpp diff --git a/src/generic/printps.cpp b/src/generic/printps.cpp index 3ded123101..c3fd9a8a61 100644 --- a/src/generic/printps.cpp +++ b/src/generic/printps.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "printps.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -152,12 +148,12 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro // set by the user m_printDialogData.SetMinPage(minPage); m_printDialogData.SetMaxPage(maxPage); - + if (m_printDialogData.GetFromPage() < minPage) m_printDialogData.SetFromPage( minPage ); if (m_printDialogData.GetToPage() > maxPage) m_printDialogData.SetToPage( maxPage ); - + int pagesPerCopy = m_printDialogData.GetToPage()-m_printDialogData.GetFromPage()+1, totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(), @@ -237,13 +233,13 @@ bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool pro wxDC* wxPostScriptPrinter::PrintDialog(wxWindow *parent) { wxDC* dc = (wxDC*) NULL; - + wxGenericPrintDialog dialog( parent, &m_printDialogData ); if (dialog.ShowModal() == wxID_OK) { dc = dialog.GetPrintDC(); m_printDialogData = dialog.GetPrintDialogData(); - + if (dc == NULL) sm_lastError = wxPRINTER_ERROR; else @@ -255,7 +251,7 @@ wxDC* wxPostScriptPrinter::PrintDialog(wxWindow *parent) return dc; } -bool wxPostScriptPrinter::Setup(wxWindow *parent) +bool wxPostScriptPrinter::Setup(wxWindow *WXUNUSED(parent)) { #if 0 wxGenericPrintDialog* dialog = new wxGenericPrintDialog(parent, & m_printDialogData); @@ -269,11 +265,11 @@ bool wxPostScriptPrinter::Setup(wxWindow *parent) } dialog->Destroy(); - + return (ret == wxID_OK); #endif - return wxID_CANCEL; + return false; } // ---------------------------------------------------------------------------- @@ -311,7 +307,16 @@ bool wxPostScriptPrintPreview::Print(bool interactive) { if (!m_printPrintout) return false; + + // Assume that on Unix, the preview may use the PostScript + // (generic) version, but printing using the native system is required. + // TODO: make a generic print preview class from which wxPostScriptPrintPreview + // is derived. +#ifdef __UNIX__ + wxPrinter printer(& m_printDialogData); +#else wxPostScriptPrinter printer(& m_printDialogData); +#endif return printer.Print(m_previewFrame, m_printPrintout, interactive); }