]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/scrlwing.cpp
Dammit, try it again this time actually removing it instead of adding it
[wxWidgets.git] / src / generic / scrlwing.cpp
index f5a5e0d8b1dbe512f5947c42ef9bc8b9bfd80c18..606207d2600b35fd2ba22e0a15bfef7d0642792c 100644 (file)
@@ -360,8 +360,7 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
     // For better backward compatibility we set persisting limits
     // here not just the size.  It makes SetScrollbars 'sticky'
     // emulating the old non-autoscroll behaviour.
-
-    m_targetWindow->SetVirtualSizeHints( w, h );
+    //   m_targetWindow->SetVirtualSizeHints( w, h );
 
     // The above should arguably be deprecated, this however we still need.
 
@@ -964,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