#include "wx/wx.h"
#endif
-#include <wx/msw/wave.h>
-#include <wx/msw/joystick.h>
+#if !wxUSE_JOYSTICK
+#error You must set wxUSE_JOYSTICK to 1 in setup.h!
+#endif
+
+#include "wx/wave.h"
+#include "wx/joystick.h"
#include "joytest.h"
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();
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)
if (event.GetActive() && canvas)
canvas->SetFocus();
}
-
-bool MyFrame::OnClose(void)
-{
- return TRUE;
-}
\ No newline at end of file