]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrlwing.cpp
fixed wxrc's dependencies
[wxWidgets.git] / src / generic / scrlwing.cpp
index c78ebc0fa7c5828db5df41ef35c323f6f7a9552b..606207d2600b35fd2ba22e0a15bfef7d0642792c 100644 (file)
@@ -963,22 +963,17 @@ void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) co
 // Default OnSize resets scrollbars, if any
 void wxScrollHelper::HandleOnSize(wxSizeEvent& WXUNUSED(event))
 {
-    if( m_win->GetAutoLayout() || m_targetWindow->GetAutoLayout() )
+    if ( m_targetWindow->GetAutoLayout() )
     {
-        if ( m_targetWindow != m_win )
-            m_targetWindow->FitInside();
-
-        m_win->FitInside();
-
-        // FIXME:  Something is really weird here...  This should be
-        // called by FitInside above (and apparently is), yet the
-        // scrollsub sample will get the scrollbar wrong if resized
-        // quickly.  This masks the bug, but is surely not the right
-        // answer at all.
-        AdjustScrollbars();
+        wxSize size = m_targetWindow->GetBestVirtualSize();
+        
+        // This will call ::Layout() and ::AdjustScrollbars()
+        m_win->SetVirtualSize( size );
     }
     else
+    {
         AdjustScrollbars();
+    }
 }
 
 // This calls OnDraw, having adjusted the origin according to the current