Don't set even try to set focus to wxPopupWindow itself in wxMSW.
This doesn't work anyhow with our popup window implementation (it's a child of the desktop and we can't set focus to it) and provokes error messages due to ::SetFocus() failures, so simply don't do this at all. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,6 +25,7 @@ public:
|
|||||||
|
|
||||||
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
|
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
|
||||||
|
|
||||||
|
virtual void SetFocus();
|
||||||
virtual bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
// return the style to be used for the popup windows
|
// return the style to be used for the popup windows
|
||||||
|
@@ -89,6 +89,15 @@ WXHWND wxPopupWindow::MSWGetParent() const
|
|||||||
#endif
|
#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)
|
bool wxPopupWindow::Show(bool show)
|
||||||
{
|
{
|
||||||
if ( !wxWindowMSW::Show(show) )
|
if ( !wxWindowMSW::Show(show) )
|
||||||
|
Reference in New Issue
Block a user