X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d5fccc60b06a306655fa8ee71cfe13dda70f5c3..69e65b6c0baf05e34e1655b53e76ece4465b4ad8:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index ea3031200b..6e4fbcb376 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -1813,7 +1813,7 @@ DoAdjustForGrowables(int delta, void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz) { -#ifdef __WXDEBUG__ +#if wxDEBUG_LEVEL // by the time this function is called, the sizer should be already fully // initialized and hence the number of its columns and rows is known and we // can check that all indices in m_growableCols/Rows are valid (see also @@ -1841,7 +1841,7 @@ void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz) } } } -#endif // __WXDEBUG__ +#endif // wxDEBUG_LEVEL if ( (m_flexDirection & wxHORIZONTAL) || (m_growMode != wxFLEX_GROWMODE_NONE) ) @@ -2178,6 +2178,13 @@ wxSize wxStaticBoxSizer::CalcMin() wxSize ret( wxBoxSizer::CalcMin() ); ret.x += 2*other_border; + + // ensure that we're wide enough to show the static box label (there is no + // need to check for the static box best size in vertical direction though) + const int boxWidth = m_staticBox->GetBestSize().x; + if ( ret.x < boxWidth ) + ret.x = boxWidth; + ret.y += other_border + top_border; return ret;