]> git.saurik.com Git - wxWidgets.git/commitdiff
Added IsScrollng() support for scroll and scrollwin events
authorGuillermo Rodriguez Garcia <guille@iies.es>
Tue, 18 Jan 2000 20:26:20 +0000 (20:26 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Tue, 18 Jan 2000 20:26:20 +0000 (20:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/scrolbar.cpp
src/msw/window.cpp

index f5c9a867dde8b8d793abf80e9da5bdf94bd249d5..ab6f9668b50f2f0b47dcfda06f8a88123ee68a6d 100644 (file)
@@ -131,6 +131,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
     wxEventType scrollEvent = wxEVT_NULL;
 
     int nScrollInc;
+    bool isScrolling = TRUE;
     switch ( wParam )
     {
         case SB_TOP:
@@ -163,8 +164,11 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
             scrollEvent = wxEVT_SCROLL_PAGEDOWN;
             break;
 
-        case SB_THUMBTRACK:
         case SB_THUMBPOSITION:
+            isScrolling = FALSE;
+            /* fall-through */
+
+        case SB_THUMBTRACK:
             nScrollInc = pos - position;
             scrollEvent = wxEVT_SCROLL_THUMBTRACK;
             break;
@@ -173,9 +177,10 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
             nScrollInc = 0;
     }
 
-    if ( nScrollInc == 0 )
+    if (( nScrollInc == 0 ) && isScrolling )
     {
         // no event to process, so don't process it
+        // GRG: always process SB_THUMBPOSITION !
         return FALSE;
     }
 
@@ -190,6 +195,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
     wxScrollEvent event(scrollEvent, m_windowId);
     event.SetPosition(new_pos);
     event.SetEventObject( this );
+    event.SetScrolling(isScrolling);
 
     return GetEventHandler()->ProcessEvent(event);
 }
index ce331f74524b4c6867f6f227598af7bdf9c20547..ec39a8be1d37c814c329040582eff6ac716d9178 100644 (file)
@@ -3393,8 +3393,11 @@ bool wxWindow::MSWOnScroll(int orientation, WXWORD wParam,
         event.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
         break;
 
-    case SB_THUMBTRACK:
     case SB_THUMBPOSITION:
+        event.m_isScrolling = FALSE;
+        /* fall-through */
+
+    case SB_THUMBTRACK:
         event.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
         break;