From: Robin Dunn Date: Sun, 20 May 2001 01:18:39 +0000 (+0000) Subject: Added sample to the demo for wxJoystick X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ac346f50461692f40d98ead8d6817ec8a668f915 Added sample to the demo for wxJoystick git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 7a3f854310..1ba205d7b5 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -24,6 +24,7 @@ import images _treeList = [ ('New since last release', ['ColourSelect', 'ImageBrowser', 'infoframe', 'ColourDB', 'wxToggleButton', 'OOR', 'wxWave', + 'wxJoystick', ]), ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']), @@ -54,6 +55,7 @@ _treeList = [ 'PythonEvents', 'Threads', 'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE', 'wxDragImage', "wxProcess", "FancyText", "OOR", "wxWave", + 'wxJoystick', ]), ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog', diff --git a/wxPython/demo/joystick.wdr b/wxPython/demo/joystick.wdr new file mode 100644 index 0000000000..41a2a07579 Binary files /dev/null and b/wxPython/demo/joystick.wdr differ diff --git a/wxPython/demo/joystick_wdr.py b/wxPython/demo/joystick_wdr.py new file mode 100644 index 0000000000..8595b096e5 --- /dev/null +++ b/wxPython/demo/joystick_wdr.py @@ -0,0 +1,306 @@ +#!/usr/env python +#----------------------------------------------------------------------------- +# Python source generated by wxDesigner from file: joystick.wdr +# Do not modify this file, all changes will be lost! +#----------------------------------------------------------------------------- + +# Include wxWindows' modules +from wxPython.wx import * + +# Window functions + +ID_TEXT = 10000 +ID_X_Position_Ctrl = 10001 +ID_Y_Position_Ctrl = 10002 +ID_Z_Position_Ctrl = 10003 +ID_Button_State_Ctrl = 10004 +ID_POV_Position_Ctrl = 10005 +ID_POV_CTS_Pos_Ctrl = 10006 +ID_Rudder_Pos_Ctrl = 10007 +ID_U_Position_Ctrl = 10008 +ID_V_Position_Ctrl = 10009 +ID_Has_Rudder_Ctrl = 10010 +ID_Has_Z_Ctrl = 10011 +ID_Has_U_Ctrl = 10012 +ID_Has_V_Ctrl = 10013 +ID_Has_POV_Ctrl = 10014 +ID_Has_POV_4DIR_Ctrl = 10015 +ID_Has_POV_CTS_Ctrl = 10016 +ID_Num_Sticks_Ctrl = 10017 +ID_Mfg_ID_Ctrl = 10018 +ID_Prod_Name_Ctrl = 10019 +ID_X_Min_Ctrl = 10020 +ID_Y_Min_Ctrl = 10021 +ID_Z_Min_Ctrl = 10022 +ID_X_Max_Ctrl = 10023 +ID_Y_Max_Ctrl = 10024 +ID_Z_Max_Ctrl = 10025 +ID_Num_Buttons_Ctrl = 10026 +ID_Num_Axes_Ctrl = 10027 +ID_Max_Buttons_Ctrl = 10028 +ID_Max_Axes_Ctrl = 10029 +ID_Polling_Min_Ctrl = 10030 +ID_Polling_Max_Ctrl = 10031 +ID_Rudder_Min_Ctrl = 10032 +ID_Rudder_Max_Ctrl = 10033 +ID_U_Min_Ctrl = 10034 +ID_U_Max_Ctrl = 10035 +ID_V_Min_Ctrl = 10036 +ID_V_Max_Ctrl = 10037 + +def MakeJoystickTestPanel( parent, call_fit = true, set_sizer = true ): + item0 = wxBoxSizer( wxVERTICAL ) + + item1 = wxFlexGridSizer( 0, 8, 0, 0 ) + + item2 = wxStaticText( parent, ID_TEXT, "X Position:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item2, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item3 = wxTextCtrl( parent, ID_X_Position_Ctrl, "", wxDefaultPosition, wxSize(45,-1), wxTE_READONLY ) + item1.AddWindow( item3, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item4 = wxStaticText( parent, ID_TEXT, "Y Position:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item5 = wxTextCtrl( parent, ID_Y_Position_Ctrl, "", wxDefaultPosition, wxSize(45,-1), wxTE_READONLY ) + item1.AddWindow( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item6 = wxStaticText( parent, ID_TEXT, "Z Position:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item7 = wxTextCtrl( parent, ID_Z_Position_Ctrl, "", wxDefaultPosition, wxSize(45,-1), wxTE_READONLY ) + item1.AddWindow( item7, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item8 = wxStaticText( parent, ID_TEXT, "Button State:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item9 = wxTextCtrl( parent, ID_Button_State_Ctrl, "", wxDefaultPosition, wxSize(45,-1), wxTE_READONLY ) + item1.AddWindow( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item10 = wxStaticText( parent, ID_TEXT, "POV Position:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item11 = wxTextCtrl( parent, ID_POV_Position_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item11, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item12 = wxStaticText( parent, ID_TEXT, "POV CTS Pos:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item12, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item13 = wxTextCtrl( parent, ID_POV_CTS_Pos_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item13, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item14 = wxStaticText( parent, ID_TEXT, "Rudder Pos:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item14, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item15 = wxTextCtrl( parent, ID_Rudder_Pos_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item15, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item16 = wxStaticText( parent, ID_TEXT, "U Position:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item16, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item17 = wxTextCtrl( parent, ID_U_Position_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item18 = wxStaticText( parent, ID_TEXT, "V Position:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item18, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item19 = wxTextCtrl( parent, ID_V_Position_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item19, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item1.AddSpacer( 20, 10, 0, wxALIGN_CENTRE, 5 ) + + item1.AddSpacer( 20, 10, 0, wxALIGN_CENTRE, 5 ) + + item1.AddSpacer( 20, 10, 0, wxALIGN_CENTRE, 5 ) + + item1.AddSpacer( 20, 10, 0, wxALIGN_CENTRE, 5 ) + + item1.AddSpacer( 20, 10, 0, wxALIGN_CENTRE, 5 ) + + item1.AddSpacer( 20, 10, 0, wxALIGN_CENTRE, 5 ) + + item20 = wxStaticText( parent, ID_TEXT, "HasRudder:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item20, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item21 = wxTextCtrl( parent, ID_Has_Rudder_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item21, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item22 = wxStaticText( parent, ID_TEXT, "HasZ:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item22, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item23 = wxTextCtrl( parent, ID_Has_Z_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item23, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item24 = wxStaticText( parent, ID_TEXT, "HasU:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item24, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item25 = wxTextCtrl( parent, ID_Has_U_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item25, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item26 = wxStaticText( parent, ID_TEXT, "HasV:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item26, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item27 = wxTextCtrl( parent, ID_Has_V_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item28 = wxStaticText( parent, ID_TEXT, "HasPOV:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item28, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item29 = wxTextCtrl( parent, ID_Has_POV_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item29, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item30 = wxStaticText( parent, ID_TEXT, "HasPOV4Dir:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item30, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item31 = wxTextCtrl( parent, ID_Has_POV_4DIR_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item31, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item32 = wxStaticText( parent, ID_TEXT, "HasPOVCTS:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item32, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item33 = wxTextCtrl( parent, ID_Has_POV_CTS_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item33, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item34 = wxStaticText( parent, ID_TEXT, "# Joysticks:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item34, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item35 = wxTextCtrl( parent, ID_Num_Sticks_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item35, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item36 = wxStaticText( parent, ID_TEXT, "Mfg ID:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item36, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item37 = wxTextCtrl( parent, ID_Mfg_ID_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item37, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item38 = wxStaticText( parent, ID_TEXT, "Prod Name:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item38, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item39 = wxTextCtrl( parent, ID_Prod_Name_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item39, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item40 = wxStaticText( parent, ID_TEXT, "X Min:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item40, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item41 = wxTextCtrl( parent, ID_X_Min_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item41, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item42 = wxStaticText( parent, ID_TEXT, "Y Min:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item42, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item43 = wxTextCtrl( parent, ID_Y_Min_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item43, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item44 = wxStaticText( parent, ID_TEXT, "Z Min:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item44, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item45 = wxTextCtrl( parent, ID_Z_Min_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item45, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item46 = wxStaticText( parent, ID_TEXT, "X Max:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item46, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item47 = wxTextCtrl( parent, ID_X_Max_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item47, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item48 = wxStaticText( parent, ID_TEXT, "Y Max:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item48, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item49 = wxTextCtrl( parent, ID_Y_Max_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item49, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item50 = wxStaticText( parent, ID_TEXT, "Z Max", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item50, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item51 = wxTextCtrl( parent, ID_Z_Max_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item51, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item52 = wxStaticText( parent, ID_TEXT, "# Buttons:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item52, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item53 = wxTextCtrl( parent, ID_Num_Buttons_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item53, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item54 = wxStaticText( parent, ID_TEXT, "Num Axes:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item54, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item55 = wxTextCtrl( parent, ID_Num_Axes_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item55, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item56 = wxStaticText( parent, ID_TEXT, "Max Buttons:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item56, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item57 = wxTextCtrl( parent, ID_Max_Buttons_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item57, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item58 = wxStaticText( parent, ID_TEXT, "Max Axes:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item58, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item59 = wxTextCtrl( parent, ID_Max_Axes_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item59, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item60 = wxStaticText( parent, ID_TEXT, "Polling Min:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item60, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item61 = wxTextCtrl( parent, ID_Polling_Min_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item61, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item62 = wxStaticText( parent, ID_TEXT, "Polling Max:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item62, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item63 = wxTextCtrl( parent, ID_Polling_Max_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item63, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item64 = wxStaticText( parent, ID_TEXT, "Rudder Min:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item64, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item65 = wxTextCtrl( parent, ID_Rudder_Min_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item65, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item66 = wxStaticText( parent, ID_TEXT, "Rudder Max:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item66, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item67 = wxTextCtrl( parent, ID_Rudder_Max_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item67, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item68 = wxStaticText( parent, ID_TEXT, "U Min:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item68, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item69 = wxTextCtrl( parent, ID_U_Min_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item69, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item70 = wxStaticText( parent, ID_TEXT, "U Max:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item70, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item71 = wxTextCtrl( parent, ID_U_Max_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item71, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item72 = wxStaticText( parent, ID_TEXT, "V Min:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item72, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item73 = wxTextCtrl( parent, ID_V_Min_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item73, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item74 = wxStaticText( parent, ID_TEXT, "V Max:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ) + item1.AddWindow( item74, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 5 ) + + item75 = wxTextCtrl( parent, ID_V_Max_Ctrl, "", wxDefaultPosition, wxSize(35,-1), wxTE_READONLY ) + item1.AddWindow( item75, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5 ) + + item0.AddSizer( item1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 15 ) + + if set_sizer == true: + parent.SetAutoLayout( true ) + parent.SetSizer( item0 ) + if call_fit == true: + item0.Fit( parent ) + item0.SetSizeHints( parent ) + + return item0 + +# Menu bar functions + +# Bitmap functions + + +# End of generated file diff --git a/wxPython/demo/wxJoystick.py b/wxPython/demo/wxJoystick.py new file mode 100644 index 0000000000..df61d1db1a --- /dev/null +++ b/wxPython/demo/wxJoystick.py @@ -0,0 +1,193 @@ + +#---------------------------------------------------------------------------- + +from wxPython.wx import * +from joystick_wdr import * + + +class JoystickTestPanel(wxPanel): + def __init__(self, parent, id, + pos = wxPyDefaultPosition, size = wxPyDefaultSize, + style = wxTAB_TRAVERSAL ): + wxPanel.__init__(self, parent, id, pos, size, style) + + MakeJoystickTestPanel( self, true ) + + self.stick = wxJoystick() + self.stick.SetCapture(self) + EVT_JOYSTICK_EVENTS(self, self.OnJoystick) + + + def UpdateFields(self): + s = self.stick + self.GetXPositionCtrl().SetValue(str(s.GetPosition().x)) + self.GetYPositionCtrl().SetValue(str(s.GetPosition().y)) + self.GetZPositionCtrl().SetValue(str(s.GetZPosition())) + self.GetPovCtsPosCtrl().SetValue(str(s.GetPOVPosition())) + self.GetRudderPosCtrl().SetValue(str(s.GetRudderPosition())) + self.GetHasRudderCtrl().SetValue(str(s.HasRudder())) + self.GetHasZCtrl().SetValue(str(s.HasZ())) + self.GetHasPovCtrl().SetValue(str(s.HasPOV())) + self.GetHasPov4dirCtrl().SetValue(str(s.HasPOV4Dir())) + self.GetMfgIdCtrl().SetValue(str(s.GetManufacturerId())) + self.GetProdNameCtrl().SetValue(str(s.GetProductName())) + self.GetZMinCtrl().SetValue(str(s.GetZMin())) + self.GetXMaxCtrl().SetValue(str(s.GetXMax())) + self.GetNumButtonsCtrl().SetValue(str(s.GetNumberButtons())) + self.GetNumAxesCtrl().SetValue(str(s.GetNumberAxes())) + self.GetPollingMinCtrl().SetValue(str(s.GetPollingMin())) + self.GetPollingMaxCtrl().SetValue(str(s.GetPollingMax())) + self.GetUMinCtrl().SetValue(str(s.GetUMin())) + self.GetUMaxCtrl().SetValue(str(s.GetUMax())) + self.GetButtonStateCtrl().SetValue(str(s.GetButtonState())) + self.GetPovPositionCtrl().SetValue(str(s.GetPOVPosition())) + self.GetUPositionCtrl().SetValue(str(s.GetUPosition())) + self.GetVPositionCtrl().SetValue(str(s.GetVPosition())) + self.GetHasUCtrl().SetValue(str(s.HasU())) + self.GetHasVCtrl().SetValue(str(s.HasV())) + self.GetHasPovCtsCtrl().SetValue(str(s.HasPOVCTS())) + self.GetNumSticksCtrl().SetValue(str(s.GetNumberJoysticks())) + self.GetXMinCtrl().SetValue(str(s.GetXMin())) + self.GetYMinCtrl().SetValue(str(s.GetYMin())) + self.GetYMaxCtrl().SetValue(str(s.GetYMax())) + self.GetZMaxCtrl().SetValue(str(s.GetZMax())) + self.GetMaxButtonsCtrl().SetValue(str(s.GetMaxButtons())) + self.GetMaxAxesCtrl().SetValue(str(s.GetMaxAxes())) + self.GetRudderMinCtrl().SetValue(str(s.GetRudderMin())) + self.GetRudderMaxCtrl().SetValue(str(s.GetRudderMax())) + self.GetVMinCtrl().SetValue(str(s.GetVMin())) + self.GetVMaxCtrl().SetValue(str(s.GetVMax())) + + + def OnJoystick(self, evt): + self.UpdateFields() + + + # WDR: methods for JoystickTestPanel + + def GetYPositionCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Y_Position_Ctrl), "wxTextCtrl" ) + + def GetXPositionCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_X_Position_Ctrl), "wxTextCtrl" ) + + + def GetVMaxCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_V_Max_Ctrl), "wxTextCtrl" ) + + def GetVMinCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_V_Min_Ctrl), "wxTextCtrl" ) + + def GetRudderMaxCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Rudder_Max_Ctrl), "wxTextCtrl" ) + + def GetRudderMinCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Rudder_Min_Ctrl), "wxTextCtrl" ) + + def GetMaxAxesCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Max_Axes_Ctrl), "wxTextCtrl" ) + + def GetMaxButtonsCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Max_Buttons_Ctrl), "wxTextCtrl" ) + + def GetZMaxCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Z_Max_Ctrl), "wxTextCtrl" ) + + def GetYMaxCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Y_Max_Ctrl), "wxTextCtrl" ) + + def GetYMinCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Y_Min_Ctrl), "wxTextCtrl" ) + + def GetXMinCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_X_Min_Ctrl), "wxTextCtrl" ) + + def GetNumSticksCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Num_Sticks_Ctrl), "wxTextCtrl" ) + + def GetHasPovCtsCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Has_POV_CTS_Ctrl), "wxTextCtrl" ) + + def GetHasVCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Has_V_Ctrl), "wxTextCtrl" ) + + def GetHasUCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Has_U_Ctrl), "wxTextCtrl" ) + + def GetVPositionCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_V_Position_Ctrl), "wxTextCtrl" ) + + def GetUPositionCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_U_Position_Ctrl), "wxTextCtrl" ) + + def GetPovPositionCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_POV_Position_Ctrl), "wxTextCtrl" ) + + def GetButtonStateCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Button_State_Ctrl), "wxTextCtrl" ) + + def GetUMaxCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_U_Max_Ctrl), "wxTextCtrl" ) + + def GetUMinCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_U_Min_Ctrl), "wxTextCtrl" ) + + def GetPollingMaxCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Polling_Max_Ctrl), "wxTextCtrl" ) + + def GetPollingMinCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Polling_Min_Ctrl), "wxTextCtrl" ) + + def GetNumAxesCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Num_Axes_Ctrl), "wxTextCtrl" ) + + def GetNumButtonsCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Num_Buttons_Ctrl), "wxTextCtrl" ) + + def GetXMaxCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_X_Max_Ctrl), "wxTextCtrl" ) + + def GetZMinCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Z_Min_Ctrl), "wxTextCtrl" ) + + def GetProdNameCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Prod_Name_Ctrl), "wxTextCtrl" ) + + def GetMfgIdCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Mfg_ID_Ctrl), "wxTextCtrl" ) + + def GetHasPov4dirCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Has_POV_4DIR_Ctrl), "wxTextCtrl" ) + + def GetHasPovCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Has_POV_Ctrl), "wxTextCtrl" ) + + def GetHasZCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Has_Z_Ctrl), "wxTextCtrl" ) + + def GetHasRudderCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Has_Rudder_Ctrl), "wxTextCtrl" ) + + def GetRudderPosCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Rudder_Pos_Ctrl), "wxTextCtrl" ) + + def GetPovCtsPosCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_POV_CTS_Pos_Ctrl), "wxTextCtrl" ) + + def GetZPositionCtrl(self): + return wxPyTypeCast( self.FindWindowById(ID_Z_Position_Ctrl), "wxTextCtrl" ) + + # WDR: handler implementations for JoysticktestPanel + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = JoystickTestPanel(nb, -1) + return win + +#---------------------------------------------------------------------- + + +overview = """\ +""" diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index d4a56289cd..ba7f0c2b35 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -621,10 +621,10 @@ def EVT_END_PROCESS(eh, id, func): # wxJoyStick def EVT_JOY_DOWN(win, func): - win.Connect(-1, -1, wxEVT_JOY_DOWN, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_DOWN, func) def EVT_JOY_UP(win, func): - win.Connect(-1, -1, wxEVT_JOY_UP, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_UP, func) def EVT_JOY_MOVE(win, func): win.Connect(-1, -1, wxEVT_JOY_MOVE, func) @@ -633,8 +633,8 @@ def EVT_JOY_ZMOVE(win, func): win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) def EVT_JOYSTICK_EVENTS(win, func): - win.Connect(-1, -1, wxEVT_JOY_DOWN, func) - win.Connect(-1, -1, wxEVT_JOY_UP, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_DOWN, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_UP, func) win.Connect(-1, -1, wxEVT_JOY_MOVE, func) win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index d6492ce70e..74157b5271 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -457,7 +457,7 @@ void wxPyCallback::EventThunker(wxEvent& event) { Py_DECREF(tuple); if (result) { Py_DECREF(result); - PyErr_Clear(); + PyErr_Clear(); // Just in case... } else { PyErr_Print(); } diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index 4654657e0f..cb61fbe064 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -791,6 +791,8 @@ public: class wxJoystick : public wxObject { public: wxJoystick(int joystick = wxJOYSTICK1); + ~wxJoystick(); + wxPoint GetPosition(); int GetZPosition(); int GetButtonState(); diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp index 9d9893effb..2fd97af5d6 100644 --- a/wxPython/src/msw/misc2.cpp +++ b/wxPython/src/msw/misc2.cpp @@ -5714,6 +5714,33 @@ static PyObject *_wrap_new_wxJoystick(PyObject *self, PyObject *args, PyObject * return _resultobj; } +#define delete_wxJoystick(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxJoystick(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxJoystick * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxJoystick",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxJoystick_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxJoystick. Expected _wxJoystick_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + delete_wxJoystick(_arg0); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxJoystick_GetPosition(_swigobj) (_swigobj->GetPosition()) static PyObject *_wrap_wxJoystick_GetPosition(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7060,6 +7087,7 @@ static PyMethodDef misc2cMethods[] = { { "wxJoystick_GetButtonState", (PyCFunction) _wrap_wxJoystick_GetButtonState, METH_VARARGS | METH_KEYWORDS }, { "wxJoystick_GetZPosition", (PyCFunction) _wrap_wxJoystick_GetZPosition, METH_VARARGS | METH_KEYWORDS }, { "wxJoystick_GetPosition", (PyCFunction) _wrap_wxJoystick_GetPosition, METH_VARARGS | METH_KEYWORDS }, + { "delete_wxJoystick", (PyCFunction) _wrap_delete_wxJoystick, METH_VARARGS | METH_KEYWORDS }, { "new_wxJoystick", (PyCFunction) _wrap_new_wxJoystick, METH_VARARGS | METH_KEYWORDS }, { "wxProcess_CloseOutput", (PyCFunction) _wrap_wxProcess_CloseOutput, METH_VARARGS | METH_KEYWORDS }, { "wxProcess_GetOutputStream", (PyCFunction) _wrap_wxProcess_GetOutputStream, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/misc2.py b/wxPython/src/msw/misc2.py index 76e68dc44e..443f0f8a3d 100644 --- a/wxPython/src/msw/misc2.py +++ b/wxPython/src/msw/misc2.py @@ -492,6 +492,9 @@ class wxJoystickPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 + def __del__(self,misc2c=misc2c): + if self.thisown == 1 : + misc2c.delete_wxJoystick(self) def GetPosition(self, *_args, **_kwargs): val = apply(misc2c.wxJoystick_GetPosition,(self,) + _args, _kwargs) if val: val = wxPointPtr(val) ; val.thisown = 1 diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 9e3664e4ea..ae5f36982c 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -1341,6 +1341,34 @@ static PyObject *_wrap_wxWindow_DestroyChildren(PyObject *self, PyObject *args, return _resultobj; } +#define wxWindow_IsBeingDeleted(_swigobj) (_swigobj->IsBeingDeleted()) +static PyObject *_wrap_wxWindow_IsBeingDeleted(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_IsBeingDeleted",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_IsBeingDeleted. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxWindow_IsBeingDeleted(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxWindow_DragAcceptFiles(_swigobj,_swigarg0) (_swigobj->DragAcceptFiles(_swigarg0)) static PyObject *_wrap_wxWindow_DragAcceptFiles(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -10534,6 +10562,7 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_FindWindowById", (PyCFunction) _wrap_wxWindow_FindWindowById, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Enable", (PyCFunction) _wrap_wxWindow_Enable, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_DragAcceptFiles", (PyCFunction) _wrap_wxWindow_DragAcceptFiles, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_IsBeingDeleted", (PyCFunction) _wrap_wxWindow_IsBeingDeleted, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_DestroyChildren", (PyCFunction) _wrap_wxWindow_DestroyChildren, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Destroy", (PyCFunction) _wrap_wxWindow_Destroy, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Close", (PyCFunction) _wrap_wxWindow_Close, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index df27f40d05..5a7fe39ea4 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -146,6 +146,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def DestroyChildren(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_DestroyChildren,(self,) + _args, _kwargs) return val + def IsBeingDeleted(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_IsBeingDeleted,(self,) + _args, _kwargs) + return val def DragAcceptFiles(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_DragAcceptFiles,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index c070d99169..0847fbd21e 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1462,10 +1462,10 @@ def EVT_END_PROCESS(eh, id, func): # wxJoyStick def EVT_JOY_DOWN(win, func): - win.Connect(-1, -1, wxEVT_JOY_DOWN, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_DOWN, func) def EVT_JOY_UP(win, func): - win.Connect(-1, -1, wxEVT_JOY_UP, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_UP, func) def EVT_JOY_MOVE(win, func): win.Connect(-1, -1, wxEVT_JOY_MOVE, func) @@ -1474,8 +1474,8 @@ def EVT_JOY_ZMOVE(win, func): win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) def EVT_JOYSTICK_EVENTS(win, func): - win.Connect(-1, -1, wxEVT_JOY_DOWN, func) - win.Connect(-1, -1, wxEVT_JOY_UP, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_DOWN, func) + win.Connect(-1, -1, wxEVT_JOY_BUTTON_UP, func) win.Connect(-1, -1, wxEVT_JOY_MOVE, func) win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func)