]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
More scrolling stuff.
[wxWidgets.git] / src / common / sizer.cpp
index fd78077c09f23b7f6d4d22b5bde7711ab8bd9942..3915938467a1d3bb43c3db71d1500268d18fee80 100644 (file)
@@ -196,7 +196,7 @@ void wxSizerItem::SetDimension( wxPoint pos, wxSize size )
             size.x = rwidth;
         }
     }
-    
+
     // This is what GetPosition() returns. Since we calculate
     // borders afterwards, GetPosition() will be the left/top
     // corner of the surrounding border.
@@ -355,7 +355,12 @@ bool wxSizer::Remove( int pos )
 
 void wxSizer::Fit( wxWindow *window )
 {
-    wxSize size = FitSize( window );
+    wxSize size;
+    if (window->IsTopLevel())
+        size = FitSize( window );
+    else
+        size = GetMinWindowSize( window );
+
     window->SetSize( size );
 }
 
@@ -371,11 +376,14 @@ void wxSizer::SetSizeHints( wxWindow *window )
     window->SetSizeHints( size.x, size.y );
 }
 
-wxSize wxSizer::GetMaxWindowSize( wxWindow *window )
+wxSize wxSizer::GetMaxWindowSize( wxWindow *WXUNUSED(window) )
 {
-    wxSize sizeMax = wxGetDisplaySize();
-    // make the max size a bit smaller than the screen, a window which takes
-    // the entire screen doesn't look very nice neither
+    wxRect rect = wxGetClientDisplayRect();
+    wxSize sizeMax (rect.width,rect.height);
+
+    // Make the max size a bit smaller than the visible portion of 
+    // the screen.  A window which takes the entire screen doesn't 
+    // look very nice either
     sizeMax.x *= 9;
     sizeMax.x /= 10;
 
@@ -942,7 +950,7 @@ wxSize wxBoxSizer::CalcMin()
         wxSizerItem *item = (wxSizerItem*) node->Data();
 
         m_stretchable += item->GetOption();
-        
+
         wxSize size( item->CalcMin() );
 
         if (m_orient == wxHORIZONTAL)
@@ -964,7 +972,7 @@ wxSize wxBoxSizer::CalcMin()
                 m_fixedWidth = wxMax( m_fixedWidth, size.x );
             }
             else
-            { 
+            {
                 m_fixedWidth += size.x;
                 m_fixedHeight = wxMax( m_fixedHeight, size.y );
             }
@@ -999,7 +1007,7 @@ static void GetStaticBoxBorders(wxStaticBox *box,
     else
 #endif // __WXGTK__
         *borderTop = 15;
-
+       (void)box;
     *borderOther = 5;
 }