]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/gbsizer.cpp
add wxScrollHelper::ShowScrollbars() (implemented for GTK only right now, generic...
[wxWidgets.git] / src / common / gbsizer.cpp
index 2a6db887569f9643318b73ca0d7e850396cce24c..eb23a2e37218d34bcca785b688a1dc0e96c3445f 100644 (file)
@@ -228,6 +228,18 @@ wxSizerItem* wxGridBagSizer::Add( wxGBSizerItem *item )
     if ( item->GetWindow() )
         item->GetWindow()->SetContainingSizer( this );
 
+    // extend the number of rows/columns of the underlying wxFlexGridSizer if
+    // necessary
+    int row, col;
+    item->GetEndPos(row, col);
+    row++;
+    col++;
+
+    if ( row > GetRows() )
+        SetRows(row);
+    if ( col > GetCols() )
+        SetCols(col);
+
     return item;
 }
 
@@ -580,7 +592,7 @@ void wxGridBagSizer::AdjustForOverflow()
         {
             wxGBPosition pos(row,col);
             wxGBSizerItem* item = FindItemAtPosition(pos);
-            if ( !item || !item->ShouldAccountFor() )
+            if ( !item || !item->IsShown() )
                 continue;
 
             int endrow, endcol;
@@ -623,7 +635,7 @@ void wxGridBagSizer::AdjustForOverflow()
         {
             wxGBPosition pos(row,col);
             wxGBSizerItem* item = FindItemAtPosition(pos);
-            if ( !item || !item->ShouldAccountFor() )
+            if ( !item || !item->IsShown() )
                 continue;
 
             int endrow, endcol;