onepad: Use Bind instead of Connect

It's the recommended dynamic event binding method since wx2.9.
This commit is contained in:
Jonathan Li 2016-04-27 08:47:03 +01:00
parent 0d43de516c
commit 0de8f4a3a6
4 changed files with 10 additions and 39 deletions

View File

@ -116,24 +116,11 @@ GamepadConfiguration::GamepadConfiguration(int pad, wxWindow *parent) : wxFrame(
wxSize(60,25) // Size
);
// Connect the buttons to the OnButtonClicked Event
Connect(
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(GamepadConfiguration::OnButtonClicked)
);
// Connect the sliders to the OnSliderReleased Event
Connect(
wxEVT_SCROLL_THUMBRELEASE,
wxCommandEventHandler(GamepadConfiguration::OnSliderReleased)
);
Bind(wxEVT_BUTTON, &GamepadConfiguration::OnButtonClicked, this);
Bind(wxEVT_SCROLL_THUMBRELEASE, &GamepadConfiguration::OnSliderReleased, this);
Bind(wxEVT_CHECKBOX, &GamepadConfiguration::OnCheckboxChange, this);
// Connect the checkboxes to the OnCheckboxClicked Event
Connect(
wxEVT_CHECKBOX,
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
);
repopulate();
repopulate();
}
/**

View File

@ -106,17 +106,8 @@ JoystickConfiguration::JoystickConfiguration(int pad, bool left, wxWindow *paren
wxSize(60,25) // Size
);
// Connect the buttons to the OnButtonClicked Event
Connect(
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(JoystickConfiguration::OnButtonClicked)
);
// Connect the checkboxes to the OnCheckboxClicked Event
Connect(
wxEVT_CHECKBOX,
wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange)
);
Bind(wxEVT_BUTTON, &JoystickConfiguration::OnButtonClicked, this);
Bind(wxEVT_CHECKBOX, &JoystickConfiguration::OnCheckboxChange, this);
}
/**

View File

@ -280,17 +280,10 @@ Dialog::Dialog() : wxFrame( NULL, // Parent
m_bt_gamepad[i][Analog]->Disable();
}
// Connect the buttons to the OnButtonClicked Event
Connect(
wxEVT_COMMAND_BUTTON_CLICKED,
wxCommandEventHandler(Dialog::OnButtonClicked)
);
Bind(wxEVT_BUTTON, &Dialog::OnButtonClicked, this);
m_time_update_gui.SetOwner(this);
Connect(
wxEVT_TIMER,
wxCommandEventHandler(Dialog::JoystickEvent)
);
Bind(wxEVT_TIMER, &Dialog::JoystickEvent, this);
m_time_update_gui.Start(UPDATE_TIME, wxTIMER_CONTINUOUS);
for(int i=0; i<GAMEPAD_NUMBER; ++i)
@ -431,7 +424,7 @@ void Dialog::OnButtonClicked(wxCommandEvent &event)
}
}
void Dialog::JoystickEvent(wxCommandEvent& event)
void Dialog::JoystickEvent(wxTimerEvent& event)
{
#ifdef SDL_BUILD
u32 key;

View File

@ -91,7 +91,7 @@ class Dialog : public wxFrame
// Events
void OnButtonClicked(wxCommandEvent&);
void JoystickEvent(wxCommandEvent&);
void JoystickEvent(wxTimerEvent&);
public:
Dialog();