diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index 665a979190..c05cb346b4 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -387,6 +387,10 @@ public: unsigned col, bool ascending) const wxOVERRIDE; +protected: + virtual int DoCompareValues(const wxVariant& value1, + const wxVariant& value2) const wxOVERRIDE; + private: // The control we're associated with. wxTreeListCtrl* const m_treelist; @@ -1007,6 +1011,22 @@ wxTreeListModel::Compare(const wxDataViewItem& item1, return result; } +int wxTreeListModel::DoCompareValues(const wxVariant& value1, + const wxVariant& value2) const +{ + if ( value1.GetType() == wxS("wxDataViewCheckIconText") ) + { + wxDataViewCheckIconText iconText1, iconText2; + + iconText1 << value1; + iconText2 << value2; + + return iconText1.GetText().Cmp(iconText2.GetText()); + } + + return wxDataViewModel::DoCompareValues(value1, value2); +} + // ============================================================================ // wxTreeListCtrl implementation // ============================================================================