]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/help.cpp
Changes needed to get upto date with the latest wx CVS
[wxWidgets.git] / wxPython / src / gtk / help.cpp
index 7d53dc3cc1621593bb885e93a0c388f01d34599e..1d71b4f305c4dca66df94e74ebe6d2f5759d4332 100644 (file)
@@ -19,6 +19,8 @@
 /* Implementation : PYTHON */
 
 #define SWIGPYTHON
+#include "Python.h"
+
 #include <string.h>
 #include <stdlib.h>
 /* Definitions for Windows/Unix exporting */
 #      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
 
 #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 *);
@@ -53,60 +54,35 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "helpc"
 
-#include "export.h"
+#include "wxPython.h"
 #include <wx/cshelp.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
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -156,10 +132,10 @@ static PyObject *_wrap_new_wxHelpEvent(PyObject *self, PyObject *args, PyObject
         return NULL;
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxHelpEvent *)new_wxHelpEvent(_arg0,_arg1,*_arg2);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxHelpEvent *)new_wxHelpEvent(_arg0,_arg1,*_arg2);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxHelpEvent_p");
@@ -191,11 +167,11 @@ static PyObject *_wrap_wxHelpEvent_GetPosition(PyObject *self, PyObject *args, P
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        const wxPoint & _result_ref = wxHelpEvent_GetPosition(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    const wxPoint & _result_ref = wxHelpEvent_GetPosition(_arg0);
     _result = (wxPoint *) &_result_ref;
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxPoint_p");
@@ -233,10 +209,10 @@ static PyObject *_wrap_wxHelpEvent_SetPosition(PyObject *self, PyObject *args, P
         return NULL;
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxHelpEvent_SetPosition(_arg0,*_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxHelpEvent_SetPosition(_arg0,*_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -262,14 +238,18 @@ static PyObject *_wrap_wxHelpEvent_GetLink(PyObject *self, PyObject *args, PyObj
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        const wxString & _result_ref = wxHelpEvent_GetLink(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    const wxString & _result_ref = wxHelpEvent_GetLink(_arg0);
     _result = (wxString *) &_result_ref;
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }{
+#if wxUSE_UNICODE
+    _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
+#else
     _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
+#endif
 }
     return _resultobj;
 }
@@ -294,28 +274,15 @@ static PyObject *_wrap_wxHelpEvent_SetLink(PyObject *self, PyObject *args, PyObj
         }
     }
 {
-#if PYTHON_API_VERSION >= 1009
-    char* tmpPtr; int tmpSize;
-    if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
+    _arg1 = wxString_in_helper(_obj1);
+    if (_arg1 == NULL)
         return NULL;
-    }
-    if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
-        return NULL;
-    _arg1 = new wxString(tmpPtr, tmpSize);
-#else
-    if (!PyString_Check(_obj1)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
-        return NULL;
-    }
-    _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
-#endif
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxHelpEvent_SetLink(_arg0,*_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxHelpEvent_SetLink(_arg0,*_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -345,14 +312,18 @@ static PyObject *_wrap_wxHelpEvent_GetTarget(PyObject *self, PyObject *args, PyO
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        const wxString & _result_ref = wxHelpEvent_GetTarget(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    const wxString & _result_ref = wxHelpEvent_GetTarget(_arg0);
     _result = (wxString *) &_result_ref;
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }{
+#if wxUSE_UNICODE
+    _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
+#else
     _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
+#endif
 }
     return _resultobj;
 }
@@ -377,28 +348,15 @@ static PyObject *_wrap_wxHelpEvent_SetTarget(PyObject *self, PyObject *args, PyO
         }
     }
 {
-#if PYTHON_API_VERSION >= 1009
-    char* tmpPtr; int tmpSize;
-    if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
-        return NULL;
-    }
-    if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
+    _arg1 = wxString_in_helper(_obj1);
+    if (_arg1 == NULL)
         return NULL;
-    _arg1 = new wxString(tmpPtr, tmpSize);
-#else
-    if (!PyString_Check(_obj1)) {
-        PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
-        return NULL;
-    }
-    _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
-#endif
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxHelpEvent_SetTarget(_arg0,*_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxHelpEvent_SetTarget(_arg0,*_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -409,139 +367,6 @@ static PyObject *_wrap_wxHelpEvent_SetTarget(PyObject *self, PyObject *args, PyO
     return _resultobj;
 }
 
-static void *SwigwxContextMenuEventTowxCommandEvent(void *ptr) {
-    wxContextMenuEvent *src;
-    wxCommandEvent *dest;
-    src = (wxContextMenuEvent *) ptr;
-    dest = (wxCommandEvent *) src;
-    return (void *) dest;
-}
-
-static void *SwigwxContextMenuEventTowxEvent(void *ptr) {
-    wxContextMenuEvent *src;
-    wxEvent *dest;
-    src = (wxContextMenuEvent *) ptr;
-    dest = (wxEvent *) src;
-    return (void *) dest;
-}
-
-static void *SwigwxContextMenuEventTowxObject(void *ptr) {
-    wxContextMenuEvent *src;
-    wxObject *dest;
-    src = (wxContextMenuEvent *) ptr;
-    dest = (wxObject *) src;
-    return (void *) dest;
-}
-
-#define new_wxContextMenuEvent(_swigarg0,_swigarg1,_swigarg2) (new wxContextMenuEvent(_swigarg0,_swigarg1,_swigarg2))
-static PyObject *_wrap_new_wxContextMenuEvent(PyObject *self, PyObject *args, PyObject *kwargs) {
-    PyObject * _resultobj;
-    wxContextMenuEvent * _result;
-    wxEventType  _arg0 = (wxEventType ) wxEVT_NULL;
-    wxWindowID  _arg1 = (wxWindowID ) 0;
-    wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
-    wxPoint  temp;
-    PyObject * _obj2 = 0;
-    char *_kwnames[] = { "type","id","pt", NULL };
-    char _ptemp[128];
-
-    self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|iiO:new_wxContextMenuEvent",_kwnames,&_arg0,&_arg1,&_obj2)) 
-        return NULL;
-    if (_obj2)
-{
-    _arg2 = &temp;
-    if (! wxPoint_helper(_obj2, &_arg2))
-        return NULL;
-}
-{
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxContextMenuEvent *)new_wxContextMenuEvent(_arg0,_arg1,*_arg2);
-
-    wxPy_END_ALLOW_THREADS;
-    if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxContextMenuEvent_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
-    return _resultobj;
-}
-
-#define wxContextMenuEvent_GetPosition(_swigobj)  (_swigobj->GetPosition())
-static PyObject *_wrap_wxContextMenuEvent_GetPosition(PyObject *self, PyObject *args, PyObject *kwargs) {
-    PyObject * _resultobj;
-    wxPoint * _result;
-    wxContextMenuEvent * _arg0;
-    PyObject * _argo0 = 0;
-    char *_kwnames[] = { "self", NULL };
-    char _ptemp[128];
-
-    self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxContextMenuEvent_GetPosition",_kwnames,&_argo0)) 
-        return NULL;
-    if (_argo0) {
-        if (_argo0 == Py_None) { _arg0 = NULL; }
-        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxContextMenuEvent_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxContextMenuEvent_GetPosition. Expected _wxContextMenuEvent_p.");
-        return NULL;
-        }
-    }
-{
-    wxPy_BEGIN_ALLOW_THREADS;
-        const wxPoint & _result_ref = wxContextMenuEvent_GetPosition(_arg0);
-    _result = (wxPoint *) &_result_ref;
-
-    wxPy_END_ALLOW_THREADS;
-    if (PyErr_Occurred()) return NULL;
-}    if (_result) {
-        SWIG_MakePtr(_ptemp, (char *) _result,"_wxPoint_p");
-        _resultobj = Py_BuildValue("s",_ptemp);
-    } else {
-        Py_INCREF(Py_None);
-        _resultobj = Py_None;
-    }
-    return _resultobj;
-}
-
-#define wxContextMenuEvent_SetPosition(_swigobj,_swigarg0)  (_swigobj->SetPosition(_swigarg0))
-static PyObject *_wrap_wxContextMenuEvent_SetPosition(PyObject *self, PyObject *args, PyObject *kwargs) {
-    PyObject * _resultobj;
-    wxContextMenuEvent * _arg0;
-    wxPoint * _arg1;
-    PyObject * _argo0 = 0;
-    wxPoint  temp;
-    PyObject * _obj1 = 0;
-    char *_kwnames[] = { "self","pos", NULL };
-
-    self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxContextMenuEvent_SetPosition",_kwnames,&_argo0,&_obj1)) 
-        return NULL;
-    if (_argo0) {
-        if (_argo0 == Py_None) { _arg0 = NULL; }
-        else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxContextMenuEvent_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxContextMenuEvent_SetPosition. Expected _wxContextMenuEvent_p.");
-        return NULL;
-        }
-    }
-{
-    _arg1 = &temp;
-    if (! wxPoint_helper(_obj1, &_arg1))
-        return NULL;
-}
-{
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxContextMenuEvent_SetPosition(_arg0,*_arg1);
-
-    wxPy_END_ALLOW_THREADS;
-    if (PyErr_Occurred()) return NULL;
-}    Py_INCREF(Py_None);
-    _resultobj = Py_None;
-    return _resultobj;
-}
-
 static void *SwigwxContextHelpTowxObject(void *ptr) {
     wxContextHelp *src;
     wxObject *dest;
@@ -573,10 +398,10 @@ static PyObject *_wrap_new_wxContextHelp(PyObject *self, PyObject *args, PyObjec
     }
     _arg1 = (bool ) tempbool1;
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxContextHelp *)new_wxContextHelp(_arg0,_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxContextHelp *)new_wxContextHelp(_arg0,_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxContextHelp_p");
@@ -606,10 +431,10 @@ static PyObject *_wrap_delete_wxContextHelp(PyObject *self, PyObject *args, PyOb
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        delete_wxContextHelp(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    delete_wxContextHelp(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -644,10 +469,10 @@ static PyObject *_wrap_wxContextHelp_BeginContextHelp(PyObject *self, PyObject *
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxContextHelp_BeginContextHelp(_arg0,_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (bool )wxContextHelp_BeginContextHelp(_arg0,_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
@@ -672,10 +497,10 @@ static PyObject *_wrap_wxContextHelp_EndContextHelp(PyObject *self, PyObject *ar
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxContextHelp_EndContextHelp(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (bool )wxContextHelp_EndContextHelp(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
@@ -769,10 +594,10 @@ static PyObject *_wrap_new_wxContextHelpButton(PyObject *self, PyObject *args, P
         return NULL;
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxContextHelpButton *)new_wxContextHelpButton(_arg0,_arg1,*_arg2,*_arg3,_arg4);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxContextHelpButton *)new_wxContextHelpButton(_arg0,_arg1,*_arg2,*_arg3,_arg4);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxContextHelpButton_p");
@@ -803,10 +628,10 @@ static PyObject *_wrap_wxHelpProvider_Set(PyObject *self, PyObject *args, PyObje
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxHelpProvider *)wxHelpProvider::Set(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxHelpProvider *)wxHelpProvider::Set(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxHelpProvider_p");
@@ -828,10 +653,10 @@ static PyObject *_wrap_wxHelpProvider_Get(PyObject *self, PyObject *args, PyObje
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxHelpProvider_Get",_kwnames)) 
         return NULL;
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxHelpProvider *)wxHelpProvider::Get();
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxHelpProvider *)wxHelpProvider::Get();
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxHelpProvider_p");
@@ -871,13 +696,17 @@ static PyObject *_wrap_wxHelpProvider_GetHelp(PyObject *self, PyObject *args, Py
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = new wxString (wxHelpProvider_GetHelp(_arg0,_arg1));
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = new wxString (wxHelpProvider_GetHelp(_arg0,_arg1));
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }{
+#if wxUSE_UNICODE
+    _resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
+#else
     _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
+#endif
 }
 {
     delete _result;
@@ -890,7 +719,7 @@ static PyObject *_wrap_wxHelpProvider_ShowHelp(PyObject *self, PyObject *args, P
     PyObject * _resultobj;
     bool  _result;
     wxHelpProvider * _arg0;
-    wxWindowBase * _arg1;
+    wxWindow * _arg1;
     PyObject * _argo0 = 0;
     PyObject * _argo1 = 0;
     char *_kwnames[] = { "self","window", NULL };
@@ -907,16 +736,16 @@ static PyObject *_wrap_wxHelpProvider_ShowHelp(PyObject *self, PyObject *args, P
     }
     if (_argo1) {
         if (_argo1 == Py_None) { _arg1 = NULL; }
-        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindowBase_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxHelpProvider_ShowHelp. Expected _wxWindowBase_p.");
+        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxHelpProvider_ShowHelp. Expected _wxWindow_p.");
         return NULL;
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (bool )wxHelpProvider_ShowHelp(_arg0,_arg1);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (bool )wxHelpProvider_ShowHelp(_arg0,_arg1);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    _resultobj = Py_BuildValue("i",_result);
     return _resultobj;
@@ -926,7 +755,7 @@ static PyObject *_wrap_wxHelpProvider_ShowHelp(PyObject *self, PyObject *args, P
 static PyObject *_wrap_wxHelpProvider_AddHelp(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     wxHelpProvider * _arg0;
-    wxWindowBase * _arg1;
+    wxWindow * _arg1;
     wxString * _arg2;
     PyObject * _argo0 = 0;
     PyObject * _argo1 = 0;
@@ -945,34 +774,21 @@ static PyObject *_wrap_wxHelpProvider_AddHelp(PyObject *self, PyObject *args, Py
     }
     if (_argo1) {
         if (_argo1 == Py_None) { _arg1 = NULL; }
-        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindowBase_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxHelpProvider_AddHelp. Expected _wxWindowBase_p.");
+        else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) {
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxHelpProvider_AddHelp. Expected _wxWindow_p.");
         return NULL;
         }
     }
 {
-#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
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxHelpProvider_AddHelp(_arg0,_arg1,*_arg2);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxHelpProvider_AddHelp(_arg0,_arg1,*_arg2);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -1004,28 +820,15 @@ static PyObject *_wrap_wxHelpProvider_AddHelpById(PyObject *self, PyObject *args
         }
     }
 {
-#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)
+    _arg2 = wxString_in_helper(_obj2);
+    if (_arg2 == NULL)
         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
 }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxHelpProvider_AddHelpById(_arg0,_arg1,*_arg2);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxHelpProvider_AddHelpById(_arg0,_arg1,*_arg2);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -1054,10 +857,10 @@ static PyObject *_wrap_wxHelpProvider_Destroy(PyObject *self, PyObject *args, Py
         }
     }
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        wxHelpProvider_Destroy(_arg0);
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    wxHelpProvider_Destroy(_arg0);
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    Py_INCREF(Py_None);
     _resultobj = Py_None;
@@ -1083,10 +886,10 @@ static PyObject *_wrap_new_wxSimpleHelpProvider(PyObject *self, PyObject *args,
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxSimpleHelpProvider",_kwnames)) 
         return NULL;
 {
-    wxPy_BEGIN_ALLOW_THREADS;
-        _result = (wxSimpleHelpProvider *)new_wxSimpleHelpProvider();
+    PyThreadState* __tstate = wxPyBeginAllowThreads();
+    _result = (wxSimpleHelpProvider *)new_wxSimpleHelpProvider();
 
-    wxPy_END_ALLOW_THREADS;
+    wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
 }    if (_result) {
         SWIG_MakePtr(_ptemp, (char *) _result,"_wxSimpleHelpProvider_p");
@@ -1112,9 +915,6 @@ static PyMethodDef helpcMethods[] = {
         { "wxContextHelp_BeginContextHelp", (PyCFunction) _wrap_wxContextHelp_BeginContextHelp, METH_VARARGS | METH_KEYWORDS },
         { "delete_wxContextHelp", (PyCFunction) _wrap_delete_wxContextHelp, METH_VARARGS | METH_KEYWORDS },
         { "new_wxContextHelp", (PyCFunction) _wrap_new_wxContextHelp, METH_VARARGS | METH_KEYWORDS },
-        { "wxContextMenuEvent_SetPosition", (PyCFunction) _wrap_wxContextMenuEvent_SetPosition, METH_VARARGS | METH_KEYWORDS },
-        { "wxContextMenuEvent_GetPosition", (PyCFunction) _wrap_wxContextMenuEvent_GetPosition, METH_VARARGS | METH_KEYWORDS },
-        { "new_wxContextMenuEvent", (PyCFunction) _wrap_new_wxContextMenuEvent, METH_VARARGS | METH_KEYWORDS },
         { "wxHelpEvent_SetTarget", (PyCFunction) _wrap_wxHelpEvent_SetTarget, METH_VARARGS | METH_KEYWORDS },
         { "wxHelpEvent_GetTarget", (PyCFunction) _wrap_wxHelpEvent_GetTarget, METH_VARARGS | METH_KEYWORDS },
         { "wxHelpEvent_SetLink", (PyCFunction) _wrap_wxHelpEvent_SetLink, METH_VARARGS | METH_KEYWORDS },
@@ -1131,9 +931,6 @@ static PyMethodDef helpcMethods[] = {
  * This table is used by the pointer type-checker
  */
 static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
-    { "_wxEvent","_class_wxContextMenuEvent",SwigwxContextMenuEventTowxEvent},
-    { "_wxEvent","_wxContextMenuEvent",SwigwxContextMenuEventTowxEvent},
-    { "_wxEvent","_class_wxHelpEvent",SwigwxHelpEventTowxEvent},
     { "_wxEvent","_wxHelpEvent",SwigwxHelpEventTowxEvent},
     { "_signed_long","_long",0},
     { "_wxPrintQuality","_wxCoord",0},
@@ -1145,21 +942,10 @@ 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_wxContextHelpButton",SwigwxContextHelpButtonTowxEvtHandler},
-    { "_class_wxEvtHandler","_wxContextHelpButton",SwigwxContextHelpButtonTowxEvtHandler},
     { "_byte","_unsigned_char",0},
     { "_long","_unsigned_long",0},
     { "_long","_signed_long",0},
-    { "_wxBitmapButton","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxBitmapButton},
     { "_wxBitmapButton","_wxContextHelpButton",SwigwxContextHelpButtonTowxBitmapButton},
-    { "_class_wxObject","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxObject},
-    { "_class_wxObject","_wxContextHelpButton",SwigwxContextHelpButtonTowxObject},
-    { "_class_wxObject","_class_wxContextHelp",SwigwxContextHelpTowxObject},
-    { "_class_wxObject","_wxContextHelp",SwigwxContextHelpTowxObject},
-    { "_class_wxObject","_class_wxContextMenuEvent",SwigwxContextMenuEventTowxObject},
-    { "_class_wxObject","_wxContextMenuEvent",SwigwxContextMenuEventTowxObject},
-    { "_class_wxObject","_class_wxHelpEvent",SwigwxHelpEventTowxObject},
-    { "_class_wxObject","_wxHelpEvent",SwigwxHelpEventTowxObject},
     { "_size_t","_wxCoord",0},
     { "_size_t","_wxPrintQuality",0},
     { "_size_t","_time_t",0},
@@ -1175,18 +961,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_uint","_int",0},
     { "_uint","_wxWindowID",0},
     { "_wxChar","_char",0},
-    { "_class_wxEvent","_class_wxContextMenuEvent",SwigwxContextMenuEventTowxEvent},
-    { "_class_wxEvent","_wxContextMenuEvent",SwigwxContextMenuEventTowxEvent},
-    { "_class_wxEvent","_class_wxHelpEvent",SwigwxHelpEventTowxEvent},
-    { "_class_wxEvent","_wxHelpEvent",SwigwxHelpEventTowxEvent},
-    { "_wxCommandEvent","_class_wxContextMenuEvent",SwigwxContextMenuEventTowxCommandEvent},
-    { "_wxCommandEvent","_wxContextMenuEvent",SwigwxContextMenuEventTowxCommandEvent},
-    { "_wxCommandEvent","_class_wxHelpEvent",SwigwxHelpEventTowxCommandEvent},
     { "_wxCommandEvent","_wxHelpEvent",SwigwxHelpEventTowxCommandEvent},
-    { "_class_wxButton","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxButton},
-    { "_class_wxButton","_wxContextHelpButton",SwigwxContextHelpButtonTowxButton},
     { "_char","_wxChar",0},
-    { "_wxHelpProvider","_class_wxSimpleHelpProvider",SwigwxSimpleHelpProviderTowxHelpProvider},
     { "_wxHelpProvider","_wxSimpleHelpProvider",SwigwxSimpleHelpProviderTowxHelpProvider},
     { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0},
     { "_EBool","_wxCoord",0},
@@ -1206,20 +982,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_WXTYPE","_unsigned_short",0},
     { "_unsigned_short","_WXTYPE",0},
     { "_unsigned_short","_short",0},
-    { "_class_wxWindow","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxWindow},
-    { "_class_wxWindow","_wxContextHelpButton",SwigwxContextHelpButtonTowxWindow},
-    { "_wxObject","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxObject},
     { "_wxObject","_wxContextHelpButton",SwigwxContextHelpButtonTowxObject},
-    { "_wxObject","_class_wxContextHelp",SwigwxContextHelpTowxObject},
     { "_wxObject","_wxContextHelp",SwigwxContextHelpTowxObject},
-    { "_wxObject","_class_wxContextMenuEvent",SwigwxContextMenuEventTowxObject},
-    { "_wxObject","_wxContextMenuEvent",SwigwxContextMenuEventTowxObject},
-    { "_wxObject","_class_wxHelpEvent",SwigwxHelpEventTowxObject},
     { "_wxObject","_wxHelpEvent",SwigwxHelpEventTowxObject},
     { "_signed_short","_WXTYPE",0},
     { "_signed_short","_short",0},
     { "_unsigned_char","_byte",0},
-    { "_wxControl","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxControl},
     { "_wxControl","_wxContextHelpButton",SwigwxContextHelpButtonTowxControl},
     { "_unsigned_int","_wxCoord",0},
     { "_unsigned_int","_wxPrintQuality",0},
@@ -1231,8 +999,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_short","_WXTYPE",0},
     { "_short","_unsigned_short",0},
     { "_short","_signed_short",0},
-    { "_class_wxBitmapButton","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxBitmapButton},
-    { "_class_wxBitmapButton","_wxContextHelpButton",SwigwxContextHelpButtonTowxBitmapButton},
     { "_wxWindowID","_wxCoord",0},
     { "_wxWindowID","_wxPrintQuality",0},
     { "_wxWindowID","_time_t",0},
@@ -1258,10 +1024,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_time_t","_wxWindowID",0},
     { "_time_t","_uint",0},
     { "_time_t","_size_t",0},
-    { "_wxButton","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxButton},
     { "_wxButton","_wxContextHelpButton",SwigwxContextHelpButtonTowxButton},
-    { "_class_wxControl","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxControl},
-    { "_class_wxControl","_wxContextHelpButton",SwigwxContextHelpButtonTowxControl},
     { "_wxCoord","_int",0},
     { "_wxCoord","_signed_int",0},
     { "_wxCoord","_unsigned_int",0},
@@ -1271,15 +1034,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxCoord","_size_t",0},
     { "_wxCoord","_time_t",0},
     { "_wxCoord","_wxPrintQuality",0},
-    { "_class_wxCommandEvent","_class_wxContextMenuEvent",SwigwxContextMenuEventTowxCommandEvent},
-    { "_class_wxCommandEvent","_wxContextMenuEvent",SwigwxContextMenuEventTowxCommandEvent},
-    { "_class_wxCommandEvent","_class_wxHelpEvent",SwigwxHelpEventTowxCommandEvent},
-    { "_class_wxCommandEvent","_wxHelpEvent",SwigwxHelpEventTowxCommandEvent},
-    { "_wxEvtHandler","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxEvtHandler},
     { "_wxEvtHandler","_wxContextHelpButton",SwigwxContextHelpButtonTowxEvtHandler},
-    { "_class_wxHelpProvider","_class_wxSimpleHelpProvider",SwigwxSimpleHelpProviderTowxHelpProvider},
-    { "_class_wxHelpProvider","_wxSimpleHelpProvider",SwigwxSimpleHelpProviderTowxHelpProvider},
-    { "_wxWindow","_class_wxContextHelpButton",SwigwxContextHelpButtonTowxWindow},
     { "_wxWindow","_wxContextHelpButton",SwigwxContextHelpButtonTowxWindow},
 {0,0,0}};
 
@@ -1297,7 +1052,6 @@ SWIGEXPORT(void) inithelpc() {
         PyDict_SetItemString(d,"wxID_CONTEXT_HELP", PyInt_FromLong((long) wxID_CONTEXT_HELP));
         PyDict_SetItemString(d,"wxEVT_HELP", PyInt_FromLong((long) wxEVT_HELP));
         PyDict_SetItemString(d,"wxEVT_DETAILED_HELP", PyInt_FromLong((long) wxEVT_DETAILED_HELP));
-        PyDict_SetItemString(d,"wxEVT_CONTEXT_MENU", PyInt_FromLong((long) wxEVT_CONTEXT_MENU));
 {
    int i;
    for (i = 0; _swig_mapping[i].n1; i++)