Improve minimum width of wxRadioBox

Take the minimum width of the wxStaticBox into account, instead of only the
width of the label.
This commit is contained in:
Maarten Bent
2019-01-27 14:41:00 +01:00
parent c68e5d0617
commit 4fc38bc2c7

View File

@@ -586,10 +586,9 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
reinterpret_cast<wxWindow*>(const_cast<wxRadioBox*>(this))).y / 2; reinterpret_cast<wxWindow*>(const_cast<wxRadioBox*>(this))).y / 2;
// and also wide enough for its label // and also wide enough for its label
int widthLabel; int widthBox = wxStaticBox::DoGetBestSize().x;
GetTextExtent(GetLabelText(), &widthLabel, NULL); if ( widthBox > width )
if ( widthLabel > width ) width = widthBox;
width = widthLabel;
return wxSize(width, height); return wxSize(width, height);
} }