+ return wxControl::MSWWindowProc(nMsg, wParam, lParam);
+}
+
+void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
+{
+ HWND hwndBtn = (HWND)hWndBtn;
+
+ if ( !s_wndprocRadioBtn )
+ s_wndprocRadioBtn = (WXFARPROC)::GetWindowLong(hwndBtn, GWL_WNDPROC);
+// s_wndprocRadioBtn = (WNDPROC)::GetWindowLong(hwndBtn, GWL_WNDPROC);
+
+ // No GWL_USERDATA in Win16, so omit this subclassing.
+#ifdef __WIN32__
+ ::SetWindowLong(hwndBtn, GWL_WNDPROC, (long)wxRadioBtnWndProc);
+ ::SetWindowLong(hwndBtn, GWL_USERDATA, (long)this);
+#endif
+}
+
+// ---------------------------------------------------------------------------
+// window proc for radio buttons
+// ---------------------------------------------------------------------------
+
+#ifdef __WIN32__
+
+LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
+ UINT msg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ bool processed = TRUE;
+ if ( msg != WM_KEYDOWN )
+ processed = FALSE;
+
+ if ( processed )
+ {
+ wxRadioBox *radiobox = (wxRadioBox *)::GetWindowLong(hwnd, GWL_USERDATA);
+
+ wxCHECK_MSG( radiobox, 0, "radio button without radio box?" );
+
+ int sel = radiobox->GetSelection();
+
+ switch ( wParam )
+ {
+ case VK_UP:
+ sel--;
+ break;
+
+ case VK_LEFT:
+ sel -= radiobox->GetNumVer();
+ break;
+
+ case VK_DOWN:
+ sel++;
+ break;
+
+ case VK_RIGHT:
+ sel += radiobox->GetNumVer();
+ break;
+
+ case VK_TAB:
+ {
+ wxNavigationKeyEvent event;
+ event.SetDirection(!(::GetKeyState(VK_SHIFT) & 0x100));
+ event.SetWindowChange(FALSE);
+ event.SetEventObject(radiobox);
+
+ if ( radiobox->GetEventHandler()->ProcessEvent(event) )
+ return 0;
+ }
+ // fall through
+
+ default:
+ processed = FALSE;
+ }
+
+ if ( processed )
+ {
+ if ( sel >= 0 && sel < radiobox->Number() )
+ radiobox->SetSelection(sel);
+ }
+ }
+
+ if ( !processed )
+ return ::CallWindowProc(CASTWNDPROC s_wndprocRadioBtn, hwnd, msg, wParam, lParam);
+ else
+ return 0;