X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87138c520ce5dc4d0268191074866e8bc300c984..79570d64d36dfdf31e20b4242bf664232f20594b:/src/generic/prntdlgg.cpp diff --git a/src/generic/prntdlgg.cpp b/src/generic/prntdlgg.cpp index 6270c0f62f..665c7ce812 100644 --- a/src/generic/prntdlgg.cpp +++ b/src/generic/prntdlgg.cpp @@ -30,6 +30,8 @@ #include "wx/defs.h" +#if wxUSE_PRINTING_ARCHITECTURE + #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/dc.h" @@ -65,18 +67,21 @@ // wxWin macros // ---------------------------------------------------------------------------- +#if !USE_SHARED_LIBRARY + #if wxUSE_POSTSCRIPT -#if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog) IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog) - IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxDialog) BEGIN_EVENT_TABLE(wxGenericPrintDialog, wxDialog) EVT_BUTTON(wxID_OK, wxGenericPrintDialog::OnOK) EVT_BUTTON(wxPRINTID_SETUP, wxGenericPrintDialog::OnSetup) EVT_RADIOBOX(wxPRINTID_RANGE, wxGenericPrintDialog::OnRange) END_EVENT_TABLE() +#endif + + IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxDialog) BEGIN_EVENT_TABLE(wxGenericPageSetupDialog, wxDialog) EVT_BUTTON(wxPRINTID_SETUP, wxGenericPageSetupDialog::OnPrinter) @@ -89,6 +94,8 @@ extern wxPrintPaperDatabase *wxThePrintPaperDatabase; +#if wxUSE_POSTSCRIPT + // ============================================================================ // implementation // ============================================================================ @@ -125,7 +132,7 @@ wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, Init(parent); } -void wxGenericPrintDialog::Init(wxWindow *parent) +void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent)) { // wxDialog::Create(parent, -1, _("Print"), wxPoint(0, 0), wxSize(600, 600), // wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL | wxTAB_TRAVERSAL); @@ -168,8 +175,8 @@ void wxGenericPrintDialog::Init(wxWindow *parent) m_noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, "", wxPoint(252, 130), wxSize(40, -1)); - wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(40, 180), wxSize(100, -1)); - (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(180, 180), wxSize(100, -1)); + wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(40, 180), wxSize(80, -1)); + (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(180, 180), wxSize(80, -1)); okButton->SetDefault(); okButton->SetFocus(); @@ -242,7 +249,10 @@ void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event)) wxThePrintSetupData->SetPrinterFile(f); } else + { + m_printDialogData.GetPrintData().SetPrintMode(wxPRINT_MODE_PRINTER); wxThePrintSetupData->SetPrinterMode(wxPRINT_MODE_PRINTER); + } EndModal(wxID_OK); } @@ -265,6 +275,7 @@ void wxGenericPrintDialog::OnRange(wxCommandEvent& event) void wxGenericPrintDialog::OnSetup(wxCommandEvent& WXUNUSED(event)) { + *wxThePrintSetupData = m_printDialogData.GetPrintData(); wxGenericPrintSetupDialog *genericPrintSetupDialog = new wxGenericPrintSetupDialog(this, wxThePrintSetupData); int ret = genericPrintSetupDialog->ShowModal(); @@ -354,7 +365,8 @@ TODO: collate and noCopies should be duplicated across dialog data and print dat wxDC *wxGenericPrintDialog::GetPrintDC() { - return new wxPostScriptDC(wxThePrintSetupData->GetPrinterFile(), FALSE, (wxWindow *) NULL); + // return new wxPostScriptDC(wxThePrintSetupData->GetPrinterFile(), FALSE, (wxWindow *) NULL); + return new wxPostScriptDC(GetPrintDialogData().GetPrintData()); } // ---------------------------------------------------------------------------- @@ -421,8 +433,8 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data) m_printerOptionsText = new wxTextCtrl(this, wxPRINTID_OPTIONS, "", wxPoint(360, 135), wxSize(150, -1)); - wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(130, 200), wxSize(100, -1)); - (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(320, 200), wxSize(100, -1)); + wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(130, 200), wxSize(80, -1)); + (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(320, 200), wxSize(80, -1)); okButton->SetDefault(); okButton->SetFocus(); @@ -760,3 +772,4 @@ wxChoice *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y) return choice; } +#endif