diff --git a/include/wx/msw/radiobut.h b/include/wx/msw/radiobut.h index 1ffb17d751..ea577bca88 100644 --- a/include/wx/msw/radiobut.h +++ b/include/wx/msw/radiobut.h @@ -52,6 +52,7 @@ public: // implementation only from now on virtual bool MSWCommand(WXUINT param, WXWORD id); virtual void Command(wxCommandEvent& event); + virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); virtual void SetFocus(); diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 83e588ab4d..f038fd099a 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -188,4 +188,19 @@ wxSize wxRadioButton::DoGetBestSize() const return wxSize(wRadio, hRadio); } +long wxRadioButton::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) +{ + if (nMsg == WM_SETFOCUS) + { + m_focusJustSet = TRUE; + + long ret = wxControl::MSWWindowProc(nMsg, wParam, lParam); + + m_focusJustSet = FALSE; + + return ret; + } + return wxControl::MSWWindowProc(nMsg, wParam, lParam); +} + #endif // wxUSE_RADIOBTN