]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dataview.cpp
remove also wxT(); it's confusing, too; do load wxstd.mo catalog after calling wxLoca...
[wxWidgets.git] / src / gtk / dataview.cpp
index dc998edd3380305c95b7f9df66698452e4e3b276..297f4968014afb9e3f4248fcaf151a3d7fc51731 100644 (file)
@@ -4113,12 +4113,23 @@ void wxDataViewCtrl::SetSelections( const wxDataViewItemArray & sel )
 
     gtk_tree_selection_unselect_all( selection );
 
+    wxDataViewItem last_parent;
+
     size_t i;
     for (i = 0; i < sel.GetCount(); i++)
     {
+        wxDataViewItem item = sel[i];
+        wxDataViewItem parent = GetModel()->GetParent( item );
+        if (parent)
+        {
+            if (parent != last_parent)
+                ExpandAncestors(item);
+        }
+        last_parent = parent;
+
         GtkTreeIter iter;
         iter.stamp = m_internal->GetGtkModel()->stamp;
-        iter.user_data = (gpointer) sel[i].GetID();
+        iter.user_data = (gpointer) item.GetID();
         gtk_tree_selection_select_iter( selection, &iter );
     }
 
@@ -4127,6 +4138,8 @@ void wxDataViewCtrl::SetSelections( const wxDataViewItemArray & sel )
 
 void wxDataViewCtrl::Select( const wxDataViewItem & item )
 {
+    ExpandAncestors(item);
+
     GtkDisableSelectionEvents();
 
     GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) );
@@ -4189,6 +4202,8 @@ void wxDataViewCtrl::UnselectAll()
 void wxDataViewCtrl::EnsureVisible(const wxDataViewItem& item,
                                    const wxDataViewColumn *WXUNUSED(column))
 {
+    ExpandAncestors(item);
+
     GtkTreeIter iter;
     iter.user_data = (gpointer) item.GetID();
     GtkTreePath *path = m_internal->get_path( &iter );