X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4a8a172020d5e3ee08660420142e702799c7878..f20a2e1f4066e4f0235698e6220f1eed91c73326:/samples/treectrl/treetest.cpp?ds=sidebyside diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 270161f9ca..4d60c4be87 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -27,6 +27,7 @@ #endif #include "wx/colordlg.h" +#include "wx/numdlg.h" #include "wx/image.h" #include "wx/imaglist.h" @@ -46,7 +47,10 @@ #include "icon3.xpm" #include "icon4.xpm" #include "icon5.xpm" + +#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) #include "mondrian.xpm" +#endif // verify that the item is ok and insult the user if it is not @@ -109,6 +113,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) MENU_LINK(IncSpacing) MENU_LINK(DecSpacing) MENU_LINK(ToggleIcon) + MENU_LINK(SelectRoot) #undef MENU_LINK END_EVENT_TABLE() @@ -210,6 +215,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h) tree_menu->Append(TreeTest_Delete, wxT("&Delete this item")); tree_menu->Append(TreeTest_DeleteChildren, wxT("Delete &children")); tree_menu->Append(TreeTest_DeleteAll, wxT("Delete &all items")); + tree_menu->Append(TreeTest_SelectRoot, wxT("Select root item")); tree_menu->AppendSeparator(); tree_menu->Append(TreeTest_Count, wxT("Count children of current item")); tree_menu->Append(TreeTest_CountRec, wxT("Recursively count children of current item")); @@ -462,6 +468,11 @@ void MyFrame::OnSelect(wxCommandEvent& WXUNUSED(event)) m_treeCtrl->SelectItem(m_treeCtrl->GetSelection()); } +void MyFrame::OnSelectRoot(wxCommandEvent& WXUNUSED(event)) +{ + m_treeCtrl->SelectItem(m_treeCtrl->GetRootItem()); +} + void MyFrame::OnUnselect(wxCommandEvent& WXUNUSED(event)) { m_treeCtrl->UnselectAll();