X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e0a050e347b1ece07ad5f165ba1b1d16edbeae77..391e226e8b349697ab264f8e20b01c5385285f7a:/src/msw/radiobox.cpp diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 408c5d8b65..f73e2ba3c2 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -270,9 +270,14 @@ bool wxRadioBox::MSWCommand(WXUINT cmd, WXWORD id) const unsigned int count = GetCount(); for ( unsigned int i = 0; i < count; i++ ) { - if ( id == wxGetWindowId((*m_radioButtons)[i]) ) + const HWND hwndBtn = (*m_radioButtons)[i]; + if ( id == wxGetWindowId(hwndBtn) ) { - selectedButton = i; + // we can get BN_CLICKED for a button which just became focused + // but it may not be checked, in which case we shouldn't + // generate a radiobox selection changed event for it + if ( ::SendMessage(hwndBtn, BM_GETCHECK, 0, 0) == BST_CHECKED ) + selectedButton = i; break; }