X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b35fec738ef02e1d0a5419466c42ccbb13b6676..cc0bffacebe299b312ce7fdf49a8825f466cf73f:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index b6cb242d2a..99fdb3ce27 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -2228,12 +2228,20 @@ bool wxPySimple_typecheck(PyObject* source, const wxChar* classname, int seqLen) bool wxSize_helper(PyObject* source, wxSize** obj) { + if (source == Py_None) { + **obj = wxSize(-1,-1); + return True; + } return wxPyTwoIntItem_helper(source, obj, wxT("wxSize")); } bool wxPoint_helper(PyObject* source, wxPoint** obj) { + if (source == Py_None) { + **obj = wxPoint(-1,-1); + return True; + } return wxPyTwoIntItem_helper(source, obj, wxT("wxPoint")); } @@ -2241,6 +2249,11 @@ bool wxPoint_helper(PyObject* source, wxPoint** obj) bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj) { + if (source == Py_None) { + **obj = wxRealPoint(-1,-1); + return True; + } + // If source is an object instance then it may already be the right type if (wxPySwigInstance_Check(source)) { wxRealPoint* ptr; @@ -2273,6 +2286,11 @@ bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj) { bool wxRect_helper(PyObject* source, wxRect** obj) { + if (source == Py_None) { + **obj = wxRect(-1,-1,-1,-1); + return True; + } + // If source is an object instance then it may already be the right type if (wxPySwigInstance_Check(source)) { wxRect* ptr; @@ -2313,6 +2331,11 @@ bool wxRect_helper(PyObject* source, wxRect** obj) { bool wxColour_helper(PyObject* source, wxColour** obj) { + if (source == Py_None) { + **obj = wxNullColour; + return True; + } + // If source is an object instance then it may already be the right type if (wxPySwigInstance_Check(source)) { wxColour* ptr; @@ -2378,6 +2401,12 @@ bool wxColour_typecheck(PyObject* source) { bool wxPoint2D_helper(PyObject* source, wxPoint2D** obj) { + + if (source == Py_None) { + **obj = wxPoint2D(-1,-1); + return True; + } + // If source is an object instance then it may already be the right type if (wxPySwigInstance_Check(source)) { wxPoint2D* ptr;