X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70b7a5fe0cb26e15c52bcdeb730f43eb3838360f..46ae103b9f08fc4e447d16a6a92b03cf55ee3189:/wxPython/src/msw/_windows_wrap.cpp?ds=inline diff --git a/wxPython/src/msw/_windows_wrap.cpp b/wxPython/src/msw/_windows_wrap.cpp index 47e89bd55e..3f52f17b36 100644 --- a/wxPython/src/msw/_windows_wrap.cpp +++ b/wxPython/src/msw/_windows_wrap.cpp @@ -1037,7 +1037,8 @@ SWIG_Python_TypeError(const char *type, PyObject *obj) PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } - Py_DECREF(str); + if (str) + Py_DECREF(str); return; } } @@ -2113,6 +2114,16 @@ public: void SetBestSize(const wxSize& size) { wxWindow::SetBestSize(size); } + bool DoEraseBackground(wxDC* dc) { +#ifdef __WXMSW__ + return wxWindow::DoEraseBackground(dc->GetHDC()); +#else + dc->SetBackground(wxBrush(GetBackgroundColour())); + dc->Clear(); + return true; +#endif + } + DEC_PYCALLBACK_VOID_INT4(DoMoveWindow); DEC_PYCALLBACK_VOID_INT5(DoSetSize); DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize); @@ -2142,6 +2153,8 @@ public: DEC_PYCALLBACK_BOOL_(HasTransparentBackground); + DEC_PYCALLBACK_VOID_(OnInternalIdle); + PYPRIVATE; }; @@ -2176,6 +2189,8 @@ IMP_PYCALLBACK_VIZATTR_(wxPyWindow, wxWindow, GetDefaultAttributes); IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, HasTransparentBackground); +IMP_PYCALLBACK_VOID_(wxPyWindow, wxWindow, OnInternalIdle); + // C++ version of Python aware wxPanel class wxPyPanel : public wxPanel { @@ -2190,6 +2205,15 @@ public: : wxPanel(parent, id, pos, size, style, name) {} void SetBestSize(const wxSize& size) { wxPanel::SetBestSize(size); } + bool DoEraseBackground(wxDC* dc) { +#ifdef __WXMSW__ + return wxWindow::DoEraseBackground(dc->GetHDC()); +#else + dc->SetBackground(wxBrush(GetBackgroundColour())); + dc->Clear(); + return true; +#endif + } DEC_PYCALLBACK_VOID_INT4(DoMoveWindow); @@ -2221,6 +2245,8 @@ public: DEC_PYCALLBACK_BOOL_(HasTransparentBackground); + DEC_PYCALLBACK_VOID_(OnInternalIdle); + PYPRIVATE; }; @@ -2255,6 +2281,8 @@ IMP_PYCALLBACK_VIZATTR_(wxPyPanel, wxPanel, GetDefaultAttributes); IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, HasTransparentBackground); +IMP_PYCALLBACK_VOID_(wxPyPanel, wxPanel, OnInternalIdle); + // C++ version of Python aware wxScrolledWindow class wxPyScrolledWindow : public wxScrolledWindow { @@ -2269,6 +2297,15 @@ public: : wxScrolledWindow(parent, id, pos, size, style, name) {} void SetBestSize(const wxSize& size) { wxScrolledWindow::SetBestSize(size); } + bool DoEraseBackground(wxDC* dc) { +#ifdef __WXMSW__ + return wxWindow::DoEraseBackground(dc->GetHDC()); +#else + dc->SetBackground(wxBrush(GetBackgroundColour())); + dc->Clear(); + return true; +#endif + } DEC_PYCALLBACK_VOID_INT4(DoMoveWindow); DEC_PYCALLBACK_VOID_INT5(DoSetSize); @@ -2299,6 +2336,8 @@ public: DEC_PYCALLBACK_BOOL_(HasTransparentBackground); + DEC_PYCALLBACK_VOID_(OnInternalIdle); + PYPRIVATE; }; @@ -2333,6 +2372,8 @@ IMP_PYCALLBACK_VIZATTR_(wxPyScrolledWindow, wxScrolledWindow, GetDefaultAttribut IMP_PYCALLBACK_BOOL_(wxPyScrolledWindow, wxScrolledWindow, HasTransparentBackground); +IMP_PYCALLBACK_VOID_(wxPyScrolledWindow, wxScrolledWindow, OnInternalIdle); + #include "wx/wxPython/printfw.h" @@ -5931,7 +5972,7 @@ static PyObject *_wrap_Dialog_CreateTextSizer(PyObject *, PyObject *args, PyObje if (PyErr_Occurred()) SWIG_fail; } { - resultobj = wxPyMake_wxSizer(result, 0); + resultobj = wxPyMake_wxObject(result, 0); } { if (temp2) @@ -5973,7 +6014,7 @@ static PyObject *_wrap_Dialog_CreateButtonSizer(PyObject *, PyObject *args, PyOb if (PyErr_Occurred()) SWIG_fail; } { - resultobj = wxPyMake_wxSizer(result, 0); + resultobj = wxPyMake_wxObject(result, 0); } return resultobj; fail: @@ -17994,6 +18035,38 @@ static PyObject *_wrap_PyWindow_SetBestSize(PyObject *, PyObject *args, PyObject } +static PyObject *_wrap_PyWindow_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPyWindow *arg1 = (wxPyWindow *) 0 ; + wxDC *arg2 = (wxDC *) 0 ; + bool result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "dc", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyWindow_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyWindow, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(2)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->DoEraseBackground(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_PyWindow_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxPyWindow *arg1 = (wxPyWindow *) 0 ; @@ -18656,6 +18729,31 @@ static PyObject *_wrap_PyWindow_base_GetDefaultAttributes(PyObject *, PyObject * } +static PyObject *_wrap_PyWindow_base_OnInternalIdle(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPyWindow *arg1 = (wxPyWindow *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PyWindow_base_OnInternalIdle",kwnames,&obj0)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyWindow, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->base_OnInternalIdle(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject * PyWindow_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -18831,6 +18929,38 @@ static PyObject *_wrap_PyPanel_SetBestSize(PyObject *, PyObject *args, PyObject } +static PyObject *_wrap_PyPanel_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPyPanel *arg1 = (wxPyPanel *) 0 ; + wxDC *arg2 = (wxDC *) 0 ; + bool result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "dc", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyPanel_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyPanel, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(2)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->DoEraseBackground(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_PyPanel_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxPyPanel *arg1 = (wxPyPanel *) 0 ; @@ -19493,6 +19623,31 @@ static PyObject *_wrap_PyPanel_base_GetDefaultAttributes(PyObject *, PyObject *a } +static PyObject *_wrap_PyPanel_base_OnInternalIdle(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPyPanel *arg1 = (wxPyPanel *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PyPanel_base_OnInternalIdle",kwnames,&obj0)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyPanel, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->base_OnInternalIdle(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject * PyPanel_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -19668,6 +19823,38 @@ static PyObject *_wrap_PyScrolledWindow_SetBestSize(PyObject *, PyObject *args, } +static PyObject *_wrap_PyScrolledWindow_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPyScrolledWindow *arg1 = (wxPyScrolledWindow *) 0 ; + wxDC *arg2 = (wxDC *) 0 ; + bool result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "dc", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyScrolledWindow_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyScrolledWindow, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(2)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->DoEraseBackground(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_PyScrolledWindow_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxPyScrolledWindow *arg1 = (wxPyScrolledWindow *) 0 ; @@ -20330,6 +20517,31 @@ static PyObject *_wrap_PyScrolledWindow_base_GetDefaultAttributes(PyObject *, Py } +static PyObject *_wrap_PyScrolledWindow_base_OnInternalIdle(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPyScrolledWindow *arg1 = (wxPyScrolledWindow *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PyScrolledWindow_base_OnInternalIdle",kwnames,&obj0)) goto fail; + SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyScrolledWindow, SWIG_POINTER_EXCEPTION | 0); + if (SWIG_arg_fail(1)) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->base_OnInternalIdle(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject * PyScrolledWindow_swigregister(PyObject *, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -28197,6 +28409,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"new_PrePyWindow", (PyCFunction) _wrap_new_PrePyWindow, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow__setCallbackInfo", (PyCFunction) _wrap_PyWindow__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow_SetBestSize", (PyCFunction) _wrap_PyWindow_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"PyWindow_DoEraseBackground", (PyCFunction) _wrap_PyWindow_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow_base_DoMoveWindow", (PyCFunction) _wrap_PyWindow_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow_base_DoSetSize", (PyCFunction) _wrap_PyWindow_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow_base_DoSetClientSize", (PyCFunction) _wrap_PyWindow_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -28217,11 +28430,13 @@ static PyMethodDef SwigMethods[] = { { (char *)"PyWindow_base_RemoveChild", (PyCFunction) _wrap_PyWindow_base_RemoveChild, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow_base_ShouldInheritColours", (PyCFunction) _wrap_PyWindow_base_ShouldInheritColours, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow_base_GetDefaultAttributes", (PyCFunction) _wrap_PyWindow_base_GetDefaultAttributes, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"PyWindow_base_OnInternalIdle", (PyCFunction) _wrap_PyWindow_base_OnInternalIdle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyWindow_swigregister", PyWindow_swigregister, METH_VARARGS, NULL}, { (char *)"new_PyPanel", (PyCFunction) _wrap_new_PyPanel, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"new_PrePyPanel", (PyCFunction) _wrap_new_PrePyPanel, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel__setCallbackInfo", (PyCFunction) _wrap_PyPanel__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel_SetBestSize", (PyCFunction) _wrap_PyPanel_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"PyPanel_DoEraseBackground", (PyCFunction) _wrap_PyPanel_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel_base_DoMoveWindow", (PyCFunction) _wrap_PyPanel_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel_base_DoSetSize", (PyCFunction) _wrap_PyPanel_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel_base_DoSetClientSize", (PyCFunction) _wrap_PyPanel_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -28242,11 +28457,13 @@ static PyMethodDef SwigMethods[] = { { (char *)"PyPanel_base_RemoveChild", (PyCFunction) _wrap_PyPanel_base_RemoveChild, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel_base_ShouldInheritColours", (PyCFunction) _wrap_PyPanel_base_ShouldInheritColours, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel_base_GetDefaultAttributes", (PyCFunction) _wrap_PyPanel_base_GetDefaultAttributes, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"PyPanel_base_OnInternalIdle", (PyCFunction) _wrap_PyPanel_base_OnInternalIdle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyPanel_swigregister", PyPanel_swigregister, METH_VARARGS, NULL}, { (char *)"new_PyScrolledWindow", (PyCFunction) _wrap_new_PyScrolledWindow, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"new_PrePyScrolledWindow", (PyCFunction) _wrap_new_PrePyScrolledWindow, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow__setCallbackInfo", (PyCFunction) _wrap_PyScrolledWindow__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow_SetBestSize", (PyCFunction) _wrap_PyScrolledWindow_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"PyScrolledWindow_DoEraseBackground", (PyCFunction) _wrap_PyScrolledWindow_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow_base_DoMoveWindow", (PyCFunction) _wrap_PyScrolledWindow_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow_base_DoSetSize", (PyCFunction) _wrap_PyScrolledWindow_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow_base_DoSetClientSize", (PyCFunction) _wrap_PyScrolledWindow_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL}, @@ -28267,6 +28484,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"PyScrolledWindow_base_RemoveChild", (PyCFunction) _wrap_PyScrolledWindow_base_RemoveChild, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow_base_ShouldInheritColours", (PyCFunction) _wrap_PyScrolledWindow_base_ShouldInheritColours, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow_base_GetDefaultAttributes", (PyCFunction) _wrap_PyScrolledWindow_base_GetDefaultAttributes, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"PyScrolledWindow_base_OnInternalIdle", (PyCFunction) _wrap_PyScrolledWindow_base_OnInternalIdle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"PyScrolledWindow_swigregister", PyScrolledWindow_swigregister, METH_VARARGS, NULL}, { (char *)"new_PrintData", _wrap_new_PrintData, METH_VARARGS, NULL}, { (char *)"delete_PrintData", (PyCFunction) _wrap_delete_PrintData, METH_VARARGS | METH_KEYWORDS, NULL},