From 8a4e043aef904eda398249dde995b6ddcc01a4ce Mon Sep 17 00:00:00 2001 From: Steve Lamerton Date: Mon, 28 Nov 2011 20:19:16 +0000 Subject: [PATCH] Override MSWTranslateMessage for wxActiveXContainer. Calling IOleInPlaceActiveObject::TranslateAccelerator ensures that accelerators and other keyboard functionality behaves correctly. Fixes #13679. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/ole/activex.h | 1 + src/msw/ole/activex.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/wx/msw/ole/activex.h b/include/wx/msw/ole/activex.h index b86b5e156c..f07c262c05 100644 --- a/include/wx/msw/ole/activex.h +++ b/include/wx/msw/ole/activex.h @@ -168,6 +168,7 @@ public: void OnPaint(wxPaintEvent&); void OnSetFocus(wxFocusEvent&); void OnKillFocus(wxFocusEvent&); + virtual bool MSWTranslateMessage(WXMSG* pMsg); protected: friend class FrameSite; diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index dec49a768c..d161e6d4a6 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -1260,4 +1260,20 @@ void wxActiveXContainer::OnKillFocus(wxFocusEvent& event) event.Skip(); } +//--------------------------------------------------------------------------- +// wxActiveXContainer::MSWTranslateMessage +// +// Called for every message that needs to be translated. +// Some controls might need more keyboard keys to process (CTRL-C, CTRL-A ect), +// In that case TranslateAccelerator should always be called first. +//--------------------------------------------------------------------------- +bool wxActiveXContainer::MSWTranslateMessage(WXMSG* pMsg) +{ + if(m_oleInPlaceActiveObject.IsOk() && m_oleInPlaceActiveObject->TranslateAccelerator(pMsg) == S_OK) + { + return true; + } + return wxWindow::MSWTranslateMessage(pMsg); +} + #endif // wxUSE_ACTIVEX -- 2.45.2