]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/vscroll.cpp
GetItemCount is int.
[wxWidgets.git] / src / generic / vscroll.cpp
index e592f8054169030b2e9e3e99e83a40a03f43880d..30b888bb2ea0834ba67839fa0597124f2e221d97 100644 (file)
@@ -374,6 +374,7 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event)
     size_t lineFirstNew;
 
     const wxEventType evtType = event.GetEventType();
     size_t lineFirstNew;
 
     const wxEventType evtType = event.GetEventType();
+
     if ( evtType == wxEVT_SCROLLWIN_TOP )
     {
         lineFirstNew = 0;
     if ( evtType == wxEVT_SCROLLWIN_TOP )
     {
         lineFirstNew = 0;
@@ -398,21 +399,19 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event)
     {
         lineFirstNew = GetLastVisibleLine();
     }
     {
         lineFirstNew = GetLastVisibleLine();
     }
-    else // unknown scroll event?
+    else if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE )
     {
     {
-        if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE )
-        {
-            lineFirstNew = event.GetPosition();
-        }
-        else
-        {
-            wxASSERT_MSG( evtType == wxEVT_SCROLLWIN_THUMBTRACK,
-                            _T("unknown scroll event type?") );
+        lineFirstNew = event.GetPosition();
+    }
+    else if ( evtType == wxEVT_SCROLLWIN_THUMBTRACK )
+    {
+        lineFirstNew = event.GetPosition();
+    }
 
 
-            // don't do anything, otherwise dragging the thumb around would
-            // be too slow
-            return;
-        }
+    else // unknown scroll event?
+    {
+        wxFAIL_MSG( _T("unknown scroll event type?") );
+        return;
     }
 
     ScrollToLine(lineFirstNew);
     }
 
     ScrollToLine(lineFirstNew);