Add a possibility to beep on no match to wxGenericTreeCtrl.

For consistency with Windows, allow to optionally generate a beep when
incremental search in the tree control doesn't find anything.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72638 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-10-07 22:42:02 +00:00
parent e0dec8753a
commit 27bc919446
7 changed files with 68 additions and 2 deletions

View File

@@ -113,6 +113,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
MENU_LINK(Recreate)
MENU_LINK(ToggleImages)
MENU_LINK(ToggleStates)
MENU_LINK(ToggleBell)
MENU_LINK(ToggleAlternateImages)
MENU_LINK(ToggleAlternateStates)
MENU_LINK(ToggleButtons)
@@ -247,6 +248,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
#endif // NO_MULTIPLE_SELECTION
style_menu->AppendCheckItem(TreeTest_ToggleImages, wxT("Toggle show ima&ges"));
style_menu->AppendCheckItem(TreeTest_ToggleStates, wxT("Toggle show st&ates"));
style_menu->AppendCheckItem(TreeTest_ToggleBell, wxT("Toggle &bell on no match"));
style_menu->AppendCheckItem(TreeTest_ToggleAlternateImages, wxT("Toggle alternate images"));
style_menu->AppendCheckItem(TreeTest_ToggleAlternateStates, wxT("Toggle alternate state images"));
style_menu->Append(TreeTest_SetImageSize, wxT("Set image si&ze..."));
@@ -705,6 +707,11 @@ void MyFrame::OnToggleStates(wxCommandEvent& WXUNUSED(event))
}
}
void MyFrame::OnToggleBell(wxCommandEvent& event)
{
m_treeCtrl->EnableBellOnNoMatch(event.IsChecked());
}
void MyFrame::OnToggleAlternateImages(wxCommandEvent& WXUNUSED(event))
{
bool alternateImages = m_treeCtrl->AlternateImages();