From: Jaakko Salli Date: Mon, 8 Dec 2008 17:20:11 +0000 (+0000) Subject: Better EVT_MOTION handling in wxPGSpinButton X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f14ed73f1a3652e0aa3ff45408dc27ec670c0817 Better EVT_MOTION handling in wxPGSpinButton git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 32eff3b0a7..5bd56c3cd4 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -194,18 +194,23 @@ private: { if ( m_bLeftDown ) { - Capture(); int dy = m_ptPosition.y - event.GetPosition().y; - m_ptPosition = event.GetPosition(); - - wxSpinEvent evtscroll( (dy >= 0) ? wxEVT_SCROLL_LINEUP : - wxEVT_SCROLL_LINEDOWN, - GetId() ); - evtscroll.SetEventObject(this); - - m_spins = abs(dy); - GetEventHandler()->ProcessEvent(evtscroll); - m_spins = 1; + if ( dy ) + { + Capture(); + m_ptPosition = event.GetPosition(); + + wxSpinEvent evtscroll( (dy >= 0) ? wxEVT_SCROLL_LINEUP : + wxEVT_SCROLL_LINEDOWN, + GetId() ); + evtscroll.SetEventObject(this); + + wxASSERT( m_spins == 1 ); + + m_spins = abs(dy); + GetEventHandler()->ProcessEvent(evtscroll); + m_spins = 1; + } } }