From 945cec4be14af13fd073dfc06d659ca1d2aaf1cd Mon Sep 17 00:00:00 2001 From: mikek Date: Thu, 1 Feb 2018 01:02:56 +0100 Subject: [PATCH] Refresh generic wxDataViewCtrl after disabling it Grey the control out immediately, instead of waiting until the next refresh to do it. Closes #17887. --- include/wx/generic/dataview.h | 2 +- src/generic/datavgen.cpp | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index f4ebc64cae..5efc0e1eec 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -257,10 +257,10 @@ public: #if wxUSE_ACCESSIBILITY virtual bool Show(bool show = true) wxOVERRIDE; - virtual bool Enable(bool enable = true) wxOVERRIDE; virtual void SetName(const wxString &name) wxOVERRIDE; virtual bool Reparent(wxWindowBase *newParent) wxOVERRIDE; #endif // wxUSE_ACCESSIBILITY + virtual bool Enable(bool enable = true) wxOVERRIDE; virtual bool AllowMultiColumnSort(bool allow) wxOVERRIDE; virtual bool IsMultiColumnSortAllowed() const wxOVERRIDE { return m_allowMultiColumnSort; } diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 9a4f08276e..34fdcc7409 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -5228,17 +5228,6 @@ bool wxDataViewCtrl::Show(bool show) return changed; } -bool wxDataViewCtrl::Enable(bool enable) -{ - bool changed = wxControl::Enable(enable); - if ( changed ) - { - wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_STATECHANGE, this, wxOBJID_CLIENT, wxACC_SELF); - } - - return changed; -} - void wxDataViewCtrl::SetName(const wxString &name) { wxControl::SetName(name); @@ -5257,6 +5246,20 @@ bool wxDataViewCtrl::Reparent(wxWindowBase *newParent) } #endif // wxUSE_ACCESIBILITY +bool wxDataViewCtrl::Enable(bool enable) +{ + bool changed = wxControl::Enable(enable); + if ( changed ) + { +#if wxUSE_ACCESSIBILITY + wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_STATECHANGE, this, wxOBJID_CLIENT, wxACC_SELF); +#endif // wxUSE_ACCESIBILITY + Refresh(); + } + + return changed; +} + bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model ) { if (!wxDataViewCtrlBase::AssociateModel( model ))