Fix generation of extraneous wxEVT_SLIDER events in wxMSW
Don't send the event when it's redundant, i.e. doesn't really notify about the change in the slider value. Also add a test case for wxEVT_SLIDER and show these events in the widgets sample. Closes https://github.com/wxWidgets/wxWidgets/pull/2080 Closes #18929.
This commit is contained in:
@@ -35,6 +35,7 @@ private:
|
||||
#ifndef __WXOSX__
|
||||
WXUISIM_TEST( PageUpDown );
|
||||
WXUISIM_TEST( LineUpDown );
|
||||
WXUISIM_TEST( EvtSlider );
|
||||
WXUISIM_TEST( LinePageSize );
|
||||
#endif
|
||||
CPPUNIT_TEST( Value );
|
||||
@@ -47,6 +48,7 @@ private:
|
||||
|
||||
void PageUpDown();
|
||||
void LineUpDown();
|
||||
void EvtSlider();
|
||||
void LinePageSize();
|
||||
void Value();
|
||||
void Range();
|
||||
@@ -125,6 +127,24 @@ void SliderTestCase::LineUpDown()
|
||||
#endif
|
||||
}
|
||||
|
||||
void SliderTestCase::EvtSlider()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
EventCounter slider(m_slider, wxEVT_SLIDER);
|
||||
|
||||
wxUIActionSimulator sim;
|
||||
wxYield();
|
||||
m_slider->SetFocus();
|
||||
|
||||
sim.Char(WXK_UP);
|
||||
sim.Char(WXK_DOWN);
|
||||
|
||||
wxYield();
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(2, slider.GetCount());
|
||||
#endif
|
||||
}
|
||||
|
||||
void SliderTestCase::LinePageSize()
|
||||
{
|
||||
#if wxUSE_UIACTIONSIMULATOR
|
||||
|
Reference in New Issue
Block a user