}
else
{
+#if 0
+ // Why should we select the next row here???
SelectRow( row, false );
SelectRow( row + 1, true );
ChangeCurrentRow( row + 1 );
SendSelectionChangedEvent( GetItemByRow(row+1));
+#endif
}
}
else
if (IsVirtualList())
return;
- wxDataViewTreeNode * node = GetTreeNodeByRow(row);
- if( node != NULL )
+ wxDataViewTreeNode *node = GetTreeNodeByRow(row);
+ if (!node)
+ return;
+
+ if( !node->HasChildren())
{
- wxDataViewTreeNode * nd = node;
+ delete node;
+ return;
+ }
if( node->HasChildren() && node->IsOpen() )
{
m_count = -1;
UpdateDisplay();
- SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED,nd->GetItem());
+ SendExpanderEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED,node->GetItem());
}
else
{
}
}
}
- if( !nd->HasChildren())
- delete nd;
- }
}
wxDataViewTreeNode * wxDataViewMainWindow::FindNode( const wxDataViewItem & item )
void wxDataViewCtrl::Collapse( const wxDataViewItem & item )
{
int row = m_clientArea->GetRowByItem( item );
+ wxPrintf( "row %d\n", row );
if (row != -1)
m_clientArea->Collapse(row);
}