X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/efba61bac0c9eab455ffa18daf982fc68faba077..92850d6b2ff6072f4801152fd6bfdb7263715ec0:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 93d8ed9709..47a2fa90dc 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -1131,9 +1131,11 @@ void wxFlexGridSizer::RecalcSizes() SetItemBounds( node->GetData(), x, y, w, h); } - y = y + m_rowHeights[r] + m_vgap; + if (m_rowHeights[r] != -1) + y = y + m_rowHeights[r] + m_vgap; } - x = x + m_colWidths[c] + m_hgap; + if (m_colWidths[c] != -1) + x = x + m_colWidths[c] + m_hgap; } } @@ -1187,12 +1189,16 @@ wxSize wxFlexGridSizer::CalcMin() int width = 0; for (int col = 0; col < ncols; col++) if ( m_colWidths[ col ] != -1 ) - width += m_colWidths[ col ] + ( col == ncols-1 ? 0 : m_hgap ); + width += m_colWidths[ col ] + m_hgap; + if (width > 0) + width -= m_hgap; int height = 0; for (int row = 0; row < nrows; row++) if ( m_rowHeights[ row ] != -1 ) - height += m_rowHeights[ row ] + ( row == nrows-1 ? 0 : m_vgap ); + height += m_rowHeights[ row ] + m_vgap; + if (height > 0) + height -= m_vgap; m_calculatedMinSize = wxSize( width, height ); return m_calculatedMinSize; @@ -1564,6 +1570,12 @@ wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox *box, int orient ) wxASSERT_MSG( box, wxT("wxStaticBoxSizer needs a static box") ); } +wxStaticBoxSizer::wxStaticBoxSizer(int orient, wxWindow *win, const wxString& s) + : wxBoxSizer(orient), + m_staticBox(new wxStaticBox(win, wxID_ANY, s)) +{ +} + static void GetStaticBoxBorders( wxStaticBox *box, int *borderTop, int *borderOther) @@ -1687,6 +1699,7 @@ void wxStdDialogButtonSizer::AddButton(wxButton *mybutton) m_buttonCancel = mybutton; break; case wxID_HELP: + case wxID_CONTEXT_HELP: m_buttonHelp = mybutton; break; default: