Ensure that wxGrid appearance always reflects its enabled state

Override DoEnable() in wxGrid instead of Enable() to ensure that the
grid is shown appropriately for its current state whenever either it or
its parent is disabled.

Note that this also fixes the bug with only the main grid window being
refreshed, but not the row/column headers, which also need to be.
This commit is contained in:
Vadim Zeitlin
2019-09-24 01:44:55 +02:00
parent ec76367afd
commit b0ff3bf3ea
2 changed files with 4 additions and 8 deletions

View File

@@ -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;