From dc631754fcf1cf679aa0fcf9f4d74c59459b46ae Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 12 Feb 2004 16:35:36 +0000 Subject: [PATCH] added Select() test git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/treectrl/treetest.cpp | 7 +++++++ samples/treectrl/treetest.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 13ba5b3b37..53c0c887bc 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -112,6 +112,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) MENU_LINK(IncSpacing) MENU_LINK(DecSpacing) MENU_LINK(ToggleIcon) + MENU_LINK(SelectRoot) #undef MENU_LINK END_EVENT_TABLE() @@ -213,6 +214,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")); @@ -465,6 +467,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(); diff --git a/samples/treectrl/treetest.h b/samples/treectrl/treetest.h index c9f8975eed..de2e09acb1 100644 --- a/samples/treectrl/treetest.h +++ b/samples/treectrl/treetest.h @@ -179,6 +179,7 @@ public: void OnUnselect(wxCommandEvent& event); void OnToggleSel(wxCommandEvent& event); #endif // NO_MULTIPLE_SELECTION + void OnSelectRoot(wxCommandEvent& event); void OnDelete(wxCommandEvent& event); void OnDeleteChildren(wxCommandEvent& event); void OnDeleteAll(wxCommandEvent& event); @@ -277,5 +278,6 @@ enum TreeTest_ToggleIcon, TreeTest_Select, TreeTest_Unselect, + TreeTest_SelectRoot, TreeTest_Ctrl = 1000 }; -- 2.47.2