]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/vscroll.cpp
first attempt for full screen implementation
[wxWidgets.git] / src / generic / vscroll.cpp
index 6c072dc9ab872eace72cc3f540bae6400dace82f..30b888bb2ea0834ba67839fa0597124f2e221d97 100644 (file)
@@ -92,7 +92,7 @@ wxCoord wxVScrolledWindow::EstimateTotalHeight() const
 
         // use the height of the lines we looked as the average
         heightTotal = (wxCoord)
 
         // 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;
     }
 
     return heightTotal;
@@ -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);