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;
// and also wide enough for its label
int widthLabel;
GetTextExtent(GetLabelText(), &widthLabel, NULL);
if ( widthLabel > width )
width = widthLabel;
int widthBox = wxStaticBox::DoGetBestSize().x;
if ( widthBox > width )
width = widthBox;
return wxSize(width, height);
}