From e671386d1afc7bdfa5853fde0796e893d3b37705 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 24 Jan 2020 02:33:40 +0100 Subject: [PATCH] Use wxBG_STYLE_PAINT for wxGridWindow This is more explicit, efficient and simpler than defining an empty wxEVT_ERASE_BACKGROUND handler, which is not needed any longer. --- include/wx/generic/private/grid.h | 2 +- src/generic/grid.cpp | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/wx/generic/private/grid.h b/include/wx/generic/private/grid.h index 172738df55..f2feaa77e8 100644 --- a/include/wx/generic/private/grid.h +++ b/include/wx/generic/private/grid.h @@ -419,6 +419,7 @@ public: "GridWindow"), m_type(type) { + SetBackgroundStyle(wxBG_STYLE_PAINT); } @@ -437,7 +438,6 @@ private: void OnKeyDown( wxKeyEvent& ); void OnKeyUp( wxKeyEvent& ); void OnChar( wxKeyEvent& ); - void OnEraseBackground( wxEraseEvent& ); void OnFocus( wxFocusEvent& ); wxDECLARE_EVENT_TABLE(); diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 836d8d2ad1..bfce15da41 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1907,7 +1907,6 @@ wxBEGIN_EVENT_TABLE( wxGridWindow, wxGridSubwindow ) EVT_CHAR( wxGridWindow::OnChar ) EVT_SET_FOCUS( wxGridWindow::OnFocus ) EVT_KILL_FOCUS( wxGridWindow::OnFocus ) - EVT_ERASE_BACKGROUND( wxGridWindow::OnEraseBackground ) wxEND_EVENT_TABLE() void wxGridWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) @@ -2281,10 +2280,6 @@ void wxGridWindow::OnChar( wxKeyEvent& event ) event.Skip(); } -void wxGridWindow::OnEraseBackground( wxEraseEvent& WXUNUSED(event) ) -{ -} - void wxGridWindow::OnFocus(wxFocusEvent& event) { // and if we have any selection, it has to be repainted, because it