X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eedf876b34d35c4a2b86cff70278043f89dab605..bffe56c5d19df9926686722fc09ad096afb47633:/wxPython/src/printfw.i?ds=sidebyside diff --git a/wxPython/src/printfw.i b/wxPython/src/printfw.i index ced6407035..05293bade1 100644 --- a/wxPython/src/printfw.i +++ b/wxPython/src/printfw.i @@ -23,6 +23,16 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxPrintoutTitleStr = wxT("Printout"); + DECLARE_DEF_STRING(PrintoutTitleStr); + + DECLARE_DEF_STRING(FrameNameStr); +%} + +//---------------------------------------------------------------------- + %include typemaps.i %include my_typemaps.i @@ -51,6 +61,8 @@ public: bool GetCollate(); int GetOrientation(); + bool Ok(); + const wxString& GetPrinterName(); bool GetColour(); wxDuplexMode GetDuplex(); @@ -116,9 +128,9 @@ public: class wxPostScriptDC : public wxDC { public: wxPostScriptDC(const wxPrintData& printData); - %name(wxPostScriptDC2)wxPostScriptDC(const wxString& output, - bool interactive = TRUE, - wxWindow* parent = NULL); +// %name(wxPostScriptDC2)wxPostScriptDC(const wxString& output, +// bool interactive = TRUE, +// wxWindow* parent = NULL); wxPrintData& GetPrintData(); void SetPrintData(const wxPrintData& data); @@ -157,6 +169,9 @@ public: return new wxPrintData(self->GetPrintData()); // force a copy } } + + bool Ok(); + void SetDefaultInfo(bool flag); void SetDefaultMinMargins(bool flag); void SetMarginTopLeft(const wxPoint& pt); @@ -204,6 +219,9 @@ public: } bool GetPrintToFile(); int GetToPage(); + + bool Ok(); + void SetCollate(bool flag); void SetFromPage(int page); void SetMaxPage(int page); @@ -238,7 +256,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p bool hadErr = FALSE; bool found; - wxPyTState* state = wxPyBeginBlockThreads(); + wxPyBeginBlockThreads(); if ((found = m_myInst.findCallback("GetPageInfo"))) { PyObject* result = m_myInst.callCallbackObj(Py_BuildValue("()")); if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) { @@ -269,7 +287,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p } Py_DECREF(result); } - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(); if (! found) wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo); } @@ -294,7 +312,7 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage); // Now define the custom class for SWIGging %name(wxPrintout) class wxPyPrintout : public wxObject { public: - wxPyPrintout(const char* title = "Printout"); + wxPyPrintout(const wxString& title = wxPyPrintoutTitleStr); void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPrintout)" @@ -331,7 +349,7 @@ public: wxPrintDialogData& GetPrintDialogData(); bool Print(wxWindow *parent, wxPyPrintout *printout, int prompt=TRUE); wxDC* PrintDialog(wxWindow *parent); - void ReportError(wxWindow *parent, wxPyPrintout *printout, char* message); + void ReportError(wxWindow *parent, wxPyPrintout *printout, const wxString& message); bool Setup(wxWindow *parent); }; @@ -368,7 +386,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"