]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dataview/mymodels.cpp
build a 2.9.x windows setup file and chm and htb sets of docs
[wxWidgets.git] / samples / dataview / mymodels.cpp
index 379c338bb07a0c20581ece7db5564f8ccc87f490..03c13cd35631618b9b199b646e948df181c932c2 100644 (file)
@@ -69,6 +69,15 @@ wxString MyMusicTreeModel::GetTitle( const wxDataViewItem &item ) const
     return node->m_title;
 }
 
+wxString MyMusicTreeModel::GetArtist( const wxDataViewItem &item ) const
+{
+    MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) item.GetID();
+    if (!node)      // happens if item.IsOk()==false
+        return wxEmptyString;
+
+    return node->m_artist;
+}
+
 int MyMusicTreeModel::GetYear( const wxDataViewItem &item ) const
 {
     MyMusicTreeModelNode *node = (MyMusicTreeModelNode*) item.GetID();
@@ -147,7 +156,7 @@ void MyMusicTreeModel::Delete( const wxDataViewItem &item )
 }
 
 int MyMusicTreeModel::Compare( const wxDataViewItem &item1, const wxDataViewItem &item2,
-                               unsigned int column, bool ascending )
+                               unsigned int column, bool ascending ) const
 {
     wxASSERT(item1.IsOk() && item2.IsOk());
         // should never happen