]> git.saurik.com Git - wxWidgets.git/commitdiff
reverted wxMGL-specific code (didn't mean to commit this...)
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 24 Feb 2002 23:27:52 +0000 (23:27 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 24 Feb 2002 23:27:52 +0000 (23:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/univ/winuniv.cpp

index a09d562d1fc3e6f2153e3d103e01e63ed510afc4..33de11472160ddb1cf092b05a2e52c6d88e59f05 100644 (file)
@@ -763,9 +763,11 @@ int wxWindow::GetScrollRange(int orient) const
 
 void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
 {
+    // use native scrolling when available and do it in generic way
+    // otherwise:
 #ifdef __WXX11__
 
-    wxWindowX11::ScrollWindow( dx, dy, rect );
+    wxWindowNative::ScrollWindow(dx, dy, rect);
 
 #else
 
@@ -786,6 +788,19 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
         Refresh(TRUE /* erase bkgnd */, &r);
     }
     
+    // scroll children accordingly:    
+    wxPoint offset(dx, dy);
+    
+    for (wxWindowList::Node *node = GetChildren().GetFirst(); 
+         node; node = node->GetNext())
+    {
+        wxWindow *child = node->GetData();
+        if ( child != m_scrollbarVert && child != m_scrollbarHorz &&      
+             (rect == NULL || rect->Intersects(child->GetRect())) )
+        {
+            child->Move(child->GetPosition() + offset);
+        }
+    }    
 #endif
 }