From 009a066588622dd8d07343756b3e0922d2c9ebd4 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 11 Sep 2002 22:03:29 +0000 Subject: [PATCH] Readded deprec. constructor. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/dcpsg.h | 8 +++++++- src/generic/dcpsg.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/include/wx/generic/dcpsg.h b/include/wx/generic/dcpsg.h index b17f6b6ae4..d0bf5a34fc 100644 --- a/include/wx/generic/dcpsg.h +++ b/include/wx/generic/dcpsg.h @@ -42,9 +42,15 @@ public: // Recommended constructor wxPostScriptDC(const wxPrintData& printData); - + ~wxPostScriptDC(); +#if WXWIN_COMPATIBILITY_2_2 + wxPostScriptDC( const wxString &output, bool interactive = FALSE, wxWindow *parent = NULL ) + { Create( output, interactive, parent ); } + bool Create ( const wxString &output, bool interactive = FALSE, wxWindow *parent = NULL ); +#endif + virtual bool Ok() const; virtual void BeginDrawing() {} diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 1e6d11c619..5e61da75f6 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -318,6 +318,31 @@ wxPostScriptDC::~wxPostScriptDC () } } +#if WXWIN_COMPATIBILITY_2_2 +bool wxPostScriptDC::Create( const wxString &output, bool interactive, wxWindow *parent ) +{ + wxPrintData data; + data.SetFilename( output ); + data.SetPrintMode( wxPRINT_MODE_FILE ); + + if (interactive) + { + wxPrintDialogData ddata( data ); + wxPrintDialog dialog( parent, &data ); + dialog.GetPrintDialogData().SetSetupDialog(TRUE); + if (dialog.ShowModal() != wxID_OK) + { + m_ok = FALSE; + return FALSE; + } + data = dialog.GetPrintDialogData().GetPrintData(); + } + + return TRUE; +} +#endif + + bool wxPostScriptDC::Ok() const { return m_ok; -- 2.45.2