]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrlwing.cpp
Fix DnD in generic wxDataViewCtrl when scrolled.
[wxWidgets.git] / src / generic / scrlwing.cpp
index 6244d494a0400be6cbc5de450b2a22d51044dd5e..7dcd4ba055b40f584673f110a850730c99640c70 100644 (file)
@@ -343,6 +343,8 @@ wxScrollHelperBase::wxScrollHelperBase(wxWindow *win)
     m_xScrollingEnabled =
     m_yScrollingEnabled = true;
 
+    m_kbdScrollingEnabled = true;
+
     m_scaleX =
     m_scaleY = 1.0;
 #if wxUSE_MOUSEWHEEL
@@ -844,6 +846,12 @@ void wxScrollHelperBase::HandleOnPaint(wxPaintEvent& WXUNUSED(event))
 // this they always have the priority
 void wxScrollHelperBase::HandleOnChar(wxKeyEvent& event)
 {
+    if ( !m_kbdScrollingEnabled )
+    {
+        event.Skip();
+        return;
+    }
+
     // prepare the event this key press maps to
     wxScrollWinEvent newEvent;
 
@@ -926,11 +934,7 @@ bool wxScrollHelperBase::SendAutoScrollEvents(wxScrollWinEvent& event) const
 void wxScrollHelperBase::StopAutoScrolling()
 {
 #if wxUSE_TIMER
-    if ( m_timerAutoScroll )
-    {
-        delete m_timerAutoScroll;
-        m_timerAutoScroll = NULL;
-    }
+    wxDELETE(m_timerAutoScroll);
 #endif
 }