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