diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index e3c5c8752c..e9d3d1652d 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -1947,7 +1947,6 @@ public: // override some base class functions - virtual bool Enable(bool enable = true) wxOVERRIDE; virtual wxWindow *GetMainWindowOfCompositeControl() wxOVERRIDE { return (wxWindow*)m_gridWin; } virtual void Fit() wxOVERRIDE; @@ -1957,6 +1956,7 @@ public: protected: virtual wxSize DoGetBestSize() const wxOVERRIDE; + virtual void DoEnable(bool enable) wxOVERRIDE; bool m_created; diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 5c5132c83b..a7c5648aba 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -6817,15 +6817,11 @@ void wxGrid::ForceRefresh() EndBatch(); } -bool wxGrid::Enable(bool enable) +void wxGrid::DoEnable(bool enable) { - if ( !wxScrolledWindow::Enable(enable) ) - return false; + wxScrolledWindow::DoEnable(enable); - // redraw in the new state - m_gridWin->Refresh(); - - return true; + Refresh(false /* don't erase background */); } //