Implement and document wxDataViewTreeCtrl::IsContainer(), use it in the sample to not add items to non-containers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1092,13 +1092,15 @@ void MyFrame::OnAddTreeItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
|
||||
wxDataViewItem selected = ctrl->GetSelection();
|
||||
ctrl->AppendItem( selected, "Item", 0 );
|
||||
if (ctrl->IsContainer(selected))
|
||||
ctrl->AppendItem( selected, "Item", 0 );
|
||||
}
|
||||
|
||||
void MyFrame::OnAddTreeContainerItem(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
|
||||
wxDataViewItem selected = ctrl->GetSelection();
|
||||
ctrl->AppendContainer(selected, "Container", 0 );
|
||||
if (ctrl->IsContainer(selected))
|
||||
ctrl->AppendContainer(selected, "Container", 0 );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user