onepad: Remove wx2.8 compatibility code

This commit is contained in:
Jonathan Li 2016-04-27 08:35:46 +01:00
parent ab31915ce9
commit 0d43de516c
3 changed files with 19 additions and 49 deletions

View File

@ -128,17 +128,10 @@ GamepadConfiguration::GamepadConfiguration(int pad, wxWindow *parent) : wxFrame(
); );
// Connect the checkboxes to the OnCheckboxClicked Event // Connect the checkboxes to the OnCheckboxClicked Event
#if wxMAJOR_VERSION >= 3
Connect( Connect(
wxEVT_CHECKBOX, wxEVT_CHECKBOX,
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange) wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
); );
#else
Connect(
wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
);
#endif
repopulate(); repopulate();
} }

View File

@ -113,17 +113,10 @@ JoystickConfiguration::JoystickConfiguration(int pad, bool left, wxWindow *paren
); );
// Connect the checkboxes to the OnCheckboxClicked Event // Connect the checkboxes to the OnCheckboxClicked Event
#if wxMAJOR_VERSION >= 3
Connect( Connect(
wxEVT_CHECKBOX, wxEVT_CHECKBOX,
wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange) wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange)
); );
#else
Connect(
wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler(JoystickConfiguration::OnCheckboxChange)
);
#endif
} }
/** /**

View File

@ -632,15 +632,9 @@ void Dialog::config_key(int pad, int key)
} }
} }
} }
#if wxMAJOR_VERSION >= 3
m_bt_gamepad[pad][key]->SetLabel( m_bt_gamepad[pad][key]->SetLabel(
KeyName(pad, key, m_simulatedKeys[pad][key]).c_str() KeyName(pad, key, m_simulatedKeys[pad][key]).c_str()
); );
#else
m_bt_gamepad[pad][key]->SetLabel(
wxString(KeyName(pad, key, m_simulatedKeys[pad][key]).c_str(), wxConvUTF8)
);
#endif
} }
void Dialog::clear_key(int pad, int key) void Dialog::clear_key(int pad, int key)
@ -680,15 +674,9 @@ void Dialog::repopulate()
{ {
if (get_key(gamepad_id, key) != 0) if (get_key(gamepad_id, key) != 0)
{ {
#if wxMAJOR_VERSION >= 3
m_bt_gamepad[gamepad_id][key]->SetLabel( m_bt_gamepad[gamepad_id][key]->SetLabel(
KeyName(gamepad_id, key).c_str() KeyName(gamepad_id, key).c_str()
); );
#else
m_bt_gamepad[gamepad_id][key]->SetLabel(
wxString(KeyName(gamepad_id, key).c_str(), wxConvUTF8)
);
#endif
m_map_images[gamepad_id][get_key(gamepad_id, key)] = key; m_map_images[gamepad_id][get_key(gamepad_id, key)] = key;
} }
@ -701,15 +689,11 @@ void Dialog::repopulate()
{ {
int keysym = it->first; int keysym = it->first;
int key = it->second; int key = it->second;
#if wxMAJOR_VERSION >= 3
m_bt_gamepad[gamepad_id][key]->SetLabel( m_bt_gamepad[gamepad_id][key]->SetLabel(
KeyName(gamepad_id, key, keysym).c_str() KeyName(gamepad_id, key, keysym).c_str()
); );
#else
m_bt_gamepad[gamepad_id][key]->SetLabel(
wxString(KeyName(gamepad_id, key, keysym).c_str(), wxConvUTF8)
);
#endif
m_simulatedKeys[gamepad_id][key] = keysym; m_simulatedKeys[gamepad_id][key] = keysym;
m_map_images[gamepad_id][keysym] = key; m_map_images[gamepad_id][keysym] = key;
} }