From 1dab049c9e46d2c484c384679a656b46d0e4f513 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 19 Sep 2003 12:06:18 +0000 Subject: [PATCH 1/1] fix for generating set/kill focus events for wxRadioBox (also fixes TABbing in a panel containing a radio box) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23709 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/radiobox.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 2fdcde5aef..d0f6c2b18f 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -996,6 +996,25 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, } break; + case WM_SETFOCUS: + case WM_KILLFOCUS: + { + wxRadioBox *radiobox = (wxRadioBox *) + ::GetWindowLong(hwnd, GWL_USERDATA); + + wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") ); + + // if we don't do this, no focus events are generated for the + // radiobox and, besides, we need to notify the parent about + // the focus change, otherwise the focus handling logic in + // wxControlContainer doesn't work + if ( message == WM_SETFOCUS ) + radiobox->HandleSetFocus((WXHWND)wParam); + else + radiobox->HandleKillFocus((WXHWND)wParam); + } + break; + #ifdef __WIN32__ case WM_HELP: { -- 2.45.2