+// ----------------------------------------------------------------------------
+// MyFrame - event handlers for the fourth page
+// ----------------------------------------------------------------------------
+
+void MyFrame::OnDeleteTreeItem(wxCommandEvent& WXUNUSED(event))
+{
+ wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
+ wxDataViewItem selected = ctrl->GetSelection();
+ if (!selected.IsOk())
+ return;
+
+ ctrl->DeleteItem(selected);
+}
+
+void MyFrame::OnDeleteAllTreeItems(wxCommandEvent& WXUNUSED(event))
+{
+ wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
+ ctrl->DeleteAllItems();
+}
+
+void MyFrame::OnAddTreeItem(wxCommandEvent& WXUNUSED(event))
+{
+ wxDataViewTreeCtrl* ctrl = (wxDataViewTreeCtrl*) m_ctrl[3];
+ wxDataViewItem selected = ctrl->GetSelection();
+ 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();
+ if (ctrl->IsContainer(selected))
+ ctrl->AppendContainer(selected, "Container", 0 );
+}
+