wxWidgets: Clicking on the sliders on the hacks screen now works.

Scroll rate is very inconsistent, but that's just wxWidgets doing what it does best (worst?)...
Also fixed a minor bug in LilyPad version labeling.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1853 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
mattmenke 2009-09-18 10:18:56 +00:00
parent 8a1df8dbb1
commit 504082f52d
3 changed files with 36 additions and 2 deletions

View File

@ -250,6 +250,7 @@ namespace Panels
const wxChar* GetEEcycleSliderMsg( int val );
const wxChar* GetVUcycleSliderMsg( int val );
void Slider_Click(wxScrollEvent &event);
void EECycleRate_Scroll(wxScrollEvent &event);
void VUCycleRate_Scroll(wxScrollEvent &event);
};

View File

@ -216,6 +216,17 @@ Panels::SpeedHacksPanel::SpeedHacksPanel( wxWindow& parent, int idealWidth ) :
mainSizer.Add( &miscSizer, SizerFlags::TopLevelBox() );
SetSizer( &mainSizer );
// There has to be a cleaner way to do this...
int ids[2] = {m_slider_eecycle->GetId(), m_slider_vustealer->GetId()};
for (int i=0; i<2; i++) {
Connect( ids[i], wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
Connect( ids[i], wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
Connect( ids[i], wxEVT_SCROLL_LINEUP, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
Connect( ids[i], wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
Connect( ids[i], wxEVT_SCROLL_TOP, wxScrollEventHandler( SpeedHacksPanel::Slider_Click ) );
Connect( ids[i], 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 ) );
}
@ -233,6 +244,28 @@ void Panels::SpeedHacksPanel::Apply()
opts.vuMinMax = m_check_vuMinMax->GetValue();
}
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());
}
}
void Panels::SpeedHacksPanel::EECycleRate_Scroll(wxScrollEvent &event)
{
m_msg_eecycle->SetLabel(GetEEcycleSliderMsg(m_slider_eecycle->GetValue()));

View File

@ -590,11 +590,11 @@ u32 CALLBACK PS2EgetLibVersion2(u32 type) {
// Used in about and config screens.
void GetNameAndVersionString(wchar_t *out) {
#ifdef NO_CRT
wsprintfW(out, L"LilyPad svn %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV);
wsprintfW(out, L"LilyPad %i.%i.%i", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV);
#elif defined(PCSX2_DEBUG)
wsprintfW(out, L"LilyPad Debug %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV);
#else
wsprintfW(out, L"LilyPad %i.%i.%i", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV);
wsprintfW(out, L"LilyPad svn %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV);
#endif
}