From 0ef14ca557afe4bf06c4c4b6bee43f845a71080b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 17 May 2005 00:28:12 +0000 Subject: [PATCH] Added DoEraseBackground git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_pycontrol.i | 13 ++++++++++++- wxPython/src/_pywindows.i | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/wxPython/src/_pycontrol.i b/wxPython/src/_pycontrol.i index 486242bbb7..add81220a4 100644 --- a/wxPython/src/_pycontrol.i +++ b/wxPython/src/_pycontrol.i @@ -36,6 +36,16 @@ public: void SetBestSize(const wxSize& size) { wxControl::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); @@ -120,7 +130,8 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); void SetBestSize(const wxSize& size); - + bool DoEraseBackground(wxDC* dc); + void base_DoMoveWindow(int x, int y, int width, int height); void base_DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); diff --git a/wxPython/src/_pywindows.i b/wxPython/src/_pywindows.i index bff343eada..fb6b59057e 100644 --- a/wxPython/src/_pywindows.i +++ b/wxPython/src/_pywindows.i @@ -49,7 +49,6 @@ //--------------------------------------------------------------------------- - %{ // C++ version of Python aware wxWindow class wxPyWindow : public wxWindow { @@ -65,6 +64,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); @@ -147,9 +156,9 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); - void SetBestSize(const wxSize& size); - + bool DoEraseBackground(wxDC* dc); + void base_DoMoveWindow(int x, int y, int width, int height); void base_DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); @@ -208,6 +217,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); @@ -293,7 +311,8 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); void SetBestSize(const wxSize& size); - + bool DoEraseBackground(wxDC* dc); + void base_DoMoveWindow(int x, int y, int width, int height); void base_DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); @@ -346,6 +365,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); @@ -430,7 +458,8 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class); void SetBestSize(const wxSize& size); - + bool DoEraseBackground(wxDC* dc); + void base_DoMoveWindow(int x, int y, int width, int height); void base_DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);