A call to wxPopupWindow::Show shouldn't automatically cause the popup window to steal focus.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier 2010-03-06 04:51:51 +00:00
parent e8ae97889e
commit a45c9ba59b
2 changed files with 23 additions and 0 deletions

View File

@ -26,6 +26,8 @@ public:
{ (void)Create(parent, flags); } { (void)Create(parent, flags); }
bool Create(wxWindow *parent, int flags = wxBORDER_NONE); bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual bool Show(bool show);
protected: protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow) DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow)

View File

@ -56,4 +56,25 @@ bool wxPopupWindow::Create(wxWindow *parent, int flags)
} }
bool wxPopupWindow::Show(bool show)
{
if ( !wxWindow::Show(show) )
return false;
if ( m_nowpeer && show)
m_nowpeer->ShowWithoutActivating();
else if ( m_nowpeer )
m_nowpeer->Show(false);
if ( show )
{
// because apps expect a size event to occur at this moment
wxSizeEvent event(GetSize() , m_windowId);
event.SetEventObject(this);
HandleWindowEvent(event);
}
return true;
}
#endif // #if wxUSE_POPUPWIN #endif // #if wxUSE_POPUPWIN