From cf6a4556c55d4625bce4072d35ab4df07f3575d0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Oct 2014 12:58:57 +0000 Subject: [PATCH] Only select the first radio button if there is one in wxMSW wxRadioBox. Don't call SetSelection(0) if the radio box is empty. See #16630. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78045 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/radiobox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 053da03797..1f9132b627 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -245,7 +245,9 @@ bool wxRadioBox::Create(wxWindow *parent, #endif SetMajorDim(majorDim == 0 ? n : majorDim, style); - SetSelection(0); + // Select the first radio button if we have any buttons at all. + if ( n > 0 ) + SetSelection(0); SetSize(pos.x, pos.y, size.x, size.y); // Now that we have items determine what is the best size and set it.