From 4fc38bc2c70ebff7d62d98ad962ce0bd02e67f4f Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 27 Jan 2019 14:41:00 +0100 Subject: [PATCH] Improve minimum width of wxRadioBox Take the minimum width of the wxStaticBox into account, instead of only the width of the label. --- src/msw/radiobox.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 43a69bbc3e..c0b93032a7 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -586,10 +586,9 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const reinterpret_cast(const_cast(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); }