diff --git a/include/wx/msw/fdrepdlg.h b/include/wx/msw/fdrepdlg.h index 5884351cd4..9ccf2a6e12 100644 --- a/include/wx/msw/fdrepdlg.h +++ b/include/wx/msw/fdrepdlg.h @@ -41,6 +41,8 @@ public: virtual void SetTitle( const wxString& title) override; virtual wxString GetTitle() const override; + virtual bool MSWProcessMessage(WXMSG* pMsg) override; + protected: virtual void DoGetSize(int *width, int *height) const override; virtual void DoGetClientSize(int *width, int *height) const override; diff --git a/src/msw/evtloop.cpp b/src/msw/evtloop.cpp index 34018e8bee..cda02f3b5f 100644 --- a/src/msw/evtloop.cpp +++ b/src/msw/evtloop.cpp @@ -79,15 +79,7 @@ bool wxGUIEventLoop::PreProcessMessage(WXMSG *msg) } if ( !wndThis ) - { - // this may happen if the event occurred in a standard modeless dialog (the - // only example of which I know of is the find/replace dialog) - then call - // IsDialogMessage() to make TAB navigation in it work - - // NOTE: IsDialogMessage() just eats all the messages (i.e. returns true for - // them) if we call it for the control itself - return hwnd && ::IsDialogMessage(hwnd, msg) != 0; - } + return false; } if ( !AllowProcessing(wndThis) ) diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index b5890279de..c50ff773c9 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -446,6 +446,19 @@ wxString wxFindReplaceDialog::GetTitle() const return m_title; } +// ---------------------------------------------------------------------------- +// wxFindReplaceDialog message handling +// ---------------------------------------------------------------------------- + +bool wxFindReplaceDialog::MSWProcessMessage(WXMSG* pMsg) +{ + // The base class MSWProcessMessage() doesn't work for us because we don't + // have wxTAB_TRAVERSAL style, but then we don't need it anyhow: as this + // dialog only ever contains standard controls, just using the standard + // function is enough to make TAB navigation work in it. + return m_hWnd && ::IsDialogMessage(m_hWnd, pMsg); +} + // ---------------------------------------------------------------------------- // wxFindReplaceDialog position/size // ----------------------------------------------------------------------------