X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93b663b8ccc9f82dd32d492c8a6081a8c75e8419..52f52ebc4e0be6a9899d328b08db9eb14629d219:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 18081078e9..99fdb3ce27 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -28,6 +28,10 @@ #include #endif +#ifdef __WXMAC__ +#include +#endif + #include #include #include @@ -1667,10 +1671,11 @@ PyObject* wxPy_ConvertList(wxListBase* listbase) { //---------------------------------------------------------------------- long wxPyGetWinHandle(wxWindow* win) { + #ifdef __WXMSW__ return (long)win->GetHandle(); #endif - + // Find and return the actual X-Window. #ifdef __WXGTK__ if (win->m_wxwindow) { @@ -1684,6 +1689,11 @@ long wxPyGetWinHandle(wxWindow* win) { #endif } #endif + +#ifdef __WXMAC__ + return (long)MAC_WXHWND(win->MacGetRootWindow()); +#endif + return 0; } @@ -2218,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")); } @@ -2231,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; @@ -2263,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; @@ -2303,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; @@ -2368,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;