added Select() test

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-02-12 16:35:36 +00:00
parent 5e7718a281
commit dc631754fc
2 changed files with 9 additions and 0 deletions

View File

@ -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();

View File

@ -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
};