X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/997e8e2979b126b15993a79a37c8ae0c8dff664e..8f4745feeb2850f3bebb3af45407e164550d541a:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index a4c17f8b8c..ad5f899c8c 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) ) @@ -2158,13 +2158,37 @@ void wxStaticBoxSizer::RecalcSizes() m_staticBox->SetSize( m_position.x, m_position.y, m_size.x, m_size.y ); - wxPoint old_pos( m_position ); - m_position.x += other_border; - m_position.y += top_border; wxSize old_size( m_size ); m_size.x -= 2*other_border; m_size.y -= top_border + other_border; + wxPoint old_pos( m_position ); + if (m_staticBox->GetChildren().GetCount() > 0) + { +#if defined( __WXGTK20__ ) + // if the wxStaticBox has created a wxPizza to contain its children + // (see wxStaticBox::AddChild) then we need to place the items it contains + // in the wxBoxSizer::RecalcSizes() call below using coordinates relative + // to the top-left corner of the staticbox: + m_position.x = m_position.y = 0; +#else + // if the wxStaticBox has childrens, then these windows must be placed + // by the wxBoxSizer::RecalcSizes() call below using coordinates relative + // to the top-left corner of the staticbox (but unlike wxGTK, we need + // to keep in count the static borders here!): + m_position.x = other_border; + m_position.y = top_border; +#endif + } + else + { + // the windows contained in the staticbox have been created as siblings of the + // staticbox (this is the "old" way of staticbox contents creation); in this + // case we need to position them with coordinates relative to our common parent + m_position.x += other_border; + m_position.y += top_border; + } + wxBoxSizer::RecalcSizes(); m_position = old_pos; @@ -2212,6 +2236,10 @@ bool wxStaticBoxSizer::Detach( wxWindow *window ) #endif // wxUSE_STATBOX +//--------------------------------------------------------------------------- +// wxStdDialogButtonSizer +//--------------------------------------------------------------------------- + #if wxUSE_BUTTON wxStdDialogButtonSizer::wxStdDialogButtonSizer()