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
#if wxMAJOR_VERSION >= 3
Connect(
wxEVT_CHECKBOX,
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
);
#else
Connect(
wxEVT_COMMAND_CHECKBOX_CLICKED,
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
);
#endif
Connect(
wxEVT_CHECKBOX,
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
);
repopulate();
}

View File

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

View File

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