X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/10ab6d4f65ce90afb61986f0f1e609cd5d4cbc0c..7256e9b6ad4bc899d7c4d1d70e7afc93965200f1:/src/gtk/dataview.cpp diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index dc998edd33..297f496801 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -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 );