]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
fix some links
[wxWidgets.git] / src / common / sizer.cpp
index d08036227403b24501535f6fd77333a2d9ab841f..cc81970cb5cd30cd72b5fad11b4ea495f24d368a 100644 (file)
@@ -921,12 +921,16 @@ void wxSizer::SetSizeHints( wxWindow *window )
     // Preserve the window's max size hints, but set the
     // lower bound according to the sizer calculations.
 
-    wxSize size = Fit( window );
+    // This is equivalent to calling Fit(), except that we need to set
+    // the size hints _in between_ the two steps performed by Fit
+    // (1. ComputeFittingClientSize, 2. SetClientSize). That's because
+    // otherwise SetClientSize() could have no effect if there already are
+    // size hints in effect that forbid requested client size.
 
-    window->SetSizeHints( size.x,
-                          size.y,
-                          window->GetMaxWidth(),
-                          window->GetMaxHeight() );
+    const wxSize clientSize = ComputeFittingClientSize(window);
+
+    window->SetMinClientSize(clientSize);
+    window->SetClientSize(clientSize);
 }
 
 #if WXWIN_COMPATIBILITY_2_8
@@ -936,16 +940,6 @@ void wxSizer::SetVirtualSizeHints( wxWindow *window )
 }
 #endif // WXWIN_COMPATIBILITY_2_8
 
-wxSize wxSizer::GetMaxWindowSize( wxWindow *window ) const
-{
-    return window->GetMaxSize();
-}
-
-wxSize wxSizer::GetMinWindowSize( wxWindow *window )
-{
-    return window->ClientToWindowSize(GetMinSize());
-}
-
 // TODO on mac we need a function that determines how much free space this
 // min size contains, in order to make sure that we have 20 pixels of free
 // space around the controls