]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrolwin.cpp
fixed compilation error
[wxWidgets.git] / src / generic / scrolwin.cpp
index 5dccb848c1694cd44b1f37883cd39f8368c9cb94..cc001c2d47a751fb8a39751155e72a9d90e1352e 100644 (file)
@@ -437,6 +437,7 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
 
     if (x_pos != -1)
     {
+        int old_x = m_xScrollPosition;
         m_xScrollPosition = x_pos;
     
        // Calculate page size i.e. number of scroll units you get on the
@@ -450,9 +451,12 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
         m_xScrollPosition = wxMax( 0, m_xScrollPosition );
       
         SetScrollPos( wxHORIZONTAL, m_xScrollPosition, TRUE );
+       
+       ScrollWindow( (old_x-m_xScrollPosition)*m_xScrollPixelsPerLine, 0 );
     }
     if (y_pos != -1)
     {
+        int old_y = m_yScrollPosition;
         m_yScrollPosition = y_pos;
        
        // Calculate page size i.e. number of scroll units you get on the
@@ -466,13 +470,15 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
         m_yScrollPosition = wxMax( 0, m_yScrollPosition );
        
         SetScrollPos( wxVERTICAL, m_yScrollPosition, TRUE );
+       
+       ScrollWindow( 0, (old_y-m_yScrollPosition)*m_yScrollPixelsPerLine );
     }
     
     
 #ifdef __WXMSW__
-    ::UpdateWindow ((HWND) GetHWND());
+//    ::UpdateWindow ((HWND) GetHWND());
 #else
-    Refresh();
+//    Refresh();
 #endif
 }