]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/mdi.cpp
wxUniversal fixes:
[wxWidgets.git] / wxPython / src / gtk / mdi.cpp
index d6d8f56ebbc4bc255b2f6f6e4d1bb124c678eed1..85ac9adc333c550bf91980443808e699b01bf02b 100644 (file)
 #      define SWIGEXPORT(a) __declspec(dllexport) a
 #   else
 #      if defined(__BORLANDC__)
-#          define SWIGEXPORT(a) a _export 
+#          define SWIGEXPORT(a) a _export
 #      else
-#          define SWIGEXPORT(a) a 
+#          define SWIGEXPORT(a) a
 #      endif
 #   endif
 #else
-#   define SWIGEXPORT(a) a 
+#   define SWIGEXPORT(a) a
 #endif
 
+#include "Python.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
-#include "Python.h"
+
 extern void SWIG_MakePtr(char *, void *, char *);
 extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
 extern char *SWIG_GetPtr(char *, void **, char *);
@@ -55,57 +57,35 @@ extern PyObject *SWIG_newvarlink(void);
 
 #include "helpers.h"
 
-static PyObject* l_output_helper(PyObject* target, PyObject* o) {
-    PyObject*   o2;
-    if (!target) {                   
-        target = o;
-    } else if (target == Py_None) {  
-        Py_DECREF(Py_None);
-        target = o;
-    } else {                         
-        if (!PyList_Check(target)) {
-            o2 = target;
-            target = PyList_New(0);
-            PyList_Append(target, o2);
-           Py_XDECREF(o2);
-        }
-        PyList_Append(target,o);
-       Py_XDECREF(o);
-    }
-    return target;
-}
 
 static PyObject* t_output_helper(PyObject* target, PyObject* o) {
     PyObject*   o2;
     PyObject*   o3;
 
-    if (!target) {                   
+    if (!target) {
         target = o;
-    } else if (target == Py_None) {  
+    } else if (target == Py_None) {
         Py_DECREF(Py_None);
         target = o;
-    } else {                         
+    } else {
         if (!PyTuple_Check(target)) {
             o2 = target;
             target = PyTuple_New(1);
             PyTuple_SetItem(target, 0, o2);
         }
-        o3 = PyTuple_New(1);            
-        PyTuple_SetItem(o3, 0, o);      
+        o3 = PyTuple_New(1);
+        PyTuple_SetItem(o3, 0, o);
 
         o2 = target;
-        target = PySequence_Concat(o2, o3); 
-        Py_DECREF(o2);                      
+        target = PySequence_Concat(o2, o3);
+        Py_DECREF(o2);
         Py_DECREF(o3);
     }
     return target;
 }
 
-#if PYTHON_API_VERSION >= 1009
-    static char* wxStringErrorMsg = "String or Unicode type required";
-#else
-    static char* wxStringErrorMsg = "String type required";
-#endif
+    // Put some wx default wxChar* values into wxStrings.
+    DECLARE_DEF_STRING(FrameNameStr);
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -159,18 +139,19 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb
     wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
     wxSize * _arg4 = (wxSize *) &wxDefaultSize;
     long  _arg5 = (long ) wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL;
-    char * _arg6 = (char *) "frame";
+    wxString * _arg6 = (wxString *) &wxPyFrameNameStr;
     PyObject * _argo0 = 0;
     PyObject * _obj2 = 0;
     wxPoint  temp;
     PyObject * _obj3 = 0;
     wxSize  temp0;
     PyObject * _obj4 = 0;
+    PyObject * _obj6 = 0;
     char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL };
     char _ptemp[128];
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxMDIParentFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxMDIParentFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -180,22 +161,9 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb
         }
     }
 {
-#if PYTHON_API_VERSION >= 1009
-    char* tmpPtr; int tmpSize;
-    if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
-        return NULL;
-    }
-    if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
-        return NULL;
-    _arg2 = new wxString(tmpPtr, tmpSize);
-#else
-    if (!PyString_Check(_obj2)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+    _arg2 = wxString_in_helper(_obj2);
+    if (_arg2 == NULL)
         return NULL;
-    }
-    _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2));
-#endif
 }
     if (_obj3)
 {
@@ -209,11 +177,17 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb
     if (! wxSize_helper(_obj4, &_arg4))
         return NULL;
 }
