X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22a35096a0a9c3fe4d3d32b8d68a361126ef9677..80f8355d6639f1bb13b00a64cb27aaa2b5088185:/src/common/gbsizer.cpp diff --git a/src/common/gbsizer.cpp b/src/common/gbsizer.cpp index 8188383c6a..b4b50b2842 100644 --- a/src/common/gbsizer.cpp +++ b/src/common/gbsizer.cpp @@ -507,7 +507,7 @@ void wxGridBagSizer::RecalcSizes() m_cols = m_colWidths.GetCount(); int idx, width, height; - AdjustForGrowables(sz, m_calculatedMinSize, m_rows, m_cols); + AdjustForGrowables(sz); // Find the start positions on the window of the rows and columns wxArrayInt rowpos; @@ -537,20 +537,24 @@ void wxGridBagSizer::RecalcSizes() { int row, col, endrow, endcol; wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - item->GetPos(row, col); - item->GetEndPos(endrow, endcol); - height = 0; - for(idx=row; idx <= endrow; idx++) - height += m_rowHeights[idx]; - height += (endrow - row) * m_vgap; // add a vgap for every row spanned + if ( item->IsShown() ) + { + item->GetPos(row, col); + item->GetEndPos(endrow, endcol); - width = 0; - for (idx=col; idx <= endcol; idx++) - width += m_colWidths[idx]; - width += (endcol - col) * m_hgap; // add a hgap for every col spanned + height = 0; + for(idx=row; idx <= endrow; idx++) + height += m_rowHeights[idx]; + height += (endrow - row) * m_vgap; // add a vgap for every row spanned - SetItemBounds(item, colpos[col], rowpos[row], width, height); + width = 0; + for (idx=col; idx <= endcol; idx++) + width += m_colWidths[idx]; + width += (endcol - col) * m_hgap; // add a hgap for every col spanned + + SetItemBounds(item, colpos[col], rowpos[row], width, height); + } node = node->GetNext(); }