From fac9339629ddd9a2e34d0c405e7aa4fdb35bd49f Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 25 Sep 2000 16:01:44 +0000 Subject: [PATCH] Enabled context-sensitive help for wxRadioBox git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/radiobox.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 529c46dbd3..2d20f24418 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -1025,6 +1025,47 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, } } } +#ifdef __WIN32__ + case WM_HELP: + { + wxRadioBox *radiobox = (wxRadioBox *) + ::GetWindowLong(hwnd, GWL_USERDATA); + + wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") ); + + bool processed = TRUE; + + HELPINFO* info = (HELPINFO*) lParam; + // Don't yet process menu help events, just windows + if (info->iContextType == HELPINFO_WINDOW) + { + wxWindow* subjectOfHelp = radiobox; + bool eventProcessed = FALSE; + while (subjectOfHelp && !eventProcessed) + { + wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), wxPoint(info->MousePos.x, info->MousePos.y) ) ; // info->iCtrlId); + helpEvent.SetEventObject(radiobox); + eventProcessed = radiobox->GetEventHandler()->ProcessEvent(helpEvent); + + // Go up the window hierarchy until the event is handled (or not) + subjectOfHelp = subjectOfHelp->GetParent(); + } + processed = eventProcessed; + } + else if (info->iContextType == HELPINFO_MENUITEM) + { + wxHelpEvent helpEvent(wxEVT_HELP, info->iCtrlId) ; + helpEvent.SetEventObject(radiobox); + processed = radiobox->GetEventHandler()->ProcessEvent(helpEvent); + } + else processed = FALSE; + + if (processed) + return 0; + + break; + } +#endif } return ::CallWindowProc(CASTWNDPROC s_wndprocRadioBtn, hwnd, message, wParam, lParam); -- 2.49.0