From 7c379a20cf2c4dfe8c0d4eecd4c7610a6ae6d99d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 24 Jun 2002 23:55:30 +0000 Subject: [PATCH] Some typemap updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15952 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/gizmos/gizmos.cpp | 55 ++++-------------------------- wxPython/contrib/gizmos/gizmos.i | 1 + wxPython/contrib/gizmos/gizmos.py | 6 ---- wxPython/src/my_typemaps.i | 2 ++ 4 files changed, 10 insertions(+), 54 deletions(-) diff --git a/wxPython/contrib/gizmos/gizmos.cpp b/wxPython/contrib/gizmos/gizmos.cpp index 7e94899268..f92d609908 100644 --- a/wxPython/contrib/gizmos/gizmos.cpp +++ b/wxPython/contrib/gizmos/gizmos.cpp @@ -60,6 +60,7 @@ extern PyObject *SWIG_newvarlink(void); #include #include #include +#include static PyObject* t_output_helper(PyObject* target, PyObject* o) { @@ -723,7 +724,6 @@ static PyObject *_wrap_wxEditableListBox_GetListCtrl(PyObject *self, PyObject *a wxEditableListBox * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEditableListBox_GetListCtrl",_kwnames,&_argo0)) @@ -741,13 +741,7 @@ static PyObject *_wrap_wxEditableListBox_GetListCtrl(PyObject *self, PyObject *a wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxListCtrl_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } @@ -758,7 +752,6 @@ static PyObject *_wrap_wxEditableListBox_GetDelButton(PyObject *self, PyObject * wxEditableListBox * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEditableListBox_GetDelButton",_kwnames,&_argo0)) @@ -776,13 +769,7 @@ static PyObject *_wrap_wxEditableListBox_GetDelButton(PyObject *self, PyObject * wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmapButton_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } @@ -793,7 +780,6 @@ static PyObject *_wrap_wxEditableListBox_GetNewButton(PyObject *self, PyObject * wxEditableListBox * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEditableListBox_GetNewButton",_kwnames,&_argo0)) @@ -811,13 +797,7 @@ static PyObject *_wrap_wxEditableListBox_GetNewButton(PyObject *self, PyObject * wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmapButton_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } @@ -828,7 +808,6 @@ static PyObject *_wrap_wxEditableListBox_GetUpButton(PyObject *self, PyObject *a wxEditableListBox * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEditableListBox_GetUpButton",_kwnames,&_argo0)) @@ -846,13 +825,7 @@ static PyObject *_wrap_wxEditableListBox_GetUpButton(PyObject *self, PyObject *a wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmapButton_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } @@ -863,7 +836,6 @@ static PyObject *_wrap_wxEditableListBox_GetDownButton(PyObject *self, PyObject wxEditableListBox * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEditableListBox_GetDownButton",_kwnames,&_argo0)) @@ -881,13 +853,7 @@ static PyObject *_wrap_wxEditableListBox_GetDownButton(PyObject *self, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmapButton_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } @@ -898,7 +864,6 @@ static PyObject *_wrap_wxEditableListBox_GetEditButton(PyObject *self, PyObject wxEditableListBox * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxEditableListBox_GetEditButton",_kwnames,&_argo0)) @@ -916,13 +881,7 @@ static PyObject *_wrap_wxEditableListBox_GetEditButton(PyObject *self, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmapButton_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index 466d181c47..48b33f4e7c 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -19,6 +19,7 @@ #include #include #include +#include %} //--------------------------------------------------------------------------- diff --git a/wxPython/contrib/gizmos/gizmos.py b/wxPython/contrib/gizmos/gizmos.py index c96190872e..dfb3f66d85 100644 --- a/wxPython/contrib/gizmos/gizmos.py +++ b/wxPython/contrib/gizmos/gizmos.py @@ -121,27 +121,21 @@ class wxEditableListBoxPtr(wxPanelPtr): return val def GetListCtrl(self, *_args, **_kwargs): val = apply(gizmosc.wxEditableListBox_GetListCtrl,(self,) + _args, _kwargs) - if val: val = wxListCtrlPtr(val) return val def GetDelButton(self, *_args, **_kwargs): val = apply(gizmosc.wxEditableListBox_GetDelButton,(self,) + _args, _kwargs) - if val: val = wxBitmapButtonPtr(val) return val def GetNewButton(self, *_args, **_kwargs): val = apply(gizmosc.wxEditableListBox_GetNewButton,(self,) + _args, _kwargs) - if val: val = wxBitmapButtonPtr(val) return val def GetUpButton(self, *_args, **_kwargs): val = apply(gizmosc.wxEditableListBox_GetUpButton,(self,) + _args, _kwargs) - if val: val = wxBitmapButtonPtr(val) return val def GetDownButton(self, *_args, **_kwargs): val = apply(gizmosc.wxEditableListBox_GetDownButton,(self,) + _args, _kwargs) - if val: val = wxBitmapButtonPtr(val) return val def GetEditButton(self, *_args, **_kwargs): val = apply(gizmosc.wxEditableListBox_GetEditButton,(self,) + _args, _kwargs) - if val: val = wxBitmapButtonPtr(val) return val def __repr__(self): return "" % (self.this,) diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index d32602247b..91fb0ada96 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -383,10 +383,12 @@ $function %typemap(python, out) wxToolTip* { $target = wxPyMake_wxObject($source); } +%typemap(python, out) wxBitmapButton* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxButton* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxControl* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxFrame* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxGrid* { $target = wxPyMake_wxObject($source); } +%typemap(python, out) wxListCtrl* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxMDIChildFrame* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxMDIClientWindow* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxMenuBar* { $target = wxPyMake_wxObject($source); } -- 2.47.2