]> git.saurik.com Git - wxWidgets.git/commitdiff
Better EVT_MOTION handling in wxPGSpinButton
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 8 Dec 2008 17:20:11 +0000 (17:20 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 8 Dec 2008 17:20:11 +0000 (17:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/advprops.cpp

index 32eff3b0a79294f5cf93beb07c0e791e1115d30a..5bd56c3cd4bb424a6a1162b046489d76de70904b 100644 (file)
@@ -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;
+                }
             }
         }