X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f4987fed4dc52a35f0ddd649ae1cf9e75bb92d3..d062e17fca1a1fc0b82b269da4a7ad271075ba2b:/samples/joytest/joytest.cpp?ds=sidebyside diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index 92add26604..5fe4889958 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -20,8 +20,8 @@ #include "wx/wx.h" #endif -#include -#include +#include +#include #include "joytest.h" @@ -44,7 +44,9 @@ bool MyApp::OnInit(void) wxMessageBox("No joystick detected!"); return FALSE; } +#if wxUSE_WAVE m_fire.Create("gun.wav"); +#endif // wxUSE_WAVE m_maxX = stick.GetXMax(); m_maxY = stick.GetYMax(); @@ -128,15 +130,17 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event) char buf[100]; if (event.ButtonDown()) - sprintf(buf, "Joystick (%ld, %ld) Fire!", pt.x, pt.y); + sprintf(buf, "Joystick (%d, %d) Fire!", pt.x, pt.y); else - sprintf(buf, "Joystick (%ld, %ld)", pt.x, pt.y); + sprintf(buf, "Joystick (%d, %d)", pt.x, pt.y); frame->SetStatusText(buf); +#if wxUSE_WAVE if (event.ButtonDown() && wxGetApp().m_fire.IsOk()) { wxGetApp().m_fire.Play(); } +#endif // wxUSE_WAVE } BEGIN_EVENT_TABLE(MyFrame, wxFrame) @@ -164,8 +168,3 @@ void MyFrame::OnActivate(wxActivateEvent& event) if (event.GetActive() && canvas) canvas->SetFocus(); } - -bool MyFrame::OnClose(void) -{ - return TRUE; -} \ No newline at end of file