Add proper support for DataViewCheckIconTextRenderer

This commit is contained in:
Konstantin Bolshakov
2023-06-27 14:07:00 +02:00
parent f4db521a37
commit 1236562af5
2 changed files with 14 additions and 2 deletions

View File

@@ -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',

View File

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