diff --git a/include/wx/msw/popupwin.h b/include/wx/msw/popupwin.h index 374fcbc511..d95c1dabc0 100644 --- a/include/wx/msw/popupwin.h +++ b/include/wx/msw/popupwin.h @@ -25,6 +25,7 @@ public: bool Create(wxWindow *parent, int flags = wxBORDER_NONE); + virtual void SetFocus(); virtual bool Show(bool show = true); // return the style to be used for the popup windows diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index 9ed7714d7e..fbcf9961e6 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -89,6 +89,15 @@ WXHWND wxPopupWindow::MSWGetParent() const #endif } +void wxPopupWindow::SetFocus() +{ + // Focusing on a popup window does not work on MSW unless WS_POPUP style is + // set (which is never the case currently, see the note in MSWGetParent()). + // We do not even want to try to set the focus, as it returns an error from + // SetFocus() on recent Windows versions (since Vista) and the resulting + // debug message is annoying. +} + bool wxPopupWindow::Show(bool show) { if ( !wxWindowMSW::Show(show) )