From aca78774b6aa0ab27dead3b4b88c0d8e40e5667a Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 5 Jul 2002 14:09:31 +0000 Subject: [PATCH] Added wxRadioButton::MSWWindowProc to reset m_focusJustSet -- otherwise, if RB1 has the focus, then you click on RB2, then back on RB1, no command event will be generated for the last click. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16046 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/radiobut.h | 1 + src/msw/radiobut.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) 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 -- 2.47.2