X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aec18ff785687e1d0830da8cd287903128a994c6..f20a2e1f4066e4f0235698e6220f1eed91c73326:/samples/joytest/joytest.cpp diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index d1eac3e5ea..4d5be8b350 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// @@ -28,7 +28,7 @@ # error You must set wxUSE_STATUSBAR to 1 in setup.h #endif -#include "wx/wave.h" +#include "wx/sound.h" #include "wx/joystick.h" #include "joytest.h" @@ -49,38 +49,38 @@ bool MyApp::OnInit() wxJoystick stick(wxJOYSTICK1); if (!stick.IsOk()) { - wxMessageBox("No joystick detected!"); + wxMessageBox(_T("No joystick detected!")); return FALSE; } -#if wxUSE_WAVE - m_fire.Create("gun.wav"); -#endif // wxUSE_WAVE +#if wxUSE_SOUND + m_fire.Create(_T("gun.wav")); +#endif // wxUSE_SOUND m_maxX = stick.GetXMax(); m_maxY = stick.GetYMax(); // Create the main frame window - frame = new MyFrame(NULL, "Joystick Demo", wxDefaultPosition, + frame = new MyFrame(NULL, _T("Joystick Demo"), wxDefaultPosition, wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL); // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - frame->SetIcon(wxIcon("joyicon")); + frame->SetIcon(wxIcon(_T("joyicon"))); #endif #ifdef __X__ - frame->SetIcon(wxIcon("joyicon.xbm")); + frame->SetIcon(wxIcon(_T("joyicon.xbm"))); #endif // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(JOYTEST_QUIT, "&Exit"); + file_menu->Append(JOYTEST_QUIT, _T("&Exit")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -135,20 +135,20 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event) xpos = pt.x; ypos = pt.y; - char buf[100]; + wxString buf; if (event.ButtonDown()) - sprintf(buf, "Joystick (%d, %d) Fire!", pt.x, pt.y); + buf.Printf(_T("Joystick (%d, %d) Fire!"), pt.x, pt.y); else - sprintf(buf, "Joystick (%d, %d)", pt.x, pt.y); + buf.Printf(_T("Joystick (%d, %d)"), pt.x, pt.y); frame->SetStatusText(buf); -#if wxUSE_WAVE +#if wxUSE_SOUND if (event.ButtonDown() && wxGetApp().m_fire.IsOk()) { wxGetApp().m_fire.Play(); } -#endif // wxUSE_WAVE +#endif // wxUSE_SOUND } BEGIN_EVENT_TABLE(MyFrame, wxFrame) @@ -167,7 +167,7 @@ MyFrame::~MyFrame() // Empty } -void MyFrame::OnQuit(wxCommandEvent& event) +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); }