From 2f4e928794167715f19a3021d62b7c4f77611694 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 27 Nov 2001 02:56:59 +0000 Subject: [PATCH] Changes needed to solve wxPython's OOR problem for the wxOGL shapes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/ogl/_ogldefs.i | 7 +- wxPython/contrib/ogl/ogl.cpp | 27 +++++- wxPython/contrib/ogl/ogl.i | 27 +++++- wxPython/contrib/ogl/oglbasic.cpp | 139 +++++++++++++++++++++------- wxPython/contrib/ogl/oglbasic.i | 14 ++- wxPython/contrib/ogl/oglbasic.py | 15 ++- wxPython/contrib/ogl/oglcanvas.cpp | 6 +- wxPython/contrib/ogl/oglhelpers.h | 3 +- wxPython/contrib/ogl/oglshapes.cpp | 10 +- wxPython/contrib/ogl/oglshapes.i | 7 ++ wxPython/contrib/ogl/oglshapes.py | 7 ++ wxPython/contrib/ogl/oglshapes2.cpp | 4 +- wxPython/contrib/ogl/oglshapes2.i | 5 + wxPython/contrib/ogl/oglshapes2.py | 5 + wxPython/demo/wxOGL.py | 8 +- wxPython/setup.py | 4 +- wxPython/src/_defs.i | 13 ++- wxPython/src/controls.i | 14 +++ wxPython/src/export.h | 4 +- wxPython/src/gdi.i | 6 ++ wxPython/src/helpers.cpp | 41 +++++--- wxPython/src/helpers.h | 6 +- wxPython/src/msw/controls.cpp | 86 +++++++++++++++++ wxPython/src/msw/controls.py | 8 ++ wxPython/src/msw/frames.cpp | 4 +- wxPython/src/msw/gdi.cpp | 87 +++++++++++++++++ wxPython/src/msw/gdi.py | 9 ++ wxPython/src/msw/sizers.cpp | 2 +- wxPython/src/msw/windows.cpp | 2 +- wxPython/src/msw/wx.cpp | 14 ++- wxPython/src/msw/wx.py | 13 ++- wxPython/src/my_typemaps.i | 3 +- wxPython/src/wx.i | 1 + 33 files changed, 504 insertions(+), 97 deletions(-) diff --git a/wxPython/contrib/ogl/_ogldefs.i b/wxPython/contrib/ogl/_ogldefs.i index 1241092a2e..0660991cd3 100644 --- a/wxPython/contrib/ogl/_ogldefs.i +++ b/wxPython/contrib/ogl/_ogldefs.i @@ -58,12 +58,13 @@ class wxPyControlPoint; // OOR Support -%typemap(python, out) wxPyShape* { $target = wxPyMake_wxObject($source); } -%typemap(python, out) wxPyShapeEvtHandler* { $target = wxPyMake_wxObject($source); } +%typemap(python, out) wxPyShape* { $target = wxPyMake_wxShapeEvtHandler($source); } +%typemap(python, out) wxPyShapeEvtHandler* { $target = wxPyMake_wxShapeEvtHandler($source); } +%typemap(python, out) wxPyDivisionShape* { $target = wxPyMake_wxShapeEvtHandler($source); } + %typemap(python, out) wxPyShapeCanvas* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxDiagram* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxOGLConstraint* { $target = wxPyMake_wxObject($source); } -%typemap(python, out) wxPyDivisionShape* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxPseudoMetaFile* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxArrowHead* { $target = wxPyMake_wxObject($source); } diff --git a/wxPython/contrib/ogl/ogl.cpp b/wxPython/contrib/ogl/ogl.cpp index cb08d0efd0..6b22bfbe16 100644 --- a/wxPython/contrib/ogl/ogl.cpp +++ b/wxPython/contrib/ogl/ogl.cpp @@ -117,7 +117,7 @@ wxList* wxPy_wxListHelper(PyObject* pyList, char* className) { char errmsg[1024]; sprintf(errmsg, "Type error, expected list of %s objects", className); PyErr_SetString(PyExc_TypeError, errmsg); - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(state); return NULL; } list->Append(wxo); @@ -168,6 +168,31 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) { return list; } +//--------------------------------------------------------------------------- + +PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) { + PyObject* target = NULL; + + if (source && wxIsKindOf(source, wxShapeEvtHandler)) { + // If it's derived from wxShapeEvtHandler then there may + // already be a pointer to a Python object that we can use + // in the OOR data. + wxShapeEvtHandler* seh = (wxShapeEvtHandler*)source; + wxPyClientData* data = (wxPyClientData*)seh->GetClientObject(); + if (data) { + target = data->m_obj; + Py_INCREF(target); + } + } + if (! target) { + target = wxPyMake_wxObject2(source, FALSE); + if (target != Py_None) + ((wxShapeEvtHandler*)source)->SetClientObject(new wxPyClientData(target)); + } + return target; +} + + //--------------------------------------------------------------------------- diff --git a/wxPython/contrib/ogl/ogl.i b/wxPython/contrib/ogl/ogl.i index 41f78d72fc..6bc29d196f 100644 --- a/wxPython/contrib/ogl/ogl.i +++ b/wxPython/contrib/ogl/ogl.i @@ -160,7 +160,7 @@ wxList* wxPy_wxListHelper(PyObject* pyList, char* className) { char errmsg[1024]; sprintf(errmsg, "Type error, expected list of %s objects", className); PyErr_SetString(PyExc_TypeError, errmsg); - wxPyEndBlockThreads(state); + wxPyEndBlockThreads(state); return NULL; } list->Append(wxo); @@ -211,6 +211,31 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) { return list; } +//--------------------------------------------------------------------------- + +PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) { + PyObject* target = NULL; + + if (source && wxIsKindOf(source, wxShapeEvtHandler)) { + // If it's derived from wxShapeEvtHandler then there may + // already be a pointer to a Python object that we can use + // in the OOR data. + wxShapeEvtHandler* seh = (wxShapeEvtHandler*)source; + wxPyClientData* data = (wxPyClientData*)seh->GetClientObject(); + if (data) { + target = data->m_obj; + Py_INCREF(target); + } + } + if (! target) { + target = wxPyMake_wxObject2(source, FALSE); + if (target != Py_None) + ((wxShapeEvtHandler*)source)->SetClientObject(new wxPyClientData(target)); + } + return target; +} + + //--------------------------------------------------------------------------- diff --git a/wxPython/contrib/ogl/oglbasic.cpp b/wxPython/contrib/ogl/oglbasic.cpp index 9d4ab21462..24965a42ae 100644 --- a/wxPython/contrib/ogl/oglbasic.cpp +++ b/wxPython/contrib/ogl/oglbasic.cpp @@ -1258,6 +1258,40 @@ static PyObject *_wrap_wxPyShapeEvtHandler_Destroy(PyObject *self, PyObject *arg return _resultobj; } +static void wxPyShapeEvtHandler__setOORInfo(wxPyShapeEvtHandler *self,PyObject * _self) { + self->SetClientObject(new wxPyClientData(_self)); + } +static PyObject *_wrap_wxPyShapeEvtHandler__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyShapeEvtHandler * _arg0; + PyObject * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","_self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyShapeEvtHandler__setOORInfo",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyShapeEvtHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyShapeEvtHandler__setOORInfo. Expected _wxPyShapeEvtHandler_p."); + return NULL; + } + } +{ + _arg1 = _obj1; +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxPyShapeEvtHandler__setOORInfo(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxPyShapeEvtHandler_SetShape(_swigobj,_swigarg0) (_swigobj->SetShape(_swigarg0)) static PyObject *_wrap_wxPyShapeEvtHandler_SetShape(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1317,7 +1351,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_GetShape(PyObject *self, PyObject *ar _result = (wxPyShape *)wxPyShapeEvtHandler_GetShape(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -1380,7 +1414,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_GetPreviousHandler(PyObject *self, Py _result = (wxPyShapeEvtHandler *)wxPyShapeEvtHandler_GetPreviousHandler(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -1407,7 +1441,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_CreateNewCopy(PyObject *self, PyObjec _result = (wxPyShapeEvtHandler *)wxPyShapeEvtHandler_CreateNewCopy(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -2478,33 +2512,6 @@ static PyObject *_wrap_wxPyShape__setCallbackInfo(PyObject *self, PyObject *args return _resultobj; } -static void wxPyShape_Destroy(wxPyShape *self) { delete self; } -static PyObject *_wrap_wxPyShape_Destroy(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxPyShape * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPyShape_Destroy",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyShape_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyShape_Destroy. Expected _wxPyShape_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - wxPyShape_Destroy(_arg0); - - wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - #define wxPyShape_GetBoundingBoxMax(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetBoundingBoxMax(_swigarg0,_swigarg1)) static PyObject *_wrap_wxPyShape_GetBoundingBoxMax(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2963,7 +2970,7 @@ static PyObject *_wrap_wxPyShape_GetParent(PyObject *self, PyObject *args, PyObj _result = (wxPyShape *)wxPyShape_GetParent(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -3026,7 +3033,7 @@ static PyObject *_wrap_wxPyShape_GetTopAncestor(PyObject *self, PyObject *args, _result = (wxPyShape *)wxPyShape_GetTopAncestor(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -3259,7 +3266,7 @@ static PyObject *_wrap_wxPyShape_GetEventHandler(PyObject *self, PyObject *args, _result = (wxPyShapeEvtHandler *)wxPyShape_GetEventHandler(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -5783,7 +5790,7 @@ static PyObject *_wrap_wxPyShape_FindRegion(PyObject *self, PyObject *args, PyOb _result = (wxPyShape *)wxPyShape_FindRegion(_arg0,*_arg1,_arg2); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } { PyObject *o; o = PyInt_FromLong((long) (*_arg2)); @@ -6863,7 +6870,7 @@ static PyObject *_wrap_wxPyShape_CreateNewCopy(PyObject *self, PyObject *args, P _result = (wxPyShape *)wxPyShape_CreateNewCopy(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -7095,6 +7102,64 @@ static PyObject *_wrap_wxPyShape_ClearPointList(PyObject *self, PyObject *args, return _resultobj; } +#define wxPyShape_GetBackgroundPen(_swigobj) (_swigobj->GetBackgroundPen()) +static PyObject *_wrap_wxPyShape_GetBackgroundPen(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPen * _result; + wxPyShape * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPyShape_GetBackgroundPen",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyShape_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyShape_GetBackgroundPen. Expected _wxPyShape_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxPen (wxPyShape_GetBackgroundPen(_arg0)); + + wxPy_END_ALLOW_THREADS; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPen_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +#define wxPyShape_GetBackgroundBrush(_swigobj) (_swigobj->GetBackgroundBrush()) +static PyObject *_wrap_wxPyShape_GetBackgroundBrush(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBrush * _result; + wxPyShape * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPyShape_GetBackgroundBrush",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyShape_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyShape_GetBackgroundBrush. Expected _wxPyShape_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxBrush (wxPyShape_GetBackgroundBrush(_arg0)); + + wxPy_END_ALLOW_THREADS; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBrush_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + #define wxPyShape_base_OnDelete(_swigobj) (_swigobj->base_OnDelete()) static PyObject *_wrap_wxPyShape_base_OnDelete(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -8139,6 +8204,8 @@ static PyMethodDef oglbasiccMethods[] = { { "wxPyShape_base_OnDrawContents", (PyCFunction) _wrap_wxPyShape_base_OnDrawContents, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_base_OnDraw", (PyCFunction) _wrap_wxPyShape_base_OnDraw, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_base_OnDelete", (PyCFunction) _wrap_wxPyShape_base_OnDelete, METH_VARARGS | METH_KEYWORDS }, + { "wxPyShape_GetBackgroundBrush", (PyCFunction) _wrap_wxPyShape_GetBackgroundBrush, METH_VARARGS | METH_KEYWORDS }, + { "wxPyShape_GetBackgroundPen", (PyCFunction) _wrap_wxPyShape_GetBackgroundPen, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_ClearPointList", (PyCFunction) _wrap_wxPyShape_ClearPointList, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_Recentre", (PyCFunction) _wrap_wxPyShape_Recentre, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_ClearAttachments", (PyCFunction) _wrap_wxPyShape_ClearAttachments, METH_VARARGS | METH_KEYWORDS }, @@ -8273,7 +8340,6 @@ static PyMethodDef oglbasiccMethods[] = { { "wxPyShape_GetPerimeterPoint", (PyCFunction) _wrap_wxPyShape_GetPerimeterPoint, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_GetBoundingBoxMin", (PyCFunction) _wrap_wxPyShape_GetBoundingBoxMin, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_GetBoundingBoxMax", (PyCFunction) _wrap_wxPyShape_GetBoundingBoxMax, METH_VARARGS | METH_KEYWORDS }, - { "wxPyShape_Destroy", (PyCFunction) _wrap_wxPyShape_Destroy, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape__setCallbackInfo", (PyCFunction) _wrap_wxPyShape__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, { "wxPyShapeEvtHandler_base_OnEndSize", (PyCFunction) _wrap_wxPyShapeEvtHandler_base_OnEndSize, METH_VARARGS | METH_KEYWORDS }, { "wxPyShapeEvtHandler_base_OnBeginSize", (PyCFunction) _wrap_wxPyShapeEvtHandler_base_OnBeginSize, METH_VARARGS | METH_KEYWORDS }, @@ -8309,6 +8375,7 @@ static PyMethodDef oglbasiccMethods[] = { { "wxPyShapeEvtHandler_SetPreviousHandler", (PyCFunction) _wrap_wxPyShapeEvtHandler_SetPreviousHandler, METH_VARARGS | METH_KEYWORDS }, { "wxPyShapeEvtHandler_GetShape", (PyCFunction) _wrap_wxPyShapeEvtHandler_GetShape, METH_VARARGS | METH_KEYWORDS }, { "wxPyShapeEvtHandler_SetShape", (PyCFunction) _wrap_wxPyShapeEvtHandler_SetShape, METH_VARARGS | METH_KEYWORDS }, + { "wxPyShapeEvtHandler__setOORInfo", (PyCFunction) _wrap_wxPyShapeEvtHandler__setOORInfo, METH_VARARGS | METH_KEYWORDS }, { "wxPyShapeEvtHandler_Destroy", (PyCFunction) _wrap_wxPyShapeEvtHandler_Destroy, METH_VARARGS | METH_KEYWORDS }, { "wxPyShapeEvtHandler__setCallbackInfo", (PyCFunction) _wrap_wxPyShapeEvtHandler__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxPyShapeEvtHandler", (PyCFunction) _wrap_new_wxPyShapeEvtHandler, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/contrib/ogl/oglbasic.i b/wxPython/contrib/ogl/oglbasic.i index 6d66e15caa..7e982eeb31 100644 --- a/wxPython/contrib/ogl/oglbasic.i +++ b/wxPython/contrib/ogl/oglbasic.i @@ -94,8 +94,15 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShapeEvtHandler)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %addmethods { void Destroy() { delete self; } } + %addmethods { + void _setOORInfo(PyObject* _self) { + self->SetClientObject(new wxPyClientData(_self)); + } + } + void SetShape(wxPyShape *sh); wxPyShape *GetShape(); @@ -147,10 +154,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyShape)" - - %addmethods { - void Destroy() { delete self; } - } + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT); void GetBoundingBoxMin(double *OUTPUT, double *OUTPUT); @@ -364,6 +368,8 @@ public: void ClearAttachments(); void Recentre(wxDC& dc); void ClearPointList(wxList& list); + wxPen GetBackgroundPen(); + wxBrush GetBackgroundBrush(); void base_OnDelete(); void base_OnDraw(wxDC& dc); diff --git a/wxPython/contrib/ogl/oglbasic.py b/wxPython/contrib/ogl/oglbasic.py index 9a6e352b25..7e23386ead 100644 --- a/wxPython/contrib/ogl/oglbasic.py +++ b/wxPython/contrib/ogl/oglbasic.py @@ -153,6 +153,9 @@ class wxPyShapeEvtHandlerPtr(wxObjectPtr): def Destroy(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShapeEvtHandler_Destroy,(self,) + _args, _kwargs) return val + def _setOORInfo(self, *_args, **_kwargs): + val = apply(oglbasicc.wxPyShapeEvtHandler__setOORInfo,(self,) + _args, _kwargs) + return val def SetShape(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShapeEvtHandler_SetShape,(self,) + _args, _kwargs) return val @@ -262,6 +265,7 @@ class wxPyShapeEvtHandler(wxPyShapeEvtHandlerPtr): self.this = apply(oglbasicc.new_wxPyShapeEvtHandler,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyShapeEvtHandler) + self._setOORInfo(self) @@ -273,9 +277,6 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr): def _setCallbackInfo(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShape__setCallbackInfo,(self,) + _args, _kwargs) return val - def Destroy(self, *_args, **_kwargs): - val = apply(oglbasicc.wxPyShape_Destroy,(self,) + _args, _kwargs) - return val def GetBoundingBoxMax(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShape_GetBoundingBoxMax,(self,) + _args, _kwargs) return val @@ -683,6 +684,14 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr): def ClearPointList(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShape_ClearPointList,(self,) + _args, _kwargs) return val + def GetBackgroundPen(self, *_args, **_kwargs): + val = apply(oglbasicc.wxPyShape_GetBackgroundPen,(self,) + _args, _kwargs) + if val: val = wxPenPtr(val) ; val.thisown = 1 + return val + def GetBackgroundBrush(self, *_args, **_kwargs): + val = apply(oglbasicc.wxPyShape_GetBackgroundBrush,(self,) + _args, _kwargs) + if val: val = wxBrushPtr(val) ; val.thisown = 1 + return val def base_OnDelete(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShape_base_OnDelete,(self,) + _args, _kwargs) return val diff --git a/wxPython/contrib/ogl/oglcanvas.cpp b/wxPython/contrib/ogl/oglcanvas.cpp index 8f4fc95943..a9821d727f 100644 --- a/wxPython/contrib/ogl/oglcanvas.cpp +++ b/wxPython/contrib/ogl/oglcanvas.cpp @@ -307,7 +307,7 @@ static PyObject *_wrap_wxDiagram_FindShape(PyObject *self, PyObject *args, PyObj _result = (wxPyShape *)wxDiagram_FindShape(_arg0,_arg1); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -1343,7 +1343,7 @@ static PyObject *_wrap_wxPyShapeCanvas_FindShape(PyObject *self, PyObject *args, _result = (wxPyShape *)wxPyShapeCanvas_FindShape(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } { PyObject *o; o = PyInt_FromLong((long) (*_arg3)); @@ -1383,7 +1383,7 @@ static PyObject *_wrap_wxPyShapeCanvas_FindFirstSensitiveShape(PyObject *self, P _result = (wxPyShape *)wxPyShapeCanvas_FindFirstSensitiveShape(_arg0,_arg1,_arg2,_arg3,_arg4); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } { PyObject *o; o = PyInt_FromLong((long) (*_arg3)); diff --git a/wxPython/contrib/ogl/oglhelpers.h b/wxPython/contrib/ogl/oglhelpers.h index 532e7d68e4..ef4be52d3d 100644 --- a/wxPython/contrib/ogl/oglhelpers.h +++ b/wxPython/contrib/ogl/oglhelpers.h @@ -96,10 +96,11 @@ //--------------------------------------------------------------------------- -// These are prototypes of some helper functions found in oglhelpers.cpp +// These are prototypes of some helper functions found in ogl.i wxList* wxPy_wxListHelper(PyObject* pyList, char* className); wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList); +PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source); diff --git a/wxPython/contrib/ogl/oglshapes.cpp b/wxPython/contrib/ogl/oglshapes.cpp index 6cc14359f0..811e844ac3 100644 --- a/wxPython/contrib/ogl/oglshapes.cpp +++ b/wxPython/contrib/ogl/oglshapes.cpp @@ -7933,7 +7933,7 @@ static PyObject *_wrap_wxPyCompositeShape_FindContainerImage(PyObject *self, PyO _result = (wxPyShape *)wxPyCompositeShape_FindContainerImage(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -10574,7 +10574,7 @@ static PyObject *_wrap_wxPyDivisionShape_GetBottomSide(PyObject *self, PyObject _result = (wxPyDivisionShape *)wxPyDivisionShape_GetBottomSide(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -10628,7 +10628,7 @@ static PyObject *_wrap_wxPyDivisionShape_GetLeftSide(PyObject *self, PyObject *a _result = (wxPyDivisionShape *)wxPyDivisionShape_GetLeftSide(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -10721,7 +10721,7 @@ static PyObject *_wrap_wxPyDivisionShape_GetRightSide(PyObject *self, PyObject * _result = (wxPyDivisionShape *)wxPyDivisionShape_GetRightSide(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -10748,7 +10748,7 @@ static PyObject *_wrap_wxPyDivisionShape_GetTopSide(PyObject *self, PyObject *ar _result = (wxPyDivisionShape *)wxPyDivisionShape_GetTopSide(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } diff --git a/wxPython/contrib/ogl/oglshapes.i b/wxPython/contrib/ogl/oglshapes.i index d29501a055..6f1ebc26b4 100644 --- a/wxPython/contrib/ogl/oglshapes.i +++ b/wxPython/contrib/ogl/oglshapes.i @@ -110,6 +110,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyRectangleShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void SetCornerRadius(double radius); @@ -160,6 +161,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyControlPoint)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void SetCornerRadius(double radius); @@ -207,6 +209,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyBitmapShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" wxBitmap& GetBitmap(); wxString GetFilename(); @@ -256,6 +259,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDrawnShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void CalculateSize(); void DestroyClippingRect(); @@ -360,6 +364,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyCompositeShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void AddChild(wxPyShape *child, wxPyShape *addAfter = NULL); @@ -458,6 +463,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDividedShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void EditRegions(); void SetRegionSizes(); @@ -507,6 +513,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyDivisionShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void AdjustBottom(double bottom, bool test); void AdjustLeft(double left, bool test); diff --git a/wxPython/contrib/ogl/oglshapes.py b/wxPython/contrib/ogl/oglshapes.py index bce43eeda9..8732f72cad 100644 --- a/wxPython/contrib/ogl/oglshapes.py +++ b/wxPython/contrib/ogl/oglshapes.py @@ -289,6 +289,7 @@ class wxPyRectangleShape(wxPyRectangleShapePtr): self.this = apply(oglshapesc.new_wxPyRectangleShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyRectangleShape) + self._setOORInfo(self) @@ -397,6 +398,7 @@ class wxPyControlPoint(wxPyControlPointPtr): self.this = apply(oglshapesc.new_wxPyControlPoint,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyControlPoint) + self._setOORInfo(self) @@ -515,6 +517,7 @@ class wxPyBitmapShape(wxPyBitmapShapePtr): self.this = apply(oglshapesc.new_wxPyBitmapShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyBitmapShape) + self._setOORInfo(self) @@ -704,6 +707,7 @@ class wxPyDrawnShape(wxPyDrawnShapePtr): self.this = apply(oglshapesc.new_wxPyDrawnShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyDrawnShape) + self._setOORInfo(self) @@ -874,6 +878,7 @@ class wxPyCompositeShape(wxPyCompositeShapePtr): self.this = apply(oglshapesc.new_wxPyCompositeShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyCompositeShape) + self._setOORInfo(self) @@ -985,6 +990,7 @@ class wxPyDividedShape(wxPyDividedShapePtr): self.this = apply(oglshapesc.new_wxPyDividedShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyDividedShape) + self._setOORInfo(self) @@ -1167,6 +1173,7 @@ class wxPyDivisionShape(wxPyDivisionShapePtr): self.this = apply(oglshapesc.new_wxPyDivisionShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyDivisionShape) + self._setOORInfo(self) diff --git a/wxPython/contrib/ogl/oglshapes2.cpp b/wxPython/contrib/ogl/oglshapes2.cpp index 72c0f23315..72fcdbb747 100644 --- a/wxPython/contrib/ogl/oglshapes2.cpp +++ b/wxPython/contrib/ogl/oglshapes2.cpp @@ -3722,7 +3722,7 @@ static PyObject *_wrap_wxPyLineShape_GetFrom(PyObject *self, PyObject *args, PyO _result = (wxPyShape *)wxPyLineShape_GetFrom(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } @@ -3840,7 +3840,7 @@ static PyObject *_wrap_wxPyLineShape_GetTo(PyObject *self, PyObject *args, PyObj _result = (wxPyShape *)wxPyLineShape_GetTo(_arg0); wxPy_END_ALLOW_THREADS; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxShapeEvtHandler(_result); } return _resultobj; } diff --git a/wxPython/contrib/ogl/oglshapes2.i b/wxPython/contrib/ogl/oglshapes2.i index e47480420c..89d4ee8f06 100644 --- a/wxPython/contrib/ogl/oglshapes2.i +++ b/wxPython/contrib/ogl/oglshapes2.i @@ -49,6 +49,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyEllipseShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void base_OnDraw(wxDC& dc); void base_OnDrawContents(wxDC& dc); @@ -92,6 +93,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyCircleShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void base_OnDraw(wxDC& dc); void base_OnDrawContents(wxDC& dc); @@ -164,6 +166,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyLineShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void AddArrow(int type, int end = ARROW_POSITION_END, double arrowSize = 10.0, double xOffset = 0.0, @@ -269,6 +272,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyPolygonShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" // void Create(wxList* points); @@ -340,6 +344,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyTextShape)" + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void base_OnDelete(); diff --git a/wxPython/contrib/ogl/oglshapes2.py b/wxPython/contrib/ogl/oglshapes2.py index 2c60be0fc3..a3c053c580 100644 --- a/wxPython/contrib/ogl/oglshapes2.py +++ b/wxPython/contrib/ogl/oglshapes2.py @@ -143,6 +143,7 @@ class wxPyEllipseShape(wxPyEllipseShapePtr): self.this = apply(oglshapes2c.new_wxPyEllipseShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyEllipseShape) + self._setOORInfo(self) @@ -245,6 +246,7 @@ class wxPyCircleShape(wxPyCircleShapePtr): self.this = apply(oglshapes2c.new_wxPyCircleShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyCircleShape) + self._setOORInfo(self) @@ -533,6 +535,7 @@ class wxPyLineShape(wxPyLineShapePtr): self.this = apply(oglshapes2c.new_wxPyLineShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyLineShape) + self._setOORInfo(self) @@ -653,6 +656,7 @@ class wxPyPolygonShape(wxPyPolygonShapePtr): self.this = apply(oglshapes2c.new_wxPyPolygonShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyPolygonShape) + self._setOORInfo(self) @@ -758,6 +762,7 @@ class wxPyTextShape(wxPyTextShapePtr): self.this = apply(oglshapes2c.new_wxPyTextShape,_args,_kwargs) self.thisown = 1 self._setCallbackInfo(self, wxPyTextShape) + self._setOORInfo(self) diff --git a/wxPython/demo/wxOGL.py b/wxPython/demo/wxOGL.py index c9e5f69917..32b0676cfa 100644 --- a/wxPython/demo/wxOGL.py +++ b/wxPython/demo/wxOGL.py @@ -60,6 +60,7 @@ class MyEvtHandler(wxShapeEvtHandler): def OnLeftClick(self, x, y, keys = 0, attachment = 0): shape = self.GetShape() + print shape.__class__ canvas = shape.GetCanvas() dc = wxClientDC(canvas) canvas.PrepareDC(dc) @@ -122,7 +123,7 @@ class TestWindow(wxShapeCanvas): self.log = log self.frame = frame - self.SetBackgroundColour(wxWHITE) + self.SetBackgroundColour("LIGHT BLUE") #wxWHITE) self.diagram = wxDiagram() self.SetDiagram(self.diagram) self.diagram.SetCanvas(self) @@ -165,6 +166,11 @@ class TestWindow(wxShapeCanvas): # for some reason, the shapes have to be moved for the line to show up... fromShape.Move(dc, fromShape.GetX(), fromShape.GetY()) +## EVT_PAINT(self, self.OnPaint) + +## def OnPaint(self, evt): +## evt.Skip() +## print "TheLists:", wxThePenList.GetCount(), wxTheBrushList.GetCount(), wxTheFontList.GetCount() def MyAddShape(self, shape, x, y, pen, brush, text): diff --git a/wxPython/setup.py b/wxPython/setup.py index 4a9e0fa8d2..43f84a5c10 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -773,8 +773,8 @@ if not GL_ONLY and BUILD_GIZMOS: ext = Extension('gizmosc', [ '%s/dynamicsash.cpp' % GIZMOLOC, - #'%s/editlbox.cpp' % GIZMOLOC, - #'%s/multicell.cpp' % GIZMOLOC, + '%s/editlbox.cpp' % GIZMOLOC, + '%s/multicell.cpp' % GIZMOLOC, '%s/splittree.cpp' % GIZMOLOC, ] + swig_sources, diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index e56b629216..41f9c3e94d 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -264,16 +264,19 @@ enum { wxPROCESS_ENTER, wxPASSWORD, - wxTE_PROCESS_ENTER, - wxTE_PROCESS_TAB, - wxTE_PASSWORD, wxTE_READONLY, - wxTE_RICH, wxTE_MULTILINE, - wxTE_AUTO_SCROLL, + wxTE_PROCESS_TAB, + wxTE_RICH, wxTE_NO_VSCROLL, + wxTE_AUTO_SCROLL, + wxTE_PROCESS_ENTER, + wxTE_PASSWORD, wxTE_AUTO_URL, wxTE_NOHIDESEL, + wxTE_DONTWRAP, + wxTE_LINEWRAP, + wxTE_WORDWRAP, wxCB_SIMPLE, wxCB_DROPDOWN, diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index e5824e6db8..5b17e97859 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -622,6 +622,13 @@ public: // returns false if we have any attributes set, true otherwise bool IsDefault(); + + // return the attribute having the valid font and colours: it uses the + // attributes set in attr and falls back first to attrDefault and then to + // the text control font/colours for those attributes which are not set + static wxTextAttr Combine(const wxTextAttr& attr, + const wxTextAttr& attrDef, + const wxTextCtrl *text); }; @@ -727,6 +734,13 @@ public: self->AppendText(text); } } + + // TODO: replace this when the method is really added to wxTextCtrl + %addmethods { + wxString GetString(long from, long to) { + return self->GetValue().Mid(from, to-from); + } + } }; //---------------------------------------------------------------------- diff --git a/wxPython/src/export.h b/wxPython/src/export.h index f1219c075f..a1b172ebba 100644 --- a/wxPython/src/export.h +++ b/wxPython/src/export.h @@ -60,7 +60,9 @@ static void wxPyCoreAPI_IMPORT() { #define wxPyCBH_delete(a) (wxPyCoreAPIPtr->p_wxPyCBH_delete(a)) #define wxPyClassExists(a) (wxPyCoreAPIPtr->p_wxPyClassExists(a)) -#define wxPyMake_wxObject(a) (wxPyCoreAPIPtr->p_wxPyMake_wxObject(a)) +#define wxPyMake_wxObject(a) (wxPyCoreAPIPtr->p_wxPyMake_wxObject(a,TRUE)) +#define wxPyMake_wxObject2(a,b) (wxPyCoreAPIPtr->p_wxPyMake_wxObject(a,b)) +#define wxPyMake_wxSizer(a) (wxPyCoreAPIPtr->p_wxPyMake_wxSizer(a)) #define wxPyPtrTypeMap_Add(a, b) (wxPyCoreAPIPtr->p_wxPyPtrTypeMap_Add(a, b)) diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index e7c4ff6190..5d0cdaf57e 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -543,6 +543,8 @@ public: bool underline = FALSE, const char* facename = NULL, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); void RemoveFont(wxFont *font); + + int GetCount(); }; @@ -677,6 +679,8 @@ public: void AddPen(wxPen* pen); wxPen* FindOrCreatePen(const wxColour& colour, int width, int style); void RemovePen(wxPen* pen); + + int GetCount(); }; @@ -704,6 +708,8 @@ public: void AddBrush(wxBrush *brush); wxBrush * FindOrCreateBrush(const wxColour& colour, int style); void RemoveBrush(wxBrush *brush); + + int GetCount(); }; //---------------------------------------------------------------------- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 9c4cb6ecda..28f0621eed 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -287,14 +287,16 @@ PyObject* wxPyClassExists(const char* className) { } -PyObject* wxPyMake_wxObject(wxObject* source) { +PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler) { PyObject* target = NULL; bool isEvtHandler = FALSE; if (source) { // If it's derived from wxEvtHandler then there may - // already be a pointer to a Python objec that we can use. - if (wxIsKindOf(source, wxEvtHandler)) { + // already be a pointer to a Python object that we can use + // in the OOR data. + if (checkEvtHandler && wxIsKindOf(source, wxEvtHandler)) { + isEvtHandler = TRUE; wxEvtHandler* eh = (wxEvtHandler*)source; wxPyClientData* data = (wxPyClientData*)eh->GetClientObject(); if (data) { @@ -302,15 +304,6 @@ PyObject* wxPyMake_wxObject(wxObject* source) { Py_INCREF(target); } } - else if (wxIsKindOf(source, wxSizer)) { - // wxSizers also track the original object - wxSizer* sz = (wxSizer*)source; - wxPyClientData* data = (wxPyClientData*)sz->GetClientObject(); - if (data) { - target = data->m_obj; - Py_INCREF(target); - } - } if (! target) { // Otherwise make it the old fashioned way by making a @@ -341,6 +334,30 @@ PyObject* wxPyMake_wxObject(wxObject* source) { } +PyObject* wxPyMake_wxSizer(wxSizer* source) { + PyObject* target = NULL; + + if (source && wxIsKindOf(source, wxSizer)) { + // If it's derived from wxSizer then there may + // already be a pointer to a Python object that we can use + // in the OOR data. + wxSizer* sz = (wxSizer*)source; + wxPyClientData* data = (wxPyClientData*)sz->GetClientObject(); + if (data) { + target = data->m_obj; + Py_INCREF(target); + } + } + if (! target) { + target = wxPyMake_wxObject(source, FALSE); + if (target != Py_None) + ((wxSizer*)source)->SetClientObject(new wxPyClientData(target)); + } + return target; +} + + + //--------------------------------------------------------------------------- PyObject* wxPyConstructObject(void* ptr, diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index e31bed8bc2..318d202842 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -65,7 +65,8 @@ PyObject* wxPyConstructObject(void* ptr, PyObject* klass, int setThisOwn=0); PyObject* wxPyClassExists(const char* className); -PyObject* wxPyMake_wxObject(wxObject* source); +PyObject* wxPyMake_wxObject(wxObject* source, bool checkEvtHandler=TRUE); +PyObject* wxPyMake_wxSizer(wxSizer* source); void wxPyPtrTypeMap_Add(const char* commonName, const char* ptrName); PyObject* wxPy_ConvertList(wxListBase* list, const char* className); @@ -284,7 +285,8 @@ struct wxPyCoreAPI { void (*p_wxPyCBH_delete)(wxPyCallbackHelper* cbh); PyObject* (*p_wxPyClassExists)(const char* className); - PyObject* (*p_wxPyMake_wxObject)(wxObject* source); + PyObject* (*p_wxPyMake_wxObject)(wxObject* source, bool checkEvtHandler); + PyObject* (*p_wxPyMake_wxSizer)(wxSizer* source); void (*p_wxPyPtrTypeMap_Add)(const char* commonName, const char* ptrName); }; diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index 586953d24a..e6fec6467d 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -5991,6 +5991,53 @@ static PyObject *_wrap_wxTextAttr_IsDefault(PyObject *self, PyObject *args, PyOb return _resultobj; } +static PyObject *_wrap_wxTextAttr_Combine(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTextAttr * _result; + wxTextAttr * _arg0; + wxTextAttr * _arg1; + wxTextCtrl * _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "attr","attrDef","text", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTextAttr_Combine",_kwnames,&_argo0,&_argo1,&_argo2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTextAttr_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTextAttr_Combine. Expected _wxTextAttr_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTextAttr_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTextAttr_Combine. Expected _wxTextAttr_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxTextCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxTextAttr_Combine. Expected _wxTextCtrl_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxTextAttr (wxTextAttr::Combine(*_arg0,*_arg1,_arg2)); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxTextAttr_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + static void *SwigwxTextCtrlTowxControl(void *ptr) { wxTextCtrl *src; wxControl *dest; @@ -7630,6 +7677,43 @@ static PyObject *_wrap_wxTextCtrl_write(PyObject *self, PyObject *args, PyObject return _resultobj; } +static wxString wxTextCtrl_GetString(wxTextCtrl *self,long from,long to) { + return self->GetValue().Mid(from, to-from); + } +static PyObject *_wrap_wxTextCtrl_GetString(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxTextCtrl * _arg0; + long _arg1; + long _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","from","to", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxTextCtrl_GetString",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTextCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTextCtrl_GetString. Expected _wxTextCtrl_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxTextCtrl_GetString(_arg0,_arg1,_arg2)); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} + return _resultobj; +} + static void *SwigwxScrollBarTowxControl(void *ptr) { wxScrollBar *src; wxControl *dest; @@ -11212,6 +11296,7 @@ static PyMethodDef controlscMethods[] = { { "wxScrollBar_Create", (PyCFunction) _wrap_wxScrollBar_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreScrollBar", (PyCFunction) _wrap_new_wxPreScrollBar, METH_VARARGS | METH_KEYWORDS }, { "new_wxScrollBar", (PyCFunction) _wrap_new_wxScrollBar, METH_VARARGS | METH_KEYWORDS }, + { "wxTextCtrl_GetString", (PyCFunction) _wrap_wxTextCtrl_GetString, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_write", (PyCFunction) _wrap_wxTextCtrl_write, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_SetEditable", (PyCFunction) _wrap_wxTextCtrl_SetEditable, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_SelectAll", (PyCFunction) _wrap_wxTextCtrl_SelectAll, METH_VARARGS | METH_KEYWORDS }, @@ -11257,6 +11342,7 @@ static PyMethodDef controlscMethods[] = { { "wxTextCtrl_Create", (PyCFunction) _wrap_wxTextCtrl_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreTextCtrl", (PyCFunction) _wrap_new_wxPreTextCtrl, METH_VARARGS | METH_KEYWORDS }, { "new_wxTextCtrl", (PyCFunction) _wrap_new_wxTextCtrl, METH_VARARGS | METH_KEYWORDS }, + { "wxTextAttr_Combine", (PyCFunction) _wrap_wxTextAttr_Combine, METH_VARARGS | METH_KEYWORDS }, { "wxTextAttr_IsDefault", (PyCFunction) _wrap_wxTextAttr_IsDefault, METH_VARARGS | METH_KEYWORDS }, { "wxTextAttr_GetFont", (PyCFunction) _wrap_wxTextAttr_GetFont, METH_VARARGS | METH_KEYWORDS }, { "wxTextAttr_GetBackgroundColour", (PyCFunction) _wrap_wxTextAttr_GetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index 38059600b4..7cebb7b1b4 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -738,6 +738,9 @@ class wxTextCtrlPtr(wxControlPtr): def write(self, *_args, **_kwargs): val = apply(controlsc.wxTextCtrl_write,(self,) + _args, _kwargs) return val + def GetString(self, *_args, **_kwargs): + val = apply(controlsc.wxTextCtrl_GetString,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxTextCtrl(wxTextCtrlPtr): @@ -1139,6 +1142,11 @@ def wxButton_GetDefaultSize(*_args, **_kwargs): if val: val = wxSizePtr(val); val.thisown = 1 return val +def wxTextAttr_Combine(*_args, **_kwargs): + val = apply(controlsc.wxTextAttr_Combine,_args,_kwargs) + if val: val = wxTextAttrPtr(val); val.thisown = 1 + return val + #-------------- VARIABLE WRAPPERS ------------------ diff --git a/wxPython/src/msw/frames.cpp b/wxPython/src/msw/frames.cpp index 5d3e2c9c05..c51123fdb1 100644 --- a/wxPython/src/msw/frames.cpp +++ b/wxPython/src/msw/frames.cpp @@ -1804,7 +1804,7 @@ static PyObject *_wrap_wxDialog_CreateTextSizer(PyObject *self, PyObject *args, wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxSizer(_result); } { if (_obj1) delete _arg1; @@ -1837,7 +1837,7 @@ static PyObject *_wrap_wxDialog_CreateButtonSizer(PyObject *self, PyObject *args wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxSizer(_result); } return _resultobj; } diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index cda64768c9..46a16a1df0 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -4689,6 +4689,34 @@ static PyObject *_wrap_wxFontList_RemoveFont(PyObject *self, PyObject *args, PyO return _resultobj; } +#define wxFontList_GetCount(_swigobj) (_swigobj->GetCount()) +static PyObject *_wrap_wxFontList_GetCount(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxFontList * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFontList_GetCount",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontList_GetCount. Expected _wxFontList_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxFontList_GetCount(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxColourTowxObject(void *ptr) { wxColour *src; wxObject *dest; @@ -5878,6 +5906,34 @@ static PyObject *_wrap_wxPenList_RemovePen(PyObject *self, PyObject *args, PyObj return _resultobj; } +#define wxPenList_GetCount(_swigobj) (_swigobj->GetCount()) +static PyObject *_wrap_wxPenList_GetCount(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxPenList * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPenList_GetCount",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPenList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPenList_GetCount. Expected _wxPenList_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxPenList_GetCount(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxBrushTowxGDIObject(void *ptr) { wxBrush *src; wxGDIObject *dest; @@ -6306,6 +6362,34 @@ static PyObject *_wrap_wxBrushList_RemoveBrush(PyObject *self, PyObject *args, P return _resultobj; } +#define wxBrushList_GetCount(_swigobj) (_swigobj->GetCount()) +static PyObject *_wrap_wxBrushList_GetCount(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxBrushList * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBrushList_GetCount",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBrushList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBrushList_GetCount. Expected _wxBrushList_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxBrushList_GetCount(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxDCTowxObject(void *ptr) { wxDC *src; wxObject *dest; @@ -12311,6 +12395,7 @@ static PyMethodDef gdicMethods[] = { { "wxDC_Blit", (PyCFunction) _wrap_wxDC_Blit, METH_VARARGS | METH_KEYWORDS }, { "wxDC_BeginDrawing", (PyCFunction) _wrap_wxDC_BeginDrawing, METH_VARARGS | METH_KEYWORDS }, { "delete_wxDC", (PyCFunction) _wrap_delete_wxDC, METH_VARARGS | METH_KEYWORDS }, + { "wxBrushList_GetCount", (PyCFunction) _wrap_wxBrushList_GetCount, METH_VARARGS | METH_KEYWORDS }, { "wxBrushList_RemoveBrush", (PyCFunction) _wrap_wxBrushList_RemoveBrush, METH_VARARGS | METH_KEYWORDS }, { "wxBrushList_FindOrCreateBrush", (PyCFunction) _wrap_wxBrushList_FindOrCreateBrush, METH_VARARGS | METH_KEYWORDS }, { "wxBrushList_AddBrush", (PyCFunction) _wrap_wxBrushList_AddBrush, METH_VARARGS | METH_KEYWORDS }, @@ -12323,6 +12408,7 @@ static PyMethodDef gdicMethods[] = { { "wxBrush_GetColour", (PyCFunction) _wrap_wxBrush_GetColour, METH_VARARGS | METH_KEYWORDS }, { "delete_wxBrush", (PyCFunction) _wrap_delete_wxBrush, METH_VARARGS | METH_KEYWORDS }, { "new_wxBrush", (PyCFunction) _wrap_new_wxBrush, METH_VARARGS | METH_KEYWORDS }, + { "wxPenList_GetCount", (PyCFunction) _wrap_wxPenList_GetCount, METH_VARARGS | METH_KEYWORDS }, { "wxPenList_RemovePen", (PyCFunction) _wrap_wxPenList_RemovePen, METH_VARARGS | METH_KEYWORDS }, { "wxPenList_FindOrCreatePen", (PyCFunction) _wrap_wxPenList_FindOrCreatePen, METH_VARARGS | METH_KEYWORDS }, { "wxPenList_AddPen", (PyCFunction) _wrap_wxPenList_AddPen, METH_VARARGS | METH_KEYWORDS }, @@ -12356,6 +12442,7 @@ static PyMethodDef gdicMethods[] = { { "wxColour_Red", (PyCFunction) _wrap_wxColour_Red, METH_VARARGS | METH_KEYWORDS }, { "delete_wxColour", (PyCFunction) _wrap_delete_wxColour, METH_VARARGS | METH_KEYWORDS }, { "new_wxColour", (PyCFunction) _wrap_new_wxColour, METH_VARARGS | METH_KEYWORDS }, + { "wxFontList_GetCount", (PyCFunction) _wrap_wxFontList_GetCount, METH_VARARGS | METH_KEYWORDS }, { "wxFontList_RemoveFont", (PyCFunction) _wrap_wxFontList_RemoveFont, METH_VARARGS | METH_KEYWORDS }, { "wxFontList_FindOrCreateFont", (PyCFunction) _wrap_wxFontList_FindOrCreateFont, METH_VARARGS | METH_KEYWORDS }, { "wxFontList_AddFont", (PyCFunction) _wrap_wxFontList_AddFont, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index d872897b39..43ade8a86a 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -401,6 +401,9 @@ class wxFontListPtr(wxObjectPtr): def RemoveFont(self, *_args, **_kwargs): val = apply(gdic.wxFontList_RemoveFont,(self,) + _args, _kwargs) return val + def GetCount(self, *_args, **_kwargs): + val = apply(gdic.wxFontList_GetCount,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxFontList(wxFontListPtr): @@ -566,6 +569,9 @@ class wxPenListPtr(wxObjectPtr): def RemovePen(self, *_args, **_kwargs): val = apply(gdic.wxPenList_RemovePen,(self,) + _args, _kwargs) return val + def GetCount(self, *_args, **_kwargs): + val = apply(gdic.wxPenList_GetCount,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxPenList(wxPenListPtr): @@ -629,6 +635,9 @@ class wxBrushListPtr(wxObjectPtr): def RemoveBrush(self, *_args, **_kwargs): val = apply(gdic.wxBrushList_RemoveBrush,(self,) + _args, _kwargs) return val + def GetCount(self, *_args, **_kwargs): + val = apply(gdic.wxBrushList_GetCount,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxBrushList(wxBrushListPtr): diff --git a/wxPython/src/msw/sizers.cpp b/wxPython/src/msw/sizers.cpp index 09e871ec70..ef86f1d7be 100644 --- a/wxPython/src/msw/sizers.cpp +++ b/wxPython/src/msw/sizers.cpp @@ -576,7 +576,7 @@ static PyObject *_wrap_wxSizerItem_GetSizer(PyObject *self, PyObject *args, PyOb wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxSizer(_result); } return _resultobj; } diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 63dd54c338..817c0970c8 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -5065,7 +5065,7 @@ static PyObject *_wrap_wxWindow_GetSizer(PyObject *self, PyObject *args, PyObjec wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +}{ _resultobj = wxPyMake_wxSizer(_result); } return _resultobj; } diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 85cdce4432..d180d84759 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -672,6 +672,7 @@ static wxPyCoreAPI API = { wxPyClassExists, wxPyMake_wxObject, + wxPyMake_wxSizer, wxPyPtrTypeMap_Add, }; @@ -1980,16 +1981,19 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxLB_HSCROLL", PyInt_FromLong((long) wxLB_HSCROLL)); PyDict_SetItemString(d,"wxPROCESS_ENTER", PyInt_FromLong((long) wxPROCESS_ENTER)); PyDict_SetItemString(d,"wxPASSWORD", PyInt_FromLong((long) wxPASSWORD)); - PyDict_SetItemString(d,"wxTE_PROCESS_ENTER", PyInt_FromLong((long) wxTE_PROCESS_ENTER)); - PyDict_SetItemString(d,"wxTE_PROCESS_TAB", PyInt_FromLong((long) wxTE_PROCESS_TAB)); - PyDict_SetItemString(d,"wxTE_PASSWORD", PyInt_FromLong((long) wxTE_PASSWORD)); PyDict_SetItemString(d,"wxTE_READONLY", PyInt_FromLong((long) wxTE_READONLY)); - PyDict_SetItemString(d,"wxTE_RICH", PyInt_FromLong((long) wxTE_RICH)); PyDict_SetItemString(d,"wxTE_MULTILINE", PyInt_FromLong((long) wxTE_MULTILINE)); - PyDict_SetItemString(d,"wxTE_AUTO_SCROLL", PyInt_FromLong((long) wxTE_AUTO_SCROLL)); + PyDict_SetItemString(d,"wxTE_PROCESS_TAB", PyInt_FromLong((long) wxTE_PROCESS_TAB)); + PyDict_SetItemString(d,"wxTE_RICH", PyInt_FromLong((long) wxTE_RICH)); PyDict_SetItemString(d,"wxTE_NO_VSCROLL", PyInt_FromLong((long) wxTE_NO_VSCROLL)); + PyDict_SetItemString(d,"wxTE_AUTO_SCROLL", PyInt_FromLong((long) wxTE_AUTO_SCROLL)); + PyDict_SetItemString(d,"wxTE_PROCESS_ENTER", PyInt_FromLong((long) wxTE_PROCESS_ENTER)); + PyDict_SetItemString(d,"wxTE_PASSWORD", PyInt_FromLong((long) wxTE_PASSWORD)); PyDict_SetItemString(d,"wxTE_AUTO_URL", PyInt_FromLong((long) wxTE_AUTO_URL)); PyDict_SetItemString(d,"wxTE_NOHIDESEL", PyInt_FromLong((long) wxTE_NOHIDESEL)); + PyDict_SetItemString(d,"wxTE_DONTWRAP", PyInt_FromLong((long) wxTE_DONTWRAP)); + PyDict_SetItemString(d,"wxTE_LINEWRAP", PyInt_FromLong((long) wxTE_LINEWRAP)); + PyDict_SetItemString(d,"wxTE_WORDWRAP", PyInt_FromLong((long) wxTE_WORDWRAP)); PyDict_SetItemString(d,"wxCB_SIMPLE", PyInt_FromLong((long) wxCB_SIMPLE)); PyDict_SetItemString(d,"wxCB_DROPDOWN", PyInt_FromLong((long) wxCB_DROPDOWN)); PyDict_SetItemString(d,"wxCB_SORT", PyInt_FromLong((long) wxCB_SORT)); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 1d084f8148..120679b480 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -245,16 +245,19 @@ wxLB_OWNERDRAW = wxc.wxLB_OWNERDRAW wxLB_HSCROLL = wxc.wxLB_HSCROLL wxPROCESS_ENTER = wxc.wxPROCESS_ENTER wxPASSWORD = wxc.wxPASSWORD -wxTE_PROCESS_ENTER = wxc.wxTE_PROCESS_ENTER -wxTE_PROCESS_TAB = wxc.wxTE_PROCESS_TAB -wxTE_PASSWORD = wxc.wxTE_PASSWORD wxTE_READONLY = wxc.wxTE_READONLY -wxTE_RICH = wxc.wxTE_RICH wxTE_MULTILINE = wxc.wxTE_MULTILINE -wxTE_AUTO_SCROLL = wxc.wxTE_AUTO_SCROLL +wxTE_PROCESS_TAB = wxc.wxTE_PROCESS_TAB +wxTE_RICH = wxc.wxTE_RICH wxTE_NO_VSCROLL = wxc.wxTE_NO_VSCROLL +wxTE_AUTO_SCROLL = wxc.wxTE_AUTO_SCROLL +wxTE_PROCESS_ENTER = wxc.wxTE_PROCESS_ENTER +wxTE_PASSWORD = wxc.wxTE_PASSWORD wxTE_AUTO_URL = wxc.wxTE_AUTO_URL wxTE_NOHIDESEL = wxc.wxTE_NOHIDESEL +wxTE_DONTWRAP = wxc.wxTE_DONTWRAP +wxTE_LINEWRAP = wxc.wxTE_LINEWRAP +wxTE_WORDWRAP = wxc.wxTE_WORDWRAP wxCB_SIMPLE = wxc.wxCB_SIMPLE wxCB_DROPDOWN = wxc.wxCB_DROPDOWN wxCB_SORT = wxc.wxCB_SORT diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 6be6572f4c..249881280c 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -331,7 +331,6 @@ %typemap(python, out) wxMouseEvent* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxObject* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxPyPrintout* { $target = wxPyMake_wxObject($source); } -%typemap(python, out) wxSizer* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxToolBarToolBase* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxToolTip* { $target = wxPyMake_wxObject($source); } @@ -351,6 +350,8 @@ %typemap(python, out) wxToolBarBase* { $target = wxPyMake_wxObject($source); } %typemap(python, out) wxWindow* { $target = wxPyMake_wxObject($source); } +%typemap(python, out) wxSizer* { $target = wxPyMake_wxSizer($source); } + //%typemap(python, out) wxHtmlCell* { $target = wxPyMake_wxObject($source); } //%typemap(python, out) wxHtmlContainerCell* { $target = wxPyMake_wxObject($source); } diff --git a/wxPython/src/wx.i b/wxPython/src/wx.i index 1228022e2c..4fdfa903e9 100644 --- a/wxPython/src/wx.i +++ b/wxPython/src/wx.i @@ -190,6 +190,7 @@ static wxPyCoreAPI API = { wxPyClassExists, wxPyMake_wxObject, + wxPyMake_wxSizer, wxPyPtrTypeMap_Add, }; -- 2.47.2