joytest.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: joytest.cpp
  3. // Purpose: Joystick sample
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 04/01/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. // Define a new application
  11. class MyApp: public wxApp
  12. {
  13. public:
  14. bool OnInit();
  15. // Joystick max values
  16. int m_minX;
  17. int m_minY;
  18. int m_maxX;
  19. int m_maxY;
  20. #if wxUSE_SOUND
  21. wxSound m_fire;
  22. #endif // wxUSE_SOUND
  23. };
  24. DECLARE_APP(MyApp)
  25. class MyCanvas: public wxScrolledWindow
  26. {
  27. public:
  28. MyCanvas(wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
  29. ~MyCanvas();
  30. void OnJoystickEvent(wxJoystickEvent& event);
  31. wxJoystick* m_stick;
  32. wxDECLARE_EVENT_TABLE();
  33. };
  34. class MyFrame: public wxFrame
  35. {
  36. public:
  37. MyCanvas *canvas;
  38. MyFrame(wxFrame *parent, const wxString& title,
  39. const wxPoint& pos, const wxSize& size, const long style);
  40. ~MyFrame(){};
  41. void OnActivate(wxActivateEvent& event);
  42. void OnQuit(wxCommandEvent& event);
  43. DECLARE_EVENT_TABLE()
  44. };
  45. #define JOYTEST_QUIT 1