Correct wxDataViewCtrl::IsExpanded and add test for it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-12-17 22:26:40 +00:00
parent 5a9379d7b0
commit 10ab6d4f65
3 changed files with 13 additions and 3 deletions

View File

@@ -1026,6 +1026,9 @@ void MyFrame::OnActivated( wxDataViewEvent &event )
wxString title = m_music_model->GetTitle( event.GetItem() ); wxString title = m_music_model->GetTitle( event.GetItem() );
wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, Item: %s"), title ); wxLogMessage(wxT("wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, Item: %s"), title );
if (m_musicCtrl->IsExpanded( event.GetItem() ))
wxLogMessage(wxT("Item: %s is expanded"), title );
} }
void MyFrame::OnSelectionChanged( wxDataViewEvent &event ) void MyFrame::OnSelectionChanged( wxDataViewEvent &event )

View File

@@ -4018,8 +4018,10 @@ bool wxDataViewCtrl::IsExpanded( const wxDataViewItem & item ) const
GtkTreeIter iter; GtkTreeIter iter;
iter.user_data = item.GetID(); iter.user_data = item.GetID();
GtkTreePath *path = m_internal->get_path( &iter ); GtkTreePath *path = m_internal->get_path( &iter );
gtk_tree_view_row_expanded( GTK_TREE_VIEW(m_treeview), path ); bool res = gtk_tree_view_row_expanded( GTK_TREE_VIEW(m_treeview), path );
gtk_tree_path_free( path ); gtk_tree_path_free( path );
return res;
} }
wxDataViewItem wxDataViewCtrl::GetSelection() const wxDataViewItem wxDataViewCtrl::GetSelection() const

View File

@@ -1210,8 +1210,13 @@ bool wxDataViewCtrl::IsExpanded( const wxDataViewItem & item ) const
{ {
wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer)); wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
// TODO ??? DataBrowserItemState state = 0;
// This doesn't seem to be supported OSStatus err = ::GetDataBrowserItemState(
MacDataViewListCtrlPtr->GetControlRef(),
reinterpret_cast<DataBrowserItemID>(item.GetID()),
&state );
if ((err == 0) && (state & kDataBrowserContainerIsOpen))
return true;
} }
return false; return false;
} }