From: Vadim Zeitlin Date: Fri, 19 Sep 2003 12:06:18 +0000 (+0000) Subject: fix for generating set/kill focus events for wxRadioBox (also fixes TABbing in a... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1dab049c9e46d2c484c384679a656b46d0e4f513?hp=df0787b66229e2b5e26cabf9f62044563ab15961 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 --- 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: {