+void MyFrame::DoShowFirstOrLast(TreeFunc0_t pfn, const wxString& label)
+{
+ const wxTreeItemId item = (m_treeCtrl->*pfn)();
+
+ if ( !item.IsOk() )
+ wxLogMessage("There is no %s item", label);
+ else
+ wxLogMessage("The %s item is \"%s\"",
+ label, m_treeCtrl->GetItemText(item));
+}
+
+void MyFrame::DoShowNextOrPrev(TreeFunc1_t pfn, const wxString& label)
+{
+ wxTreeItemId item = m_treeCtrl->GetSelection();
+
+ CHECK_ITEM( item );
+
+ if ( !m_treeCtrl->IsVisible(item) )
+ {
+ wxLogMessage("The selected item must be visible.");
+ return;
+ }
+
+ item = (m_treeCtrl->*pfn)(item);
+
+ if ( !item.IsOk() )
+ wxLogMessage("There is no %s item", label);
+ else
+ wxLogMessage("The %s item is \"%s\"",
+ label, m_treeCtrl->GetItemText(item));
+}
+