]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for generating set/kill focus events for wxRadioBox (also fixes TABbing in a...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Sep 2003 12:06:18 +0000 (12:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Sep 2003 12:06:18 +0000 (12:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23709 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/radiobox.cpp

index 2fdcde5aefd9926d1e9021883f72626f51273de6..d0f6c2b18fea17b8c6fc9d715bb7c67075425b9b 100644 (file)
@@ -996,6 +996,25 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
             }
             break;
 
             }
             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:
             {
 #ifdef __WIN32__
         case WM_HELP:
             {