Account for label window in wxStaticBoxBase::GetBordersForSizer()

Take the window used as label into account in the default implementation
of this method.
This commit is contained in:
Vadim Zeitlin
2017-12-20 00:30:12 +01:00
parent 67225fb07e
commit b34a1c036a

View File

@@ -42,7 +42,15 @@ void wxStaticBoxBase::GetBordersForSizer(int *borderTop, int *borderOther) const
{
const int BORDER = FromDIP(5); // FIXME: hardcoded value
*borderTop = GetLabel().empty() ? BORDER : GetCharHeight();
if ( m_labelWin )
{
*borderTop = m_labelWin->GetSize().y;
}
else
{
*borderTop = GetLabel().empty() ? BORDER : GetCharHeight();
}
*borderOther = BORDER;
}