]> git.saurik.com Git - wxWidgets.git/commitdiff
A call to wxPopupWindow::Show shouldn't automatically cause the popup window to steal...
authorKevin Ollivier <kevino@theolliviers.com>
Sat, 6 Mar 2010 04:51:51 +0000 (04:51 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sat, 6 Mar 2010 04:51:51 +0000 (04:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/popupwin.h
src/osx/carbon/popupwin.cpp

index 4ecdc4ffbb00089f96db8aaf0521a5e63203913a..58b591d0a8dc2dab0ae2371b75f314533056907f 100644 (file)
@@ -26,6 +26,8 @@ public:
         { (void)Create(parent, flags); }
 
     bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
+    
+    virtual bool Show(bool show);
 
 protected:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow)
index 48dff3d929c2849fc6c24b76a725c748a60355ef..b28aaba17d0ac15dc753bb2686cf52c39f8d77c6 100644 (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