mirror of https://github.com/PCSX2/pcsx2.git
onepad: Use Bind instead of Connect
It's the recommended dynamic event binding method since wx2.9.
This commit is contained in:
parent
0d43de516c
commit
0de8f4a3a6
|
@ -116,24 +116,11 @@ GamepadConfiguration::GamepadConfiguration(int pad, wxWindow *parent) : wxFrame(
|
||||||
wxSize(60,25) // Size
|
wxSize(60,25) // Size
|
||||||
);
|
);
|
||||||
|
|
||||||
// Connect the buttons to the OnButtonClicked Event
|
Bind(wxEVT_BUTTON, &GamepadConfiguration::OnButtonClicked, this);
|
||||||
Connect(
|
Bind(wxEVT_SCROLL_THUMBRELEASE, &GamepadConfiguration::OnSliderReleased, this);
|
||||||
wxEVT_COMMAND_BUTTON_CLICKED,
|
Bind(wxEVT_CHECKBOX, &GamepadConfiguration::OnCheckboxChange, this);
|
||||||
wxCommandEventHandler(GamepadConfiguration::OnButtonClicked)
|
|
||||||
);
|
|
||||||
// Connect the sliders to the OnSliderReleased Event
|
|
||||||
Connect(
|
|
||||||
wxEVT_SCROLL_THUMBRELEASE,
|
|
||||||
wxCommandEventHandler(GamepadConfiguration::OnSliderReleased)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Connect the checkboxes to the OnCheckboxClicked Event
|
repopulate();
|
||||||
Connect(
|
|
||||||
wxEVT_CHECKBOX,
|
|
||||||
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
|
|
||||||
);
|
|
||||||
|
|
||||||
repopulate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -106,17 +106,8 @@ JoystickConfiguration::JoystickConfiguration(int pad, bool left, wxWindow *paren
|
||||||
wxSize(60,25) // Size
|
wxSize(60,25) // Size
|
||||||
);
|
);
|
||||||
|
|
||||||
// Connect the buttons to the OnButtonClicked Event
|
Bind(wxEVT_BUTTON, &JoystickConfiguration::OnButtonClicked, this);
|
||||||
Connect(
|
Bind(wxEVT_CHECKBOX, &JoystickConfiguration::OnCheckboxChange, this);
|
||||||
wxEVT_COMMAND_BUTTON_CLICKED,
|
|
||||||
wxCommandEventHandler(JoystickConfiguration::OnButtonClicked)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Connect the checkboxes to the OnCheckboxClicked Event
|
|
||||||
Connect(
|
|
||||||
wxEVT_CHECKBOX,
|
|
||||||
wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -280,17 +280,10 @@ Dialog::Dialog() : wxFrame( NULL, // Parent
|
||||||
m_bt_gamepad[i][Analog]->Disable();
|
m_bt_gamepad[i][Analog]->Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect the buttons to the OnButtonClicked Event
|
Bind(wxEVT_BUTTON, &Dialog::OnButtonClicked, this);
|
||||||
Connect(
|
|
||||||
wxEVT_COMMAND_BUTTON_CLICKED,
|
|
||||||
wxCommandEventHandler(Dialog::OnButtonClicked)
|
|
||||||
);
|
|
||||||
|
|
||||||
m_time_update_gui.SetOwner(this);
|
m_time_update_gui.SetOwner(this);
|
||||||
Connect(
|
Bind(wxEVT_TIMER, &Dialog::JoystickEvent, this);
|
||||||
wxEVT_TIMER,
|
|
||||||
wxCommandEventHandler(Dialog::JoystickEvent)
|
|
||||||
);
|
|
||||||
m_time_update_gui.Start(UPDATE_TIME, wxTIMER_CONTINUOUS);
|
m_time_update_gui.Start(UPDATE_TIME, wxTIMER_CONTINUOUS);
|
||||||
|
|
||||||
for(int i=0; i<GAMEPAD_NUMBER; ++i)
|
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
|
#ifdef SDL_BUILD
|
||||||
u32 key;
|
u32 key;
|
||||||
|
|
|
@ -91,7 +91,7 @@ class Dialog : public wxFrame
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
void OnButtonClicked(wxCommandEvent&);
|
void OnButtonClicked(wxCommandEvent&);
|
||||||
void JoystickEvent(wxCommandEvent&);
|
void JoystickEvent(wxTimerEvent&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Dialog();
|
Dialog();
|
||||||
|
|
Loading…
Reference in New Issue