+    if (_obj6)
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIParentFrame *)new_wxMDIParentFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6);
+    _arg6 = wxString_in_helper(_obj6);
+    if (_arg6 == NULL)
+        return NULL;
+}
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIParentFrame *)new_wxMDIParentFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxMDIParentFrame_p");
@@ -225,6 +199,10 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb
 {
     if (_obj2)
         delete _arg2;
+}
+{
+    if (_obj6)
+        delete _arg6;
 }
     return _resultobj;
 }
@@ -240,10 +218,10 @@ static PyObject *_wrap_new_wxPreMDIParentFrame(PyObject *self, PyObject *args, P
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxPreMDIParentFrame",_kwnames)) 
         return NULL;
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIParentFrame *)new_wxPreMDIParentFrame();
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIParentFrame *)new_wxPreMDIParentFrame();
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxMDIParentFrame_p");
@@ -266,7 +244,7 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P
     wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition;
     wxSize * _arg5 = (wxSize *) &wxDefaultSize;
     long  _arg6 = (long ) wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL;
-    char * _arg7 = (char *) "frame";
+    wxString * _arg7 = (wxString *) &wxPyFrameNameStr;
     PyObject * _argo0 = 0;
     PyObject * _argo1 = 0;
     PyObject * _obj3 = 0;
@@ -274,10 +252,11 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P
     PyObject * _obj4 = 0;
     wxSize  temp0;
     PyObject * _obj5 = 0;
+    PyObject * _obj7 = 0;
     char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxMDIParentFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxMDIParentFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -294,22 +273,9 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P
         }
     }
 {
-#if PYTHON_API_VERSION >= 1009
-    char* tmpPtr; int tmpSize;
-    if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
-        return NULL;
-    }
-    if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1)
-        return NULL;
-    _arg3 = new wxString(tmpPtr, tmpSize);
-#else
-    if (!PyString_Check(_obj3)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+    _arg3 = wxString_in_helper(_obj3);
+    if (_arg3 == NULL)
         return NULL;
-    }
-    _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3));
-#endif
 }
     if (_obj4)
 {
@@ -322,17 +288,27 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P
     _arg5 = &temp0;
     if (! wxSize_helper(_obj5, &_arg5))
         return NULL;
+}
+    if (_obj7)
+{
+    _arg7 = wxString_in_helper(_obj7);
+    if (_arg7 == NULL)
+        return NULL;
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxMDIParentFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (bool )wxMDIParentFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    _resultobj = Py_BuildValue("i",_result);
 {
     if (_obj3)
         delete _arg3;
+}
+{
+    if (_obj7)
+        delete _arg7;
 }
     return _resultobj;
 }
