mirror of https://github.com/PCSX2/pcsx2.git
Simplify and fix EE and VU slider behaviour
The custom scroll event handler increments/decrements the slider value by one when a click event is detected. It also propagates the event to the wxWidgets3.0 built in slider scroll event handler, which repeats the same action. This causes the slider to add/subtract 2 whenever it is clicked on Windows. Remove the custom function.
This commit is contained in:
parent
73e2ff6ff6
commit
02077821d4
|
@ -353,7 +353,6 @@ namespace Panels
|
|||
|
||||
void OnEnable_Toggled( wxCommandEvent& evt );
|
||||
void Defaults_Click( wxCommandEvent& evt );
|
||||
void Slider_Click(wxScrollEvent &event);
|
||||
void EECycleRate_Scroll(wxScrollEvent &event);
|
||||
void VUCycleRate_Scroll(wxScrollEvent &event);
|
||||
};
|
||||
|
|
|
@ -226,13 +226,6 @@ Panels::SpeedHacksPanel::SpeedHacksPanel( wxWindow* parent )
|
|||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
|
||||
Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
|
||||
Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
|
||||
Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
|
||||
Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
|
||||
Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
|
||||
|
||||
Connect( m_slider_eecycle->GetId(), wxEVT_SCROLL_CHANGED, wxScrollEventHandler( SpeedHacksPanel::EECycleRate_Scroll ) );
|
||||
Connect( m_slider_vustealer->GetId(), wxEVT_SCROLL_CHANGED, wxScrollEventHandler( SpeedHacksPanel::VUCycleRate_Scroll ) );
|
||||
Connect( m_check_Enable->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SpeedHacksPanel::OnEnable_Toggled ) );
|
||||
|
@ -343,30 +336,6 @@ void Panels::SpeedHacksPanel::Defaults_Click( wxCommandEvent& evt )
|
|||
evt.Skip();
|
||||
}
|
||||
|
||||
void Panels::SpeedHacksPanel::Slider_Click(wxScrollEvent &event) {
|
||||
wxSlider* slider = (wxSlider*) event.GetEventObject();
|
||||
int value = slider->GetValue();
|
||||
int eventType = event.GetEventType();
|
||||
if (eventType == wxEVT_SCROLL_PAGEUP || eventType == wxEVT_SCROLL_LINEUP) {
|
||||
if (value > slider->GetMin()) {
|
||||
slider->SetValue(value-1);
|
||||
}
|
||||
}
|
||||
else if (eventType == wxEVT_SCROLL_TOP) {
|
||||
slider->SetValue(slider->GetMin());
|
||||
}
|
||||
else if (eventType == wxEVT_SCROLL_PAGEDOWN || eventType == wxEVT_SCROLL_LINEDOWN) {
|
||||
if (value < slider->GetMax()) {
|
||||
slider->SetValue(value+1);
|
||||
}
|
||||
}
|
||||
else if (eventType == wxEVT_SCROLL_BOTTOM) {
|
||||
slider->SetValue(slider->GetMax());
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void Panels::SpeedHacksPanel::EECycleRate_Scroll(wxScrollEvent &event)
|
||||
{
|
||||
SetEEcycleSliderMsg();
|
||||
|
|
Loading…
Reference in New Issue