Skip to content

Commit

Permalink
Add proper support for DataViewCheckIconTextRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinbo committed Jun 27, 2023
1 parent f4db521 commit 1236562
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions etg/dataview.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
'wxDataViewItem',
'wxDataViewItemAttr',
'wxDataViewIconText',
'wxDataViewCheckIconText',
'wxDataViewModelNotifier',

'wxDataViewModel',
Expand Down Expand Up @@ -308,6 +309,7 @@ def _fixupTypeParam(klass):
# them in all these classes
for name in [ 'wxDataViewTextRenderer',
'wxDataViewIconTextRenderer',
'wxDataViewCheckIconTextRenderer',
'wxDataViewProgressRenderer',
'wxDataViewSpinRenderer',
'wxDataViewToggleRenderer',
Expand Down
14 changes: 12 additions & 2 deletions src/dvcvariant.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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;
Expand Down

0 comments on commit 1236562

Please sign in to comment.