@@ -355,10 +331,10 @@ static PyObject *_wrap_wxMDIParentFrame_ActivateNext(PyObject *self, PyObject *a
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIParentFrame_ActivateNext(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIParentFrame_ActivateNext(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -383,10 +359,10 @@ static PyObject *_wrap_wxMDIParentFrame_ActivatePrevious(PyObject *self, PyObjec
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIParentFrame_ActivatePrevious(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIParentFrame_ActivatePrevious(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -411,10 +387,10 @@ static PyObject *_wrap_wxMDIParentFrame_ArrangeIcons(PyObject *self, PyObject *a
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIParentFrame_ArrangeIcons(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIParentFrame_ArrangeIcons(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -439,10 +415,10 @@ static PyObject *_wrap_wxMDIParentFrame_Cascade(PyObject *self, PyObject *args,
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIParentFrame_Cascade(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIParentFrame_Cascade(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -468,10 +444,10 @@ static PyObject *_wrap_wxMDIParentFrame_GetActiveChild(PyObject *self, PyObject
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIChildFrame *)wxMDIParentFrame_GetActiveChild(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIChildFrame *)wxMDIParentFrame_GetActiveChild(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
@@ -496,10 +472,10 @@ static PyObject *_wrap_wxMDIParentFrame_GetClientWindow(PyObject *self, PyObject
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIClientWindow *)wxMDIParentFrame_GetClientWindow(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIClientWindow *)wxMDIParentFrame_GetClientWindow(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
@@ -524,10 +500,10 @@ static PyObject *_wrap_wxMDIParentFrame_GetToolBar(PyObject *self, PyObject *arg
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxWindow *)wxMDIParentFrame_GetToolBar(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxWindow *)wxMDIParentFrame_GetToolBar(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }{ _resultobj = wxPyMake_wxObject(_result); }
     return _resultobj;
@@ -551,10 +527,10 @@ static PyObject *_wrap_wxMDIParentFrame_Tile(PyObject *self, PyObject *args, PyO
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIParentFrame_Tile(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIParentFrame_Tile(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -611,18 +587,19 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj
     wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition;
     wxSize * _arg4 = (wxSize *) &wxDefaultSize;
     long  _arg5 = (long ) wxDEFAULT_FRAME_STYLE;
-    char * _arg6 = (char *) "frame";
+    wxString * _arg6 = (wxString *) &wxPyFrameNameStr;
     PyObject * _argo0 = 0;
     PyObject * _obj2 = 0;
     wxPoint  temp;
     PyObject * _obj3 = 0;
     wxSize  temp0;
     PyObject * _obj4 = 0;
+    PyObject * _obj6 = 0;
     char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL };
     char _ptemp[128];
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxMDIChildFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxMDIChildFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -632,22 +609,9 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj
         }
     }
 {
-#if PYTHON_API_VERSION >= 1009
-    char* tmpPtr; int tmpSize;
-    if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+    _arg2 = wxString_in_helper(_obj2);
+    if (_arg2 == NULL)
         return NULL;
-    }
-    if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
-        return NULL;
-    _arg2 = new wxString(tmpPtr, tmpSize);
-#else
-    if (!PyString_Check(_obj2)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
-        return NULL;
-    }
-    _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2));
-#endif
 }
     if (_obj3)
 {
@@ -660,12 +624,18 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj
     _arg4 = &temp0;
     if (! wxSize_helper(_obj4, &_arg4))
         return NULL;
+}
+    if (_obj6)
+{
+    _arg6 = wxString_in_helper(_obj6);
+    if (_arg6 == NULL)
+        return NULL;
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIChildFrame *)new_wxMDIChildFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIChildFrame *)new_wxMDIChildFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxMDIChildFrame_p");
@@ -677,6 +647,10 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj
 {
     if (_obj2)
         delete _arg2;
+}
+{
+    if (_obj6)
+        delete _arg6;
 }
     return _resultobj;
 }
@@ -692,10 +666,10 @@ static PyObject *_wrap_new_wxPreMDIChildFrame(PyObject *self, PyObject *args, Py
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxPreMDIChildFrame",_kwnames)) 
         return NULL;
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIChildFrame *)new_wxPreMDIChildFrame();
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIChildFrame *)new_wxPreMDIChildFrame();
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxMDIChildFrame_p");
@@ -718,7 +692,7 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py
     wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition;
     wxSize * _arg5 = (wxSize *) &wxDefaultSize;
     long  _arg6 = (long ) wxDEFAULT_FRAME_STYLE;
-    char * _arg7 = (char *) "frame";
+    wxString * _arg7 = (wxString *) &wxPyFrameNameStr;
     PyObject * _argo0 = 0;
     PyObject * _argo1 = 0;
     PyObject * _obj3 = 0;
@@ -726,10 +700,11 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py
     PyObject * _obj4 = 0;
     wxSize  temp0;
     PyObject * _obj5 = 0;
+    PyObject * _obj7 = 0;
     char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxMDIChildFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxMDIChildFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -746,22 +721,9 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py
         }
     }
 {
-#if PYTHON_API_VERSION >= 1009
-    char* tmpPtr; int tmpSize;
-    if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
-        return NULL;
-    }
-    if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1)
-        return NULL;
-    _arg3 = new wxString(tmpPtr, tmpSize);
-#else
-    if (!PyString_Check(_obj3)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+    _arg3 = wxString_in_helper(_obj3);
+    if (_arg3 == NULL)
         return NULL;
-    }
-    _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3));
-#endif
 }
     if (_obj4)
 {
@@ -775,16 +737,26 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py
     if (! wxSize_helper(_obj5, &_arg5))
         return NULL;
 }
+    if (_obj7)
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxMDIChildFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7);
+    _arg7 = wxString_in_helper(_obj7);
+    if (_arg7 == NULL)
+        return NULL;
+}
+{
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (bool )wxMDIChildFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    _resultobj = Py_BuildValue("i",_result);
 {
     if (_obj3)
         delete _arg3;
+}
+{
+    if (_obj7)
+        delete _arg7;
 }
     return _resultobj;
 }
@@ -807,10 +779,10 @@ static PyObject *_wrap_wxMDIChildFrame_Activate(PyObject *self, PyObject *args,
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIChildFrame_Activate(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIChildFrame_Activate(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -838,10 +810,10 @@ static PyObject *_wrap_wxMDIChildFrame_Maximize(PyObject *self, PyObject *args,
     }
     _arg1 = (bool ) tempbool1;
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIChildFrame_Maximize(_arg0,_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIChildFrame_Maximize(_arg0,_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -866,10 +838,10 @@ static PyObject *_wrap_wxMDIChildFrame_Restore(PyObject *self, PyObject *args, P
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxMDIChildFrame_Restore(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxMDIChildFrame_Restore(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -921,10 +893,10 @@ static PyObject *_wrap_new_wxMDIClientWindow(PyObject *self, PyObject *args, PyO
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIClientWindow *)new_wxMDIClientWindow(_arg0,_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIClientWindow *)new_wxMDIClientWindow(_arg0,_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxMDIClientWindow_p");
@@ -947,10 +919,10 @@ static PyObject *_wrap_new_wxPreMDIClientWindow(PyObject *self, PyObject *args,
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxPreMDIClientWindow",_kwnames)) 
         return NULL;
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxMDIClientWindow *)new_wxPreMDIClientWindow();
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxMDIClientWindow *)new_wxPreMDIClientWindow();
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxMDIClientWindow_p");
@@ -991,10 +963,10 @@ static PyObject *_wrap_wxMDIClientWindow_Create(PyObject *self, PyObject *args,
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxMDIClientWindow_Create(_arg0,_arg1,_arg2);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (bool )wxMDIClientWindow_Create(_arg0,_arg1,_arg2);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
@@ -1040,21 +1012,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxPrintQuality","_EBool",0},
     { "_wxPrintQuality","_size_t",0},
     { "_wxPrintQuality","_time_t",0},
-    { "_class_wxEvtHandler","_class_wxMDIClientWindow",SwigwxMDIClientWindowTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxMDIClientWindow",SwigwxMDIClientWindowTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxMDIChildFrame",SwigwxMDIChildFrameTowxEvtHandler},
-    { "_class_wxEvtHandler","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxMDIParentFrame",SwigwxMDIParentFrameTowxEvtHandler},
     { "_byte","_unsigned_char",0},
     { "_long","_unsigned_long",0},
     { "_long","_signed_long",0},
-    { "_class_wxObject","_class_wxMDIClientWindow",SwigwxMDIClientWindowTowxObject},
-    { "_class_wxObject","_wxMDIClientWindow",SwigwxMDIClientWindowTowxObject},
-    { "_class_wxObject","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxObject},
-    { "_class_wxObject","_wxMDIChildFrame",SwigwxMDIChildFrameTowxObject},
-    { "_class_wxObject","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxObject},
-    { "_class_wxObject","_wxMDIParentFrame",SwigwxMDIParentFrameTowxObject},
     { "_size_t","_wxCoord",0},
     { "_size_t","_wxPrintQuality",0},
     { "_size_t","_time_t",0},
@@ -1062,9 +1022,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_size_t","_int",0},
     { "_size_t","_wxWindowID",0},
     { "_size_t","_uint",0},
-    { "_wxTopLevelWindow","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxMDIChildFrame",SwigwxMDIChildFrameTowxTopLevelWindow},
-    { "_wxTopLevelWindow","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxTopLevelWindow},
     { "_wxTopLevelWindow","_wxMDIParentFrame",SwigwxMDIParentFrameTowxTopLevelWindow},
     { "_uint","_wxCoord",0},
     { "_uint","_wxPrintQuality",0},
@@ -1088,26 +1046,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_signed_int","_EBool",0},
     { "_signed_int","_wxWindowID",0},
     { "_signed_int","_int",0},
-    { "_class_wxTopLevelWindow","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxTopLevelWindow},
-    { "_class_wxTopLevelWindow","_wxMDIChildFrame",SwigwxMDIChildFrameTowxTopLevelWindow},
-    { "_class_wxTopLevelWindow","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxTopLevelWindow},
-    { "_class_wxTopLevelWindow","_wxMDIParentFrame",SwigwxMDIParentFrameTowxTopLevelWindow},
     { "_WXTYPE","_short",0},
     { "_WXTYPE","_signed_short",0},
     { "_WXTYPE","_unsigned_short",0},
     { "_unsigned_short","_WXTYPE",0},
     { "_unsigned_short","_short",0},
-    { "_class_wxWindow","_class_wxMDIClientWindow",SwigwxMDIClientWindowTowxWindow},
-    { "_class_wxWindow","_wxMDIClientWindow",SwigwxMDIClientWindowTowxWindow},
-    { "_class_wxWindow","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxWindow},
-    { "_class_wxWindow","_wxMDIChildFrame",SwigwxMDIChildFrameTowxWindow},
-    { "_class_wxWindow","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxWindow},
-    { "_class_wxWindow","_wxMDIParentFrame",SwigwxMDIParentFrameTowxWindow},
-    { "_wxObject","_class_wxMDIClientWindow",SwigwxMDIClientWindowTowxObject},
     { "_wxObject","_wxMDIClientWindow",SwigwxMDIClientWindowTowxObject},
-    { "_wxObject","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxObject},
     { "_wxObject","_wxMDIChildFrame",SwigwxMDIChildFrameTowxObject},
-    { "_wxObject","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxObject},
     { "_wxObject","_wxMDIParentFrame",SwigwxMDIParentFrameTowxObject},
     { "_signed_short","_WXTYPE",0},
     { "_signed_short","_short",0},
@@ -1122,9 +1067,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_short","_WXTYPE",0},
     { "_short","_unsigned_short",0},
     { "_short","_signed_short",0},
-    { "_wxFrame","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxFrame},
     { "_wxFrame","_wxMDIChildFrame",SwigwxMDIChildFrameTowxFrame},
-    { "_wxFrame","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxFrame},
     { "_wxFrame","_wxMDIParentFrame",SwigwxMDIParentFrameTowxFrame},
     { "_wxWindowID","_wxCoord",0},
     { "_wxWindowID","_wxPrintQuality",0},
@@ -1160,22 +1103,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxCoord","_size_t",0},
     { "_wxCoord","_time_t",0},
     { "_wxCoord","_wxPrintQuality",0},
-    { "_wxEvtHandler","_class_wxMDIClientWindow",SwigwxMDIClientWindowTowxEvtHandler},
     { "_wxEvtHandler","_wxMDIClientWindow",SwigwxMDIClientWindowTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxEvtHandler},
     { "_wxEvtHandler","_wxMDIChildFrame",SwigwxMDIChildFrameTowxEvtHandler},
-    { "_wxEvtHandler","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxEvtHandler},
     { "_wxEvtHandler","_wxMDIParentFrame",SwigwxMDIParentFrameTowxEvtHandler},
-    { "_wxWindow","_class_wxMDIClientWindow",SwigwxMDIClientWindowTowxWindow},
     { "_wxWindow","_wxMDIClientWindow",SwigwxMDIClientWindowTowxWindow},
-    { "_wxWindow","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxWindow},
     { "_wxWindow","_wxMDIChildFrame",SwigwxMDIChildFrameTowxWindow},
-    { "_wxWindow","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxWindow},
     { "_wxWindow","_wxMDIParentFrame",SwigwxMDIParentFrameTowxWindow},
-    { "_class_wxFrame","_class_wxMDIChildFrame",SwigwxMDIChildFrameTowxFrame},
-    { "_class_wxFrame","_wxMDIChildFrame",SwigwxMDIChildFrameTowxFrame},
-    { "_class_wxFrame","_class_wxMDIParentFrame",SwigwxMDIParentFrameTowxFrame},
-    { "_class_wxFrame","_wxMDIParentFrame",SwigwxMDIParentFrameTowxFrame},
 {0,0,0}};
 
 static PyObject *SWIG_globals;
@@ -1187,6 +1120,14 @@ SWIGEXPORT(void) initmdic() {
         SWIG_globals = SWIG_newvarlink();
         m = Py_InitModule("mdic", mdicMethods);
         d = PyModule_GetDict(m);
+        PyDict_SetItemString(d,"IDM_WINDOWTILE", PyInt_FromLong((long) 4001));
+        PyDict_SetItemString(d,"IDM_WINDOWTILEHOR", PyInt_FromLong((long) 4001));
+        PyDict_SetItemString(d,"IDM_WINDOWCASCADE", PyInt_FromLong((long) 4002));
+        PyDict_SetItemString(d,"IDM_WINDOWICONS", PyInt_FromLong((long) 4003));
+        PyDict_SetItemString(d,"IDM_WINDOWNEXT", PyInt_FromLong((long) 4004));
+        PyDict_SetItemString(d,"IDM_WINDOWTILEVERT", PyInt_FromLong((long) 4005));
+        PyDict_SetItemString(d,"wxFIRST_MDI_CHILD", PyInt_FromLong((long) 4100));
+        PyDict_SetItemString(d,"wxLAST_MDI_CHILD", PyInt_FromLong((long) 4600));
 {
    int i;
    for (i = 0; _swig_mapping[i].n1; i++)