From d7f3f96cac060035f3e6ce5d30e7726c87a53def Mon Sep 17 00:00:00 2001 From: donovan6000 Date: Sun, 24 Mar 2019 23:32:55 -0700 Subject: [PATCH 1/3] Fixes displaying disabled wxDataViewItem with native appearance Causes the wxCONTROL_DISABLED flag to be set based on the results of the wxDataViewModel's IsEnabled() method. --- src/common/datavcmn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 889cc26adc..59bd6532f8 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1067,7 +1067,7 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, int flags = 0; if ( state & wxDATAVIEW_CELL_SELECTED ) flags |= wxCONTROL_SELECTED; - if ( !GetOwner()->GetOwner()->IsEnabled() ) + if ( !GetEnabled() ) flags |= wxCONTROL_DISABLED; // Notice that we intentionally don't use any alignment here: it is not From e292de4bb094478da84b45e497bcf2e0ac2781f2 Mon Sep 17 00:00:00 2001 From: donovan6000 Date: Mon, 25 Mar 2019 17:59:56 -0700 Subject: [PATCH 2/3] Disabling also checks if control is disabled --- src/common/datavcmn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 59bd6532f8..28cf44bccf 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1067,7 +1067,7 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, int flags = 0; if ( state & wxDATAVIEW_CELL_SELECTED ) flags |= wxCONTROL_SELECTED; - if ( !GetEnabled() ) + if ( !(GetOwner()->GetOwner()->IsEnabled() && GetEnabled()) ) flags |= wxCONTROL_DISABLED; // Notice that we intentionally don't use any alignment here: it is not From 7cd48f7db14c7a2413d7dc1e20645128003151b6 Mon Sep 17 00:00:00 2001 From: donovan6000 Date: Mon, 25 Mar 2019 18:02:41 -0700 Subject: [PATCH 3/3] Fixes how disabled wxDataViewToggle columns are displayed when control is disabled --- src/generic/datavgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 3883a51c07..968bbbbb5f 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1298,7 +1298,7 @@ bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state if (m_toggle) flags |= wxCONTROL_CHECKED; if (GetMode() != wxDATAVIEW_CELL_ACTIVATABLE || - GetEnabled() == false) + !(GetOwner()->GetOwner()->IsEnabled() && GetEnabled())) flags |= wxCONTROL_DISABLED; // Ensure that the check boxes always have at least the minimal required