From: Francesco Montorsi Date: Mon, 23 Mar 2009 14:04:46 +0000 (+0000) Subject: add the ability to test the wxBell() function X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c8551c294dfc44a280bdea4f8f610d778341da22?hp=eaca1a91a53ac969adeaeff82e4740e85ee84edf add the ability to test the wxBell() function git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/sound/sound.cpp b/samples/sound/sound.cpp index 5b92e205eb..c82d84be90 100644 --- a/samples/sound/sound.cpp +++ b/samples/sound/sound.cpp @@ -73,6 +73,7 @@ public: void OnPlayAsyncOnStack(wxCommandEvent& event); void OnPlayLoop(wxCommandEvent& event); void OnStop(wxCommandEvent& event); + void OnPlayBell(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); @@ -114,6 +115,7 @@ enum Sound_PlayAsyncOnStack, Sound_PlayLoop, Sound_Stop, + Sound_PlayBell, Sound_Quit = wxID_EXIT, Sound_About = wxID_ABOUT @@ -139,6 +141,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(Sound_PlayAsyncOnStack, MyFrame::OnPlayAsyncOnStack) EVT_MENU(Sound_PlayLoop, MyFrame::OnPlayLoop) EVT_MENU(Sound_Stop, MyFrame::OnStop) + EVT_MENU(Sound_PlayBell, MyFrame::OnPlayBell) END_EVENT_TABLE() // Create a new application object: this macro will allow wxWidgets to create @@ -206,6 +209,8 @@ MyFrame::MyFrame(const wxString& title) playMenu->Append(Sound_PlayLoop, _T("&Loop sound\tCtrl-L")); playMenu->AppendSeparator(); playMenu->Append(Sound_Stop, _T("&Stop playing\tCtrl-T")); + playMenu->AppendSeparator(); + playMenu->Append(Sound_PlayBell, _T("Play system bell")); wxMenu *helpMenu = new wxMenu; helpMenu->Append(Sound_About, _T("&About...\tF1"), _T("Show about dialog")); @@ -1090,6 +1095,11 @@ void MyFrame::OnPlayLoop(wxCommandEvent& WXUNUSED(event)) m_sound->Play(wxSOUND_ASYNC | wxSOUND_LOOP); } +void MyFrame::OnPlayBell(wxCommandEvent& WXUNUSED(event)) +{ + wxBell(); +} + void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg;