]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/vscroll.cpp
Instead of m_menuBar use GetMenuBar() which will be modified (with next patch)
[wxWidgets.git] / src / generic / vscroll.cpp
index abe374f694957200ede299d5b31d061306a15c19..ad0951f3a7dfc87908ff27611356247e57d5ffe3 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(__APPLE__)
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "vscroll.h"
 #endif
 
@@ -92,7 +92,7 @@ wxCoord wxVScrolledWindow::EstimateTotalHeight() const
 
         // use the height of the lines we looked as the average
         heightTotal = (wxCoord)
-                (((float)m_heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
+                (((float)heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
     }
 
     return heightTotal;
@@ -374,6 +374,7 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event)
     size_t lineFirstNew;
 
     const wxEventType evtType = event.GetEventType();
+
     if ( evtType == wxEVT_SCROLLWIN_TOP )
     {
         lineFirstNew = 0;
@@ -398,21 +399,19 @@ void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event)
     {
         lineFirstNew = GetLastVisibleLine();
     }
+    else if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE )
+    {
+        lineFirstNew = event.GetPosition();
+    }
+    else if ( evtType == wxEVT_SCROLLWIN_THUMBTRACK )
+    {
+        lineFirstNew = event.GetPosition();
+    }
+        
     else // unknown scroll event?
     {
-        if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE )
-        {
-            lineFirstNew = event.GetPosition();
-        }
-        else
-        {
-            wxASSERT_MSG( evtType == wxEVT_SCROLLWIN_THUMBTRACK,
-                            _T("unknown scroll event type?") );
-
-            // don't do anything, otherwise dragging the thumb around would
-            // be too slow
-            return;
-        }
+        wxFAIL_MSG( _T("unknown scroll event type?") );
+        return;
     }
 
     ScrollToLine(lineFirstNew);