From 1236562af55be1d8064d851e58dd1db3699040de Mon Sep 17 00:00:00 2001 From: Konstantin Bolshakov Date: Tue, 27 Jun 2023 14:07:00 +0200 Subject: [PATCH] Add proper support for DataViewCheckIconTextRenderer --- etg/dataview.py | 2 ++ src/dvcvariant.sip | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/etg/dataview.py b/etg/dataview.py index fdfb4e1a..f817eba1 100644 --- a/etg/dataview.py +++ b/etg/dataview.py @@ -24,6 +24,7 @@ ITEMS = [ 'wxDataViewItem', 'wxDataViewItemAttr', 'wxDataViewIconText', + 'wxDataViewCheckIconText', 'wxDataViewModelNotifier', 'wxDataViewModel', @@ -308,6 +309,7 @@ def run(): # them in all these classes for name in [ 'wxDataViewTextRenderer', 'wxDataViewIconTextRenderer', + 'wxDataViewCheckIconTextRenderer', 'wxDataViewProgressRenderer', 'wxDataViewSpinRenderer', 'wxDataViewToggleRenderer', diff --git a/src/dvcvariant.sip b/src/dvcvariant.sip index 3df51b16..767c09c1 100644 --- a/src/dvcvariant.sip +++ b/src/dvcvariant.sip @@ -31,6 +31,11 @@ wxVariant wxDVCVariant_in_helper(PyObject* source) if (source == Py_None) { ret.MakeNull(); } + else if (wxPyWrappedPtr_TypeCheck(source, wxT("wxDataViewCheckIconText"))) { + wxDataViewCheckIconText* ptr; + wxPyConvertWrappedPtr(source, (void**)&ptr, wxT("wxDataViewCheckIconText")); + ret << *ptr; + } else if (wxPyWrappedPtr_TypeCheck(source, wxT("wxDataViewIconText"))) { wxDataViewIconText* ptr; wxPyConvertWrappedPtr(source, (void**)&ptr, wxT("wxDataViewIconText")); @@ -45,8 +50,13 @@ wxVariant wxDVCVariant_in_helper(PyObject* source) PyObject* wxDVCVariant_out_helper(const wxVariant& value) { PyObject* ret; - - if ( value.IsType("wxDataViewIconText") ) + if (value.IsType("wxDataViewCheckIconText") ) + { + wxDataViewCheckIconText val; + val << value; + ret = wxPyConstructObject(new wxDataViewCheckIconText(val), wxT("wxDataViewCheckIconText"), 0); + } + else if ( value.IsType("wxDataViewIconText") ) { wxDataViewIconText val; val << value;