From b98a5dfcddb061692a11515ce7de4855840f9b6a Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 19 Apr 2002 20:12:50 +0000 Subject: [PATCH] SWIGed changes for wxGTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gtk/clip_dnd.cpp | 1 + wxPython/src/gtk/clip_dnd.py | 1 + wxPython/src/gtk/gdi.cpp | 6 +- wxPython/src/gtk/grid.cpp | 391 +++++++++++++++++++++------------- wxPython/src/gtk/grid.py | 55 +++-- wxPython/src/gtk/htmlhelp.cpp | 9 - wxPython/src/gtk/htmlhelp.py | 2 +- wxPython/src/gtk/misc2.cpp | 114 +++++----- wxPython/src/gtk/misc2.py | 34 +-- wxPython/src/gtk/sizers.py | 8 + wxPython/src/gtk/wx.cpp | 3 +- 11 files changed, 368 insertions(+), 256 deletions(-) diff --git a/wxPython/src/gtk/clip_dnd.cpp b/wxPython/src/gtk/clip_dnd.cpp index 41af843abb..91f1826fb4 100644 --- a/wxPython/src/gtk/clip_dnd.cpp +++ b/wxPython/src/gtk/clip_dnd.cpp @@ -3672,6 +3672,7 @@ SWIGEXPORT(void) initclip_dndc() { PyDict_SetItemString(d,"wxDF_FILENAME", PyInt_FromLong((long) wxDF_FILENAME)); PyDict_SetItemString(d,"wxDF_LOCALE", PyInt_FromLong((long) wxDF_LOCALE)); PyDict_SetItemString(d,"wxDF_PRIVATE", PyInt_FromLong((long) wxDF_PRIVATE)); + PyDict_SetItemString(d,"wxDF_HTML", PyInt_FromLong((long) wxDF_HTML)); PyDict_SetItemString(d,"wxDF_MAX", PyInt_FromLong((long) wxDF_MAX)); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxFormatInvalid",_wrap_wxPyFormatInvalid_get, _wrap_wxPyFormatInvalid_set); diff --git a/wxPython/src/gtk/clip_dnd.py b/wxPython/src/gtk/clip_dnd.py index cbcf034d48..2b864141f4 100644 --- a/wxPython/src/gtk/clip_dnd.py +++ b/wxPython/src/gtk/clip_dnd.py @@ -517,6 +517,7 @@ wxDF_ENHMETAFILE = clip_dndc.wxDF_ENHMETAFILE wxDF_FILENAME = clip_dndc.wxDF_FILENAME wxDF_LOCALE = clip_dndc.wxDF_LOCALE wxDF_PRIVATE = clip_dndc.wxDF_PRIVATE +wxDF_HTML = clip_dndc.wxDF_HTML wxDF_MAX = clip_dndc.wxDF_MAX cvar = clip_dndc.cvar wxFormatInvalid = wxDataFormatPtr(clip_dndc.cvar.wxFormatInvalid) diff --git a/wxPython/src/gtk/gdi.cpp b/wxPython/src/gtk/gdi.cpp index 35417a80ba..5e284547ac 100644 --- a/wxPython/src/gtk/gdi.cpp +++ b/wxPython/src/gtk/gdi.cpp @@ -5392,6 +5392,7 @@ static PyObject *_wrap_wxDC_EndPage(PyObject *self, PyObject *args, PyObject *kw #define wxDC_FloodFill(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->FloodFill(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) static PyObject *_wrap_wxDC_FloodFill(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; + bool _result; wxDC * _arg0; long _arg1; long _arg2; @@ -5419,12 +5420,11 @@ static PyObject *_wrap_wxDC_FloodFill(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxDC_FloodFill(_arg0,_arg1,_arg2,*_arg3,_arg4); + _result = (bool )wxDC_FloodFill(_arg0,_arg1,_arg2,*_arg3,_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } diff --git a/wxPython/src/gtk/grid.cpp b/wxPython/src/gtk/grid.cpp index 7ba7e379e6..23660e2746 100644 --- a/wxPython/src/gtk/grid.cpp +++ b/wxPython/src/gtk/grid.cpp @@ -88,6 +88,8 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { // Put some wx default wxChar* values into wxStrings. DECLARE_DEF_STRING(PanelNameStr); + DECLARE_DEF_STRING2(DateTimeFormatStr, wxT("%c")); + static const wxString wxPyEmptyString(wxT("")); #define PYCALLBACK_GCA_INTINTKIND(PCLASS, CBNAME) \ wxGridCellAttr* CBNAME(int a, int b, wxGridCellAttr::wxAttrKind c) { \ @@ -483,6 +485,39 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { + + +#define wxPyMake_TEMPLATE(TYPE) \ +PyObject* wxPyMake_##TYPE(TYPE* source) { \ + PyObject* target = NULL; \ + if (source) { \ + /* Check if there is already a pointer to a Python object in the \ + OOR data that we can use. */ \ + wxPyOORClientData* data = (wxPyOORClientData*)source->GetClientObject(); \ + if (data) { \ + target = data->m_obj; \ + Py_INCREF(target); \ + } \ + /* Otherwise make a new wrapper for it the old fashioned way and \ + give it the OOR treatment */ \ + if (! target) { \ + target = wxPyConstructObject(source, #TYPE, FALSE); \ + if (target) \ + source->SetClientObject(new wxPyOORClientData(target)); \ + } \ + } else { /* source was NULL so return None. */ \ + Py_INCREF(Py_None); target = Py_None; \ + } \ + return target; \ +} \ + +wxPyMake_TEMPLATE(wxGridCellRenderer) +wxPyMake_TEMPLATE(wxGridCellEditor) +wxPyMake_TEMPLATE(wxGridCellAttr) +wxPyMake_TEMPLATE(wxGridCellAttrProvider) +wxPyMake_TEMPLATE(wxGridTableBase) + + class wxPyGridCellRenderer : public wxGridCellRenderer { public: @@ -878,6 +913,41 @@ static PyObject *_wrap_wxGridNoCellRect_get() { return pyobj; } +static void wxGridCellRenderer__setOORInfo(wxGridCellRenderer *self,PyObject * _self) { + self->SetClientObject(new wxPyOORClientData(_self)); + } +static PyObject *_wrap_wxGridCellRenderer__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellRenderer * _arg0; + PyObject * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","_self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellRenderer__setOORInfo",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGridCellRenderer_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGridCellRenderer__setOORInfo. Expected _wxGridCellRenderer_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxGridCellRenderer__setOORInfo(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxGridCellRenderer_SetParameters(_swigobj,_swigarg0) (_swigobj->SetParameters(_swigarg0)) static PyObject *_wrap_wxGridCellRenderer_SetParameters(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1107,7 +1177,6 @@ static PyObject *_wrap_wxGridCellRenderer_Clone(PyObject *self, PyObject *args, wxGridCellRenderer * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGridCellRenderer_Clone",_kwnames,&_argo0)) @@ -1125,13 +1194,7 @@ static PyObject *_wrap_wxGridCellRenderer_Clone(PyObject *self, PyObject *args, wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellRenderer_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellRenderer(_result); } return _resultobj; } @@ -1534,8 +1597,8 @@ static void *SwigwxGridCellDateTimeRendererTowxGridCellRenderer(void *ptr) { static PyObject *_wrap_new_wxGridCellDateTimeRenderer(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxGridCellDateTimeRenderer * _result; - wxString * _arg0 = (wxString *) &"%c"; - wxString * _arg1 = (wxString *) &"%c"; + wxString * _arg0 = (wxString *) &wxPyDateTimeFormatStr; + wxString * _arg1 = (wxString *) &wxPyDateTimeFormatStr; PyObject * _obj0 = 0; PyObject * _obj1 = 0; char *_kwnames[] = { "outformat","informat", NULL }; @@ -1600,7 +1663,7 @@ static void *SwigwxGridCellEnumRendererTowxGridCellRenderer(void *ptr) { static PyObject *_wrap_new_wxGridCellEnumRenderer(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxGridCellEnumRenderer * _result; - wxString * _arg0 = (wxString *) &""; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "choices", NULL }; char _ptemp[128]; @@ -1676,6 +1739,41 @@ static PyObject *_wrap_new_wxGridCellAutoWrapStringRenderer(PyObject *self, PyOb return _resultobj; } +static void wxGridCellEditor__setOORInfo(wxGridCellEditor *self,PyObject * _self) { + self->SetClientObject(new wxPyOORClientData(_self)); + } +static PyObject *_wrap_wxGridCellEditor__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellEditor * _arg0; + PyObject * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","_self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellEditor__setOORInfo",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGridCellEditor_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGridCellEditor__setOORInfo. Expected _wxGridCellEditor_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxGridCellEditor__setOORInfo(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxGridCellEditor_IsCreated(_swigobj) (_swigobj->IsCreated()) static PyObject *_wrap_wxGridCellEditor_IsCreated(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2024,7 +2122,6 @@ static PyObject *_wrap_wxGridCellEditor_Clone(PyObject *self, PyObject *args, Py wxGridCellEditor * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGridCellEditor_Clone",_kwnames,&_argo0)) @@ -2042,13 +2139,7 @@ static PyObject *_wrap_wxGridCellEditor_Clone(PyObject *self, PyObject *args, Py wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEditor_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellEditor(_result); } return _resultobj; } @@ -2971,7 +3062,7 @@ static void *SwigwxGridCellEnumEditorTowxGridCellEditor(void *ptr) { static PyObject *_wrap_new_wxGridCellEnumEditor(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxGridCellEnumEditor * _result; - wxString * _arg0 = (wxString *) &""; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "choices", NULL }; char _ptemp[128]; @@ -3047,6 +3138,41 @@ static PyObject *_wrap_new_wxGridCellAutoWrapStringEditor(PyObject *self, PyObje return _resultobj; } +static void wxGridCellAttr__setOORInfo(wxGridCellAttr *self,PyObject * _self) { + self->SetClientObject(new wxPyOORClientData(_self)); + } +static PyObject *_wrap_wxGridCellAttr__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellAttr * _arg0; + PyObject * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","_self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellAttr__setOORInfo",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGridCellAttr_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGridCellAttr__setOORInfo. Expected _wxGridCellAttr_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxGridCellAttr__setOORInfo(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define new_wxGridCellAttr(_swigarg0) (new wxGridCellAttr(_swigarg0)) static PyObject *_wrap_new_wxGridCellAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3089,7 +3215,6 @@ static PyObject *_wrap_wxGridCellAttr_Clone(PyObject *self, PyObject *args, PyOb wxGridCellAttr * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGridCellAttr_Clone",_kwnames,&_argo0)) @@ -3107,13 +3232,7 @@ static PyObject *_wrap_wxGridCellAttr_Clone(PyObject *self, PyObject *args, PyOb wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAttr_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellAttr(_result); } return _resultobj; } @@ -3828,7 +3947,6 @@ static PyObject *_wrap_wxGridCellAttr_GetRenderer(PyObject *self, PyObject *args PyObject * _argo0 = 0; PyObject * _argo1 = 0; char *_kwnames[] = { "self","grid","row","col", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOii:wxGridCellAttr_GetRenderer",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3)) @@ -3853,13 +3971,7 @@ static PyObject *_wrap_wxGridCellAttr_GetRenderer(PyObject *self, PyObject *args wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellRenderer_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellRenderer(_result); } return _resultobj; } @@ -3874,7 +3986,6 @@ static PyObject *_wrap_wxGridCellAttr_GetEditor(PyObject *self, PyObject *args, PyObject * _argo0 = 0; PyObject * _argo1 = 0; char *_kwnames[] = { "self","grid","row","col", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOii:wxGridCellAttr_GetEditor",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3)) @@ -3899,13 +4010,7 @@ static PyObject *_wrap_wxGridCellAttr_GetEditor(PyObject *self, PyObject *args, wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEditor_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellEditor(_result); } return _resultobj; } @@ -4000,6 +4105,41 @@ static PyObject *_wrap_new_wxGridCellAttrProvider(PyObject *self, PyObject *args return _resultobj; } +static void wxGridCellAttrProvider__setOORInfo(wxGridCellAttrProvider *self,PyObject * _self) { + self->SetClientObject(new wxPyOORClientData(_self)); + } +static PyObject *_wrap_wxGridCellAttrProvider__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridCellAttrProvider * _arg0; + PyObject * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","_self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridCellAttrProvider__setOORInfo",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGridCellAttrProvider_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGridCellAttrProvider__setOORInfo. Expected _wxGridCellAttrProvider_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxGridCellAttrProvider__setOORInfo(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxGridCellAttrProvider_GetAttr(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->GetAttr(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_wxGridCellAttrProvider_GetAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4010,7 +4150,6 @@ static PyObject *_wrap_wxGridCellAttrProvider_GetAttr(PyObject *self, PyObject * wxGridCellAttr::wxAttrKind _arg3; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col","kind", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiii:wxGridCellAttrProvider_GetAttr",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) @@ -4028,13 +4167,7 @@ static PyObject *_wrap_wxGridCellAttrProvider_GetAttr(PyObject *self, PyObject * wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAttr_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellAttr(_result); } return _resultobj; } @@ -4295,7 +4428,6 @@ static PyObject *_wrap_wxPyGridCellAttrProvider_base_GetAttr(PyObject *self, PyO wxGridCellAttr::wxAttrKind _arg3; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col","kind", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiii:wxPyGridCellAttrProvider_base_GetAttr",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) @@ -4313,13 +4445,7 @@ static PyObject *_wrap_wxPyGridCellAttrProvider_base_GetAttr(PyObject *self, PyO wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAttr_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellAttr(_result); } return _resultobj; } @@ -4446,6 +4572,41 @@ static void *SwigwxGridTableBaseTowxObject(void *ptr) { return (void *) dest; } +static void wxGridTableBase__setOORInfo(wxGridTableBase *self,PyObject * _self) { + self->SetClientObject(new wxPyOORClientData(_self)); + } +static PyObject *_wrap_wxGridTableBase__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxGridTableBase * _arg0; + PyObject * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","_self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGridTableBase__setOORInfo",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGridTableBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGridTableBase__setOORInfo. Expected _wxGridTableBase_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxGridTableBase__setOORInfo(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxGridTableBase_SetAttrProvider(_swigobj,_swigarg0) (_swigobj->SetAttrProvider(_swigarg0)) static PyObject *_wrap_wxGridTableBase_SetAttrProvider(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4490,7 +4651,6 @@ static PyObject *_wrap_wxGridTableBase_GetAttrProvider(PyObject *self, PyObject wxGridTableBase * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGridTableBase_GetAttrProvider",_kwnames,&_argo0)) @@ -4508,13 +4668,7 @@ static PyObject *_wrap_wxGridTableBase_GetAttrProvider(PyObject *self, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAttrProvider_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellAttrProvider(_result); } return _resultobj; } @@ -5455,7 +5609,6 @@ static PyObject *_wrap_wxGridTableBase_GetAttr(PyObject *self, PyObject *args, P wxGridCellAttr::wxAttrKind _arg3; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col","kind", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiii:wxGridTableBase_GetAttr",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) @@ -5473,13 +5626,7 @@ static PyObject *_wrap_wxGridTableBase_GetAttr(PyObject *self, PyObject *args, P wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAttr_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellAttr(_result); } return _resultobj; } @@ -6227,7 +6374,6 @@ static PyObject *_wrap_wxPyGridTableBase_base_GetAttr(PyObject *self, PyObject * wxGridCellAttr::wxAttrKind _arg3; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col","kind", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiii:wxPyGridTableBase_base_GetAttr",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) @@ -6245,13 +6391,7 @@ static PyObject *_wrap_wxPyGridTableBase_base_GetAttr(PyObject *self, PyObject * wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellAttr_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellAttr(_result); } return _resultobj; } @@ -6541,7 +6681,7 @@ static PyObject *_wrap_wxGridTableMessage_GetTableObject(PyObject *self, PyObjec wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxGridTableBase(_result); } return _resultobj; } @@ -7274,7 +7414,7 @@ static PyObject *_wrap_wxGrid_GetTable(PyObject *self, PyObject *args, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxGridTableBase(_result); } return _resultobj; } @@ -11351,7 +11491,6 @@ static PyObject *_wrap_wxGrid_GetDefaultRenderer(PyObject *self, PyObject *args, wxGrid * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGrid_GetDefaultRenderer",_kwnames,&_argo0)) @@ -11369,13 +11508,7 @@ static PyObject *_wrap_wxGrid_GetDefaultRenderer(PyObject *self, PyObject *args, wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellRenderer_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellRenderer(_result); } return _resultobj; } @@ -11388,7 +11521,6 @@ static PyObject *_wrap_wxGrid_GetCellRenderer(PyObject *self, PyObject *args, Py int _arg2; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxGrid_GetCellRenderer",_kwnames,&_argo0,&_arg1,&_arg2)) @@ -11406,13 +11538,7 @@ static PyObject *_wrap_wxGrid_GetCellRenderer(PyObject *self, PyObject *args, Py wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellRenderer_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellRenderer(_result); } return _resultobj; } @@ -11499,7 +11625,6 @@ static PyObject *_wrap_wxGrid_GetDefaultEditor(PyObject *self, PyObject *args, P wxGrid * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGrid_GetDefaultEditor",_kwnames,&_argo0)) @@ -11517,13 +11642,7 @@ static PyObject *_wrap_wxGrid_GetDefaultEditor(PyObject *self, PyObject *args, P wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEditor_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellEditor(_result); } return _resultobj; } @@ -11536,7 +11655,6 @@ static PyObject *_wrap_wxGrid_GetCellEditor(PyObject *self, PyObject *args, PyOb int _arg2; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxGrid_GetCellEditor",_kwnames,&_argo0,&_arg1,&_arg2)) @@ -11554,13 +11672,7 @@ static PyObject *_wrap_wxGrid_GetCellEditor(PyObject *self, PyObject *args, PyOb wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEditor_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellEditor(_result); } return _resultobj; } @@ -12164,7 +12276,6 @@ static PyObject *_wrap_wxGrid_GetDefaultEditorForCell(PyObject *self, PyObject * int _arg2; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxGrid_GetDefaultEditorForCell",_kwnames,&_argo0,&_arg1,&_arg2)) @@ -12182,13 +12293,7 @@ static PyObject *_wrap_wxGrid_GetDefaultEditorForCell(PyObject *self, PyObject * wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEditor_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellEditor(_result); } return _resultobj; } @@ -12201,7 +12306,6 @@ static PyObject *_wrap_wxGrid_GetDefaultRendererForCell(PyObject *self, PyObject int _arg2; PyObject * _argo0 = 0; char *_kwnames[] = { "self","row","col", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxGrid_GetDefaultRendererForCell",_kwnames,&_argo0,&_arg1,&_arg2)) @@ -12219,13 +12323,7 @@ static PyObject *_wrap_wxGrid_GetDefaultRendererForCell(PyObject *self, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellRenderer_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellRenderer(_result); } return _resultobj; } @@ -12238,7 +12336,6 @@ static PyObject *_wrap_wxGrid_GetDefaultEditorForType(PyObject *self, PyObject * PyObject * _argo0 = 0; PyObject * _obj1 = 0; char *_kwnames[] = { "self","typeName", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_GetDefaultEditorForType",_kwnames,&_argo0,&_obj1)) @@ -12261,13 +12358,7 @@ static PyObject *_wrap_wxGrid_GetDefaultEditorForType(PyObject *self, PyObject * wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellEditor_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellEditor(_result); } { if (_obj1) delete _arg1; @@ -12284,7 +12375,6 @@ static PyObject *_wrap_wxGrid_GetDefaultRendererForType(PyObject *self, PyObject PyObject * _argo0 = 0; PyObject * _obj1 = 0; char *_kwnames[] = { "self","typeName", NULL }; - char _ptemp[128]; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGrid_GetDefaultRendererForType",_kwnames,&_argo0,&_obj1)) @@ -12307,13 +12397,7 @@ static PyObject *_wrap_wxGrid_GetDefaultRendererForType(PyObject *self, PyObject wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxGridCellRenderer_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +}{ _resultobj = wxPyMake_wxGridCellRenderer(_result); } { if (_obj1) delete _arg1; @@ -13970,6 +14054,7 @@ static PyMethodDef gridcMethods[] = { { "wxGridTableBase_SetView", (PyCFunction) _wrap_wxGridTableBase_SetView, METH_VARARGS | METH_KEYWORDS }, { "wxGridTableBase_GetAttrProvider", (PyCFunction) _wrap_wxGridTableBase_GetAttrProvider, METH_VARARGS | METH_KEYWORDS }, { "wxGridTableBase_SetAttrProvider", (PyCFunction) _wrap_wxGridTableBase_SetAttrProvider, METH_VARARGS | METH_KEYWORDS }, + { "wxGridTableBase__setOORInfo", (PyCFunction) _wrap_wxGridTableBase__setOORInfo, METH_VARARGS | METH_KEYWORDS }, { "wxPyGridCellAttrProvider_base_SetColAttr", (PyCFunction) _wrap_wxPyGridCellAttrProvider_base_SetColAttr, METH_VARARGS | METH_KEYWORDS }, { "wxPyGridCellAttrProvider_base_SetRowAttr", (PyCFunction) _wrap_wxPyGridCellAttrProvider_base_SetRowAttr, METH_VARARGS | METH_KEYWORDS }, { "wxPyGridCellAttrProvider_base_SetAttr", (PyCFunction) _wrap_wxPyGridCellAttrProvider_base_SetAttr, METH_VARARGS | METH_KEYWORDS }, @@ -13982,6 +14067,7 @@ static PyMethodDef gridcMethods[] = { { "wxGridCellAttrProvider_SetRowAttr", (PyCFunction) _wrap_wxGridCellAttrProvider_SetRowAttr, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellAttrProvider_SetAttr", (PyCFunction) _wrap_wxGridCellAttrProvider_SetAttr, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellAttrProvider_GetAttr", (PyCFunction) _wrap_wxGridCellAttrProvider_GetAttr, METH_VARARGS | METH_KEYWORDS }, + { "wxGridCellAttrProvider__setOORInfo", (PyCFunction) _wrap_wxGridCellAttrProvider__setOORInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellAttrProvider", (PyCFunction) _wrap_new_wxGridCellAttrProvider, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellAttr_SetDefAttr", (PyCFunction) _wrap_wxGridCellAttr_SetDefAttr, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellAttr_IsReadOnly", (PyCFunction) _wrap_wxGridCellAttr_IsReadOnly, METH_VARARGS | METH_KEYWORDS }, @@ -14011,6 +14097,7 @@ static PyMethodDef gridcMethods[] = { { "wxGridCellAttr_MergeWith", (PyCFunction) _wrap_wxGridCellAttr_MergeWith, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellAttr_Clone", (PyCFunction) _wrap_wxGridCellAttr_Clone, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellAttr", (PyCFunction) _wrap_new_wxGridCellAttr, METH_VARARGS | METH_KEYWORDS }, + { "wxGridCellAttr__setOORInfo", (PyCFunction) _wrap_wxGridCellAttr__setOORInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellAutoWrapStringEditor", (PyCFunction) _wrap_new_wxGridCellAutoWrapStringEditor, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellEnumEditor", (PyCFunction) _wrap_new_wxGridCellEnumEditor, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellChoiceEditor", (PyCFunction) _wrap_new_wxGridCellChoiceEditor, METH_VARARGS | METH_KEYWORDS }, @@ -14048,6 +14135,7 @@ static PyMethodDef gridcMethods[] = { { "wxGridCellEditor_SetControl", (PyCFunction) _wrap_wxGridCellEditor_SetControl, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellEditor_GetControl", (PyCFunction) _wrap_wxGridCellEditor_GetControl, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellEditor_IsCreated", (PyCFunction) _wrap_wxGridCellEditor_IsCreated, METH_VARARGS | METH_KEYWORDS }, + { "wxGridCellEditor__setOORInfo", (PyCFunction) _wrap_wxGridCellEditor__setOORInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellAutoWrapStringRenderer", (PyCFunction) _wrap_new_wxGridCellAutoWrapStringRenderer, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellEnumRenderer", (PyCFunction) _wrap_new_wxGridCellEnumRenderer, METH_VARARGS | METH_KEYWORDS }, { "new_wxGridCellDateTimeRenderer", (PyCFunction) _wrap_new_wxGridCellDateTimeRenderer, METH_VARARGS | METH_KEYWORDS }, @@ -14068,6 +14156,7 @@ static PyMethodDef gridcMethods[] = { { "wxGridCellRenderer_DecRef", (PyCFunction) _wrap_wxGridCellRenderer_DecRef, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellRenderer_IncRef", (PyCFunction) _wrap_wxGridCellRenderer_IncRef, METH_VARARGS | METH_KEYWORDS }, { "wxGridCellRenderer_SetParameters", (PyCFunction) _wrap_wxGridCellRenderer_SetParameters, METH_VARARGS | METH_KEYWORDS }, + { "wxGridCellRenderer__setOORInfo", (PyCFunction) _wrap_wxGridCellRenderer__setOORInfo, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } }; #ifdef __cplusplus @@ -14260,6 +14349,8 @@ SWIGEXPORT(void) initgridc() { PyDict_SetItemString(d,"wxGRID_VALUE_CHOICE", PyString_FromString("choice")); PyDict_SetItemString(d,"wxGRID_VALUE_TEXT", PyString_FromString("string")); PyDict_SetItemString(d,"wxGRID_VALUE_LONG", PyString_FromString("long")); + PyDict_SetItemString(d,"wxGRID_VALUE_CHOICEINT", PyString_FromString("choiceint")); + PyDict_SetItemString(d,"wxGRID_VALUE_DATETIME", PyString_FromString("datetime")); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxGridNoCellCoords",_wrap_wxGridNoCellCoords_get, _wrap_wxGridNoCellCoords_set); SWIG_addvarlink(SWIG_globals,"wxGridNoCellRect",_wrap_wxGridNoCellRect_get, _wrap_wxGridNoCellRect_set); diff --git a/wxPython/src/gtk/grid.py b/wxPython/src/gtk/grid.py index cfbddc55b4..36e48aae8b 100644 --- a/wxPython/src/gtk/grid.py +++ b/wxPython/src/gtk/grid.py @@ -69,6 +69,9 @@ class wxGridCellRendererPtr : def __init__(self,this): self.this = this self.thisown = 0 + def _setOORInfo(self, *_args, **_kwargs): + val = apply(gridc.wxGridCellRenderer__setOORInfo,(self,) + _args, _kwargs) + return val def SetParameters(self, *_args, **_kwargs): val = apply(gridc.wxGridCellRenderer_SetParameters,(self,) + _args, _kwargs) return val @@ -87,7 +90,6 @@ class wxGridCellRendererPtr : return val def Clone(self, *_args, **_kwargs): val = apply(gridc.wxGridCellRenderer_Clone,(self,) + _args, _kwargs) - if val: val = wxGridCellRendererPtr(val) return val def __repr__(self): return "" % (self.this,) @@ -115,6 +117,7 @@ class wxPyGridCellRenderer(wxPyGridCellRendererPtr): self.this = apply(gridc.new_wxPyGridCellRenderer,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyGridCellRenderer) + self._setOORInfo(self) @@ -129,6 +132,7 @@ class wxGridCellStringRenderer(wxGridCellStringRendererPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellStringRenderer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -143,6 +147,7 @@ class wxGridCellNumberRenderer(wxGridCellNumberRendererPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellNumberRenderer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -169,6 +174,7 @@ class wxGridCellFloatRenderer(wxGridCellFloatRendererPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellFloatRenderer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -183,6 +189,7 @@ class wxGridCellBoolRenderer(wxGridCellBoolRendererPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellBoolRenderer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -197,6 +204,7 @@ class wxGridCellDateTimeRenderer(wxGridCellDateTimeRendererPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellDateTimeRenderer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -211,6 +219,7 @@ class wxGridCellEnumRenderer(wxGridCellEnumRendererPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellEnumRenderer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -225,6 +234,7 @@ class wxGridCellAutoWrapStringRenderer(wxGridCellAutoWrapStringRendererPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellAutoWrapStringRenderer,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -233,6 +243,9 @@ class wxGridCellEditorPtr : def __init__(self,this): self.this = this self.thisown = 0 + def _setOORInfo(self, *_args, **_kwargs): + val = apply(gridc.wxGridCellEditor__setOORInfo,(self,) + _args, _kwargs) + return val def IsCreated(self, *_args, **_kwargs): val = apply(gridc.wxGridCellEditor_IsCreated,(self,) + _args, _kwargs) return val @@ -265,7 +278,6 @@ class wxGridCellEditorPtr : return val def Clone(self, *_args, **_kwargs): val = apply(gridc.wxGridCellEditor_Clone,(self,) + _args, _kwargs) - if val: val = wxGridCellEditorPtr(val) return val def SetSize(self, *_args, **_kwargs): val = apply(gridc.wxGridCellEditor_SetSize,(self,) + _args, _kwargs) @@ -341,6 +353,7 @@ class wxPyGridCellEditor(wxPyGridCellEditorPtr): self.this = apply(gridc.new_wxPyGridCellEditor,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyGridCellEditor) + self._setOORInfo(self) @@ -355,6 +368,7 @@ class wxGridCellTextEditor(wxGridCellTextEditorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellTextEditor,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -369,6 +383,7 @@ class wxGridCellNumberEditor(wxGridCellNumberEditorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellNumberEditor,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -383,6 +398,7 @@ class wxGridCellFloatEditor(wxGridCellFloatEditorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellFloatEditor,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -397,6 +413,7 @@ class wxGridCellBoolEditor(wxGridCellBoolEditorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellBoolEditor,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -411,6 +428,7 @@ class wxGridCellChoiceEditor(wxGridCellChoiceEditorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellChoiceEditor,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -425,6 +443,7 @@ class wxGridCellEnumEditor(wxGridCellEnumEditorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellEnumEditor,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -439,6 +458,7 @@ class wxGridCellAutoWrapStringEditor(wxGridCellAutoWrapStringEditorPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellAutoWrapStringEditor,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -453,9 +473,11 @@ class wxGridCellAttrPtr : def __init__(self,this): self.this = this self.thisown = 0 + def _setOORInfo(self, *_args, **_kwargs): + val = apply(gridc.wxGridCellAttr__setOORInfo,(self,) + _args, _kwargs) + return val def Clone(self, *_args, **_kwargs): val = apply(gridc.wxGridCellAttr_Clone,(self,) + _args, _kwargs) - if val: val = wxGridCellAttrPtr(val) return val def MergeWith(self, *_args, **_kwargs): val = apply(gridc.wxGridCellAttr_MergeWith,(self,) + _args, _kwargs) @@ -528,11 +550,9 @@ class wxGridCellAttrPtr : return val def GetRenderer(self, *_args, **_kwargs): val = apply(gridc.wxGridCellAttr_GetRenderer,(self,) + _args, _kwargs) - if val: val = wxGridCellRendererPtr(val) return val def GetEditor(self, *_args, **_kwargs): val = apply(gridc.wxGridCellAttr_GetEditor,(self,) + _args, _kwargs) - if val: val = wxGridCellEditorPtr(val) return val def IsReadOnly(self, *_args, **_kwargs): val = apply(gridc.wxGridCellAttr_IsReadOnly,(self,) + _args, _kwargs) @@ -546,6 +566,7 @@ class wxGridCellAttr(wxGridCellAttrPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellAttr,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -554,9 +575,11 @@ class wxGridCellAttrProviderPtr : def __init__(self,this): self.this = this self.thisown = 0 + def _setOORInfo(self, *_args, **_kwargs): + val = apply(gridc.wxGridCellAttrProvider__setOORInfo,(self,) + _args, _kwargs) + return val def GetAttr(self, *_args, **_kwargs): val = apply(gridc.wxGridCellAttrProvider_GetAttr,(self,) + _args, _kwargs) - if val: val = wxGridCellAttrPtr(val) return val def SetAttr(self, *_args, **_kwargs): val = apply(gridc.wxGridCellAttrProvider_SetAttr,(self,) + _args, _kwargs) @@ -579,6 +602,7 @@ class wxGridCellAttrProvider(wxGridCellAttrProviderPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridCellAttrProvider,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -592,7 +616,6 @@ class wxPyGridCellAttrProviderPtr(wxGridCellAttrProviderPtr): return val def base_GetAttr(self, *_args, **_kwargs): val = apply(gridc.wxPyGridCellAttrProvider_base_GetAttr,(self,) + _args, _kwargs) - if val: val = wxGridCellAttrPtr(val) return val def base_SetAttr(self, *_args, **_kwargs): val = apply(gridc.wxPyGridCellAttrProvider_base_SetAttr,(self,) + _args, _kwargs) @@ -618,12 +641,14 @@ class wxGridTableBasePtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 + def _setOORInfo(self, *_args, **_kwargs): + val = apply(gridc.wxGridTableBase__setOORInfo,(self,) + _args, _kwargs) + return val def SetAttrProvider(self, *_args, **_kwargs): val = apply(gridc.wxGridTableBase_SetAttrProvider,(self,) + _args, _kwargs) return val def GetAttrProvider(self, *_args, **_kwargs): val = apply(gridc.wxGridTableBase_GetAttrProvider,(self,) + _args, _kwargs) - if val: val = wxGridCellAttrProviderPtr(val) return val def SetView(self, *_args, **_kwargs): val = apply(gridc.wxGridTableBase_SetView,(self,) + _args, _kwargs) @@ -711,7 +736,6 @@ class wxGridTableBasePtr(wxObjectPtr): return val def GetAttr(self, *_args, **_kwargs): val = apply(gridc.wxGridTableBase_GetAttr,(self,) + _args, _kwargs) - if val: val = wxGridCellAttrPtr(val) return val def SetAttr(self, *_args, **_kwargs): val = apply(gridc.wxGridTableBase_SetAttr,(self,) + _args, _kwargs) @@ -788,7 +812,6 @@ class wxPyGridTableBasePtr(wxGridTableBasePtr): return val def base_GetAttr(self, *_args, **_kwargs): val = apply(gridc.wxPyGridTableBase_base_GetAttr,(self,) + _args, _kwargs) - if val: val = wxGridCellAttrPtr(val) return val def base_SetAttr(self, *_args, **_kwargs): val = apply(gridc.wxPyGridTableBase_base_SetAttr,(self,) + _args, _kwargs) @@ -806,6 +829,7 @@ class wxPyGridTableBase(wxPyGridTableBasePtr): self.this = apply(gridc.new_wxPyGridTableBase,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyGridTableBase) + self._setOORInfo(self) @@ -820,6 +844,7 @@ class wxGridStringTable(wxGridStringTablePtr): def __init__(self,*_args,**_kwargs): self.this = apply(gridc.new_wxGridStringTable,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -1320,11 +1345,9 @@ class wxGridPtr(wxScrolledWindowPtr): return val def GetDefaultRenderer(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetDefaultRenderer,(self,) + _args, _kwargs) - if val: val = wxGridCellRendererPtr(val) return val def GetCellRenderer(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetCellRenderer,(self,) + _args, _kwargs) - if val: val = wxGridCellRendererPtr(val) return val def SetDefaultEditor(self, *_args, **_kwargs): val = apply(gridc.wxGrid_SetDefaultEditor,(self,) + _args, _kwargs) @@ -1334,11 +1357,9 @@ class wxGridPtr(wxScrolledWindowPtr): return val def GetDefaultEditor(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetDefaultEditor,(self,) + _args, _kwargs) - if val: val = wxGridCellEditorPtr(val) return val def GetCellEditor(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetCellEditor,(self,) + _args, _kwargs) - if val: val = wxGridCellEditorPtr(val) return val def GetCellValue(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetCellValue,(self,) + _args, _kwargs) @@ -1396,19 +1417,15 @@ class wxGridPtr(wxScrolledWindowPtr): return val def GetDefaultEditorForCell(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetDefaultEditorForCell,(self,) + _args, _kwargs) - if val: val = wxGridCellEditorPtr(val) return val def GetDefaultRendererForCell(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetDefaultRendererForCell,(self,) + _args, _kwargs) - if val: val = wxGridCellRendererPtr(val) return val def GetDefaultEditorForType(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetDefaultEditorForType,(self,) + _args, _kwargs) - if val: val = wxGridCellEditorPtr(val) return val def GetDefaultRendererForType(self, *_args, **_kwargs): val = apply(gridc.wxGrid_GetDefaultRendererForType,(self,) + _args, _kwargs) - if val: val = wxGridCellRendererPtr(val) return val def SetMargins(self, *_args, **_kwargs): val = apply(gridc.wxGrid_SetMargins,(self,) + _args, _kwargs) @@ -1604,6 +1621,8 @@ wxGRID_VALUE_FLOAT = gridc.wxGRID_VALUE_FLOAT wxGRID_VALUE_CHOICE = gridc.wxGRID_VALUE_CHOICE wxGRID_VALUE_TEXT = gridc.wxGRID_VALUE_TEXT wxGRID_VALUE_LONG = gridc.wxGRID_VALUE_LONG +wxGRID_VALUE_CHOICEINT = gridc.wxGRID_VALUE_CHOICEINT +wxGRID_VALUE_DATETIME = gridc.wxGRID_VALUE_DATETIME cvar = gridc.cvar wxGridNoCellCoords = wxGridCellCoordsPtr(gridc.cvar.wxGridNoCellCoords) wxGridNoCellRect = wxRectPtr(gridc.cvar.wxGridNoCellRect) diff --git a/wxPython/src/gtk/htmlhelp.cpp b/wxPython/src/gtk/htmlhelp.cpp index 411e6db186..788c79e27f 100644 --- a/wxPython/src/gtk/htmlhelp.cpp +++ b/wxPython/src/gtk/htmlhelp.cpp @@ -95,14 +95,6 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { #ifdef __cplusplus extern "C" { #endif -static void *SwigwxHtmlBookRecordTowxObject(void *ptr) { - wxHtmlBookRecord *src; - wxObject *dest; - src = (wxHtmlBookRecord *) ptr; - dest = (wxObject *) src; - return (void *) dest; -} - #define new_wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) static PyObject *_wrap_new_wxHtmlBookRecord(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2438,7 +2430,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxHtmlContentsItem","_struct_wxHtmlContentsItem",0}, { "_wxObject","_wxHtmlHelpController",SwigwxHtmlHelpControllerTowxObject}, { "_wxObject","_wxHtmlHelpFrame",SwigwxHtmlHelpFrameTowxObject}, - { "_wxObject","_wxHtmlBookRecord",SwigwxHtmlBookRecordTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, { "_unsigned_char","_byte",0}, diff --git a/wxPython/src/gtk/htmlhelp.py b/wxPython/src/gtk/htmlhelp.py index 881c662aa0..fd3a642bac 100644 --- a/wxPython/src/gtk/htmlhelp.py +++ b/wxPython/src/gtk/htmlhelp.py @@ -42,7 +42,7 @@ from printfw import * from sizers import * from filesys import * -class wxHtmlBookRecordPtr(wxObjectPtr): +class wxHtmlBookRecordPtr : def __init__(self,this): self.this = this self.thisown = 0 diff --git a/wxPython/src/gtk/misc2.cpp b/wxPython/src/gtk/misc2.cpp index a47f87d338..99cf644df8 100644 --- a/wxPython/src/gtk/misc2.cpp +++ b/wxPython/src/gtk/misc2.cpp @@ -137,7 +137,7 @@ IMP_PYCALLBACK_STRING__pure( wxPyTipProvider, wxTipProvider, GetTip); #include -// A Log class that can be derived from in wxPython +// A wxLog class that can be derived from in wxPython class wxPyLog : public wxLog { public: wxPyLog() : wxLog() {} @@ -5332,60 +5332,6 @@ static PyObject *_wrap_wxLogWindow_PassMessages(PyObject *self, PyObject *args, return _resultobj; } -#define new_wxLogNull() (new wxLogNull()) -static PyObject *_wrap_new_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxLogNull * _result; - char *_kwnames[] = { NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxLogNull",_kwnames)) - return NULL; -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxLogNull *)new_wxLogNull(); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxLogNull_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - -#define delete_wxLogNull(_swigobj) (delete _swigobj) -static PyObject *_wrap_delete_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxLogNull * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxLogNull",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogNull_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxLogNull. Expected _wxLogNull_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - delete_wxLogNull(_arg0); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - static void *SwigwxLogChainTowxLog(void *ptr) { wxLogChain *src; wxLog *dest; @@ -5560,6 +5506,60 @@ static PyObject *_wrap_wxLogChain_GetOldLog(PyObject *self, PyObject *args, PyOb return _resultobj; } +#define new_wxLogNull() (new wxLogNull()) +static PyObject *_wrap_new_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxLogNull * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxLogNull",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxLogNull *)new_wxLogNull(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxLogNull_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define delete_wxLogNull(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxLogNull(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxLogNull * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxLogNull",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxLogNull_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxLogNull. Expected _wxLogNull_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_wxLogNull(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxPyLogTowxLog(void *ptr) { wxPyLog *src; wxLog *dest; @@ -9903,13 +9903,13 @@ static PyMethodDef misc2cMethods[] = { { "wxPyLog_Destroy", (PyCFunction) _wrap_wxPyLog_Destroy, METH_VARARGS | METH_KEYWORDS }, { "wxPyLog__setCallbackInfo", (PyCFunction) _wrap_wxPyLog__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxPyLog", (PyCFunction) _wrap_new_wxPyLog, METH_VARARGS | METH_KEYWORDS }, + { "delete_wxLogNull", (PyCFunction) _wrap_delete_wxLogNull, METH_VARARGS | METH_KEYWORDS }, + { "new_wxLogNull", (PyCFunction) _wrap_new_wxLogNull, METH_VARARGS | METH_KEYWORDS }, { "wxLogChain_GetOldLog", (PyCFunction) _wrap_wxLogChain_GetOldLog, METH_VARARGS | METH_KEYWORDS }, { "wxLogChain_IsPassingMessages", (PyCFunction) _wrap_wxLogChain_IsPassingMessages, METH_VARARGS | METH_KEYWORDS }, { "wxLogChain_PassMessages", (PyCFunction) _wrap_wxLogChain_PassMessages, METH_VARARGS | METH_KEYWORDS }, { "wxLogChain_SetLog", (PyCFunction) _wrap_wxLogChain_SetLog, METH_VARARGS | METH_KEYWORDS }, { "new_wxLogChain", (PyCFunction) _wrap_new_wxLogChain, METH_VARARGS | METH_KEYWORDS }, - { "delete_wxLogNull", (PyCFunction) _wrap_delete_wxLogNull, METH_VARARGS | METH_KEYWORDS }, - { "new_wxLogNull", (PyCFunction) _wrap_new_wxLogNull, METH_VARARGS | METH_KEYWORDS }, { "wxLogWindow_PassMessages", (PyCFunction) _wrap_wxLogWindow_PassMessages, METH_VARARGS | METH_KEYWORDS }, { "wxLogWindow_IsPassingMessages", (PyCFunction) _wrap_wxLogWindow_IsPassingMessages, METH_VARARGS | METH_KEYWORDS }, { "wxLogWindow_GetOldLog", (PyCFunction) _wrap_wxLogWindow_GetOldLog, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/misc2.py b/wxPython/src/gtk/misc2.py index ed4dcf89ef..bffc12d8f4 100644 --- a/wxPython/src/gtk/misc2.py +++ b/wxPython/src/gtk/misc2.py @@ -424,23 +424,6 @@ class wxLogWindow(wxLogWindowPtr): -class wxLogNullPtr : - def __init__(self,this): - self.this = this - self.thisown = 0 - def __del__(self,misc2c=misc2c): - if self.thisown == 1 : - misc2c.delete_wxLogNull(self) - def __repr__(self): - return "" % (self.this,) -class wxLogNull(wxLogNullPtr): - def __init__(self,*_args,**_kwargs): - self.this = apply(misc2c.new_wxLogNull,_args,_kwargs) - self.thisown = 1 - - - - class wxLogChainPtr(wxLogPtr): def __init__(self,this): self.this = this @@ -468,6 +451,23 @@ class wxLogChain(wxLogChainPtr): +class wxLogNullPtr : + def __init__(self,this): + self.this = this + self.thisown = 0 + def __del__(self,misc2c=misc2c): + if self.thisown == 1 : + misc2c.delete_wxLogNull(self) + def __repr__(self): + return "" % (self.this,) +class wxLogNull(wxLogNullPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(misc2c.new_wxLogNull,_args,_kwargs) + self.thisown = 1 + + + + class wxPyLogPtr(wxLogPtr): def __init__(self,this): self.this = this diff --git a/wxPython/src/gtk/sizers.py b/wxPython/src/gtk/sizers.py index 2d780afceb..5ec6b397d9 100644 --- a/wxPython/src/gtk/sizers.py +++ b/wxPython/src/gtk/sizers.py @@ -245,6 +245,14 @@ class wxSizerPtr(wxObjectPtr): else: apply(self.SetItemMinSizeWindow, args) + + def GetSizeTuple(self): + return self.GetSize().asTuple() + def GetPositionTuple(self): + return self.GetPosition().asTuple() + def GetMinSizeTuple(self): + return self.GetMinSize().asTuple() + class wxSizer(wxSizerPtr): def __init__(self,this): self.this = this diff --git a/wxPython/src/gtk/wx.cpp b/wxPython/src/gtk/wx.cpp index 71cdb1cc04..51a9199a2f 100644 --- a/wxPython/src/gtk/wx.cpp +++ b/wxPython/src/gtk/wx.cpp @@ -595,7 +595,8 @@ PyObject *ptrfree(PyObject *_PTRVALUE) { wxPyApp* wxGetApp() { - return wxPythonApp; + //return wxPythonApp; + return (wxPyApp*)wxGetApp(); } void wxApp_CleanUp() { -- 2.45.2