1998-05-20 10:21:00 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: joytest.cpp
|
|
|
|
// Purpose: Joystick sample
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04/01/98
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 06:55:54 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2002-03-17 09:16:03 -05:00
|
|
|
// Licence: wxWindows license
|
1998-05-20 10:21:00 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Define a new application
|
|
|
|
class MyApp: public wxApp
|
|
|
|
{
|
2002-08-01 15:12:24 -04:00
|
|
|
public:
|
|
|
|
bool OnInit();
|
1998-05-20 10:21:00 -04:00
|
|
|
|
|
|
|
// Joystick max values
|
|
|
|
int m_maxX;
|
|
|
|
int m_maxY;
|
|
|
|
|
2004-02-02 08:03:23 -05:00
|
|
|
#if wxUSE_SOUND
|
|
|
|
wxSound m_fire;
|
|
|
|
#endif // wxUSE_SOUND
|
1998-05-20 10:21:00 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_APP(MyApp)
|
|
|
|
|
|
|
|
class MyCanvas: public wxScrolledWindow
|
|
|
|
{
|
2002-08-01 15:12:24 -04:00
|
|
|
public:
|
1998-05-20 10:21:00 -04:00
|
|
|
MyCanvas(wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
|
2002-08-01 15:12:24 -04:00
|
|
|
~MyCanvas();
|
1998-05-20 10:21:00 -04:00
|
|
|
void OnJoystickEvent(wxJoystickEvent& event);
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
class MyFrame: public wxFrame
|
|
|
|
{
|
2002-08-01 15:12:24 -04:00
|
|
|
public:
|
1998-05-20 10:21:00 -04:00
|
|
|
MyCanvas *canvas;
|
2002-08-01 15:12:24 -04:00
|
|
|
MyFrame(wxFrame *parent, const wxString& title,
|
|
|
|
const wxPoint& pos, const wxSize& size, const long style);
|
|
|
|
~MyFrame();
|
1998-05-20 10:21:00 -04:00
|
|
|
void OnActivate(wxActivateEvent& event);
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
#define JOYTEST_QUIT 1
|