]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/scrolbar.cpp
missing event.Skip() added (it was impossible to use mouse without it...)
[wxWidgets.git] / src / msw / scrolbar.cpp
index 2072573681a91a6544950d98ea7f7d9233cd2622..007c98067ffb9024d0ac6a5c106aea8755499e0d 100644 (file)
@@ -48,7 +48,9 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
         return FALSE;
     parent->AddChild(this);
     SetName(name);
+#if wxUSE_VALIDATORS
     SetValidator(validator);
+#endif // wxUSE_VALIDATORS
     
     SetBackgroundColour(parent->GetBackgroundColour()) ;
     SetForegroundColour(parent->GetForegroundColour()) ;
@@ -161,8 +163,12 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
             scrollEvent = wxEVT_SCROLL_PAGEDOWN;
             break;
 
-        case SB_THUMBTRACK:
         case SB_THUMBPOSITION:
+            nScrollInc = pos - position;
+            scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
+            break;
+
+        case SB_THUMBTRACK:
             nScrollInc = pos - position;
             scrollEvent = wxEVT_SCROLL_THUMBTRACK;
             break;
@@ -171,9 +177,10 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
             nScrollInc = 0;
     }
 
-    if ( nScrollInc == 0 )
+    // don't process the event if there is no displacement,
+    // unless this is a thumb release event.
+    if (( nScrollInc == 0 ) && ( scrollEvent != wxEVT_SCROLL_THUMBRELEASE ))
     {
-        // no event to process, so don't process it
         return FALSE;
     }