]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_printfw.i
another change note
[wxWidgets.git] / wxPython / src / _printfw.i
index fd6a356b947cb7cc25335b98316fb591fefe6e29..861fa83a8bc6aa5120664b81e9a723f04fe0c19e 100644 (file)
@@ -40,7 +40,10 @@ enum wxPrintMode
 
 class wxPrintData : public wxObject {
 public:
+    %nokwargs wxPrintData;
     wxPrintData();
+    wxPrintData(const wxPrintData& data);  // for making copies
+    
     ~wxPrintData();
 
     int GetNoCopies();
@@ -103,7 +106,9 @@ public:
 
 class wxPageSetupDialogData : public wxObject {
 public:
+    %nokwargs wxPageSetupDialogData;
     wxPageSetupDialogData();
+    wxPageSetupDialogData(const wxPageSetupDialogData& data);  // for making copies
     ~wxPageSetupDialogData();
 
     void EnableHelp(bool flag);
@@ -149,6 +154,8 @@ public:
 
 
 
+MustHaveApp(wxPageSetupDialog);
+
 class wxPageSetupDialog : public wxDialog {
 public:
     %pythonAppend wxPageSetupDialog         "self._setOORInfo(self)"
@@ -166,7 +173,7 @@ class wxPrintDialogData : public wxObject {
 public:
     %nokwargs wxPrintDialogData;
     wxPrintDialogData();
-    wxPrintDialogData(const wxPrintData& printData);
+    wxPrintDialogData(const wxPrintData& printData);  // for making copies
     ~wxPrintDialogData();
 
     int GetFromPage() const;
@@ -217,6 +224,8 @@ public:
 };
 
 
+MustHaveApp(wxPrintDialog);
+
 class wxPrintDialog : public wxDialog {
 public:
     %pythonAppend wxPrintDialog         "self._setOORInfo(self)"
@@ -243,6 +252,8 @@ enum wxPrinterError
 };
 
 
+MustHaveApp(wxPrinter);
+
 class wxPrinter : public wxObject {
 public:
     wxPrinter(wxPrintDialogData* data = NULL);
@@ -270,7 +281,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p
     bool hadErr = False;
     bool found;
 
-    wxPyBeginBlockThreads();
+    bool blocked = wxPyBeginBlockThreads();
     if ((found = wxPyCBH_findCallback(m_myInst, "GetPageInfo"))) {
         PyObject* result = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
         if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
@@ -301,7 +312,7 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p
         }
         Py_DECREF(result);
     }
-    wxPyEndBlockThreads();
+    wxPyEndBlockThreads(blocked);
     if (! found)
         wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
 }
@@ -323,6 +334,8 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage);
 %}
 
 
+MustHaveApp(wxPyPrintout);
+
 // Now define the custom class for SWIGging
 %name(Printout) class wxPyPrintout  : public wxObject {
 public:
@@ -377,6 +390,8 @@ public:
 
 
 
+MustHaveApp(wxPreviewCanvas);
+
 class wxPreviewCanvas: public wxScrolledWindow
 {
 public:
@@ -391,6 +406,8 @@ public:
 };
 
 
+MustHaveApp(wxPreviewFrame);
+
 class wxPreviewFrame : public wxFrame {
 public:
     %pythonAppend wxPreviewFrame   "self._setOORInfo(self)"
@@ -430,6 +447,8 @@ enum {
     wxID_PREVIEW_GOTO
 };
 
+MustHaveApp(wxPreviewControlBar);
+
 class wxPreviewControlBar: public wxPanel
 {
 public:
@@ -458,6 +477,8 @@ public:
 
 //---------------------------------------------------------------------------
 
+MustHaveApp(wxPrintPreview);
+
 class wxPrintPreview : public wxObject {
 public:
     %nokwargs wxPrintPreview;
@@ -527,15 +548,15 @@ public:
     bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) {                           \
         bool rval=False;                                                        \
         bool found;                                                             \
-        wxPyBeginBlockThreads();                                                \
+        bool blocked = wxPyBeginBlockThreads();                                                \
         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                \
-            PyObject* win = wxPyMake_wxObject(a);                               \
-            PyObject* dc  = wxPyMake_wxObject(&b);                              \
+            PyObject* win = wxPyMake_wxObject(a,false);                               \
+            PyObject* dc  = wxPyMake_wxObject(&b,false);                              \
             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc));\
             Py_DECREF(win);                                                     \
             Py_DECREF(dc);                                                      \
         }                                                                       \
-        wxPyEndBlockThreads();                                                  \
+        wxPyEndBlockThreads(blocked);                                                  \
         if (! found)                                                            \
             rval = PCLASS::CBNAME(a, b);                                        \
         return rval;                                                            \
@@ -592,6 +613,8 @@ IMP_PYCALLBACK_VOID_        (wxPyPrintPreview, wxPrintPreview, DetermineScaling)
 %}
 
 
+MustHaveApp(wxPyPrintPreview);
+
 class wxPyPrintPreview : public wxPrintPreview
 {
 public:
@@ -650,6 +673,8 @@ IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateControlBar);
 %}
 
 
+MustHaveApp(wxPyPreviewFrame);
+
 class wxPyPreviewFrame : public wxPreviewFrame
 {
 public:
@@ -704,6 +729,8 @@ IMP_PYCALLBACK_VOID_INT(wxPyPreviewControlBar, wxPreviewControlBar, SetZoomContr
 %}
 
 
+MustHaveApp(wxPyPreviewControlBar);
+
 class wxPyPreviewControlBar : public wxPreviewControlBar
 {
 public: