X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42e69d6b435a4dd5415caf3750db62cf45b6f373..c0ab6adfedf92aa4457821422e77c19b80f10bee:/src/msw/printwin.cpp diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 758d8c74f0..0f05f72618 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -31,10 +31,13 @@ #include "wx/defs.h" #ifndef WX_PRECOMP + #include "wx/window.h" + #include "wx/msw/private.h" #include "wx/utils.h" #include "wx/dc.h" #include "wx/app.h" #include "wx/msgdlg.h" + #include "wx/intl.h" #endif #include "wx/msw/printwin.h" @@ -84,7 +87,11 @@ wxWindowsPrinter::wxWindowsPrinter(wxPrintDialogData *data) wxWindowsPrinter::~wxWindowsPrinter() { + // avoids mingw warning about statement with no effect (FreeProcInstance + // doesn't do anything under Win32) +#ifndef __GNUWIN32__ FreeProcInstance((FARPROC) m_lpAbortProc); +#endif } bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) @@ -96,7 +103,11 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt return FALSE; printout->SetIsPreview(FALSE); - printout->OnPreparePrinting(); + + // 4/9/99, JACS: this is a silly place to allow preparation, considering + // the DC and no parameters have been set in the printout object. + // Moved further down. + // printout->OnPreparePrinting(); // Get some parameters from the printout, if defined int fromPage, toPage; @@ -183,11 +194,17 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt // Create an abort window wxBeginBusyCursor(); + printout->OnPreparePrinting(); + wxWindow *win = CreateAbortWindow(parent, printout); wxYield(); #if defined(__BORLANDC__) || defined(__GNUWIN32__) || defined(__SALFORDC__) || !defined(__WIN32__) +#ifdef STRICT + ::SetAbortProc((HDC) dc->GetHDC(), (ABORTPROC) m_lpAbortProc); +#else ::SetAbortProc((HDC) dc->GetHDC(), (FARPROC) m_lpAbortProc); +#endif #else ::SetAbortProc((HDC) dc->GetHDC(), (int (_stdcall *) // cast it to right type only if required @@ -204,7 +221,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt if (!win) { wxEndBusyCursor(); - wxLogDebug("Could not create an abort dialog."); + wxLogDebug(wxT("Could not create an abort dialog.")); delete dc; }