]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/nonownedwnd.cpp
A call to wxPopupWindow::Show shouldn't automatically cause the popup window to steal...
[wxWidgets.git] / src / osx / carbon / nonownedwnd.cpp
index cab04631f5a7522d74224c8eb6f75c0f0b0d3302..f5e87300b6923b00ef63bcc4cd2bb706ed208bab 100644 (file)
@@ -51,6 +51,21 @@ void wxNonOwnedWindowCarbonImpl::Lower()
     ::SendBehind( m_macWindow , NULL ) ;
 }
 
+void wxNonOwnedWindowCarbonImpl::ShowWithoutActivating()
+{
+    bool plainTransition = true;
+
+#if wxUSE_SYSTEM_OPTIONS
+    if ( wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) )
+        plainTransition = ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1 ) ;
+#endif
+
+    if ( plainTransition )
+       ::ShowWindow( (WindowRef)m_macWindow );
+    else
+       ::TransitionWindow( (WindowRef)m_macWindow, kWindowZoomTransitionEffect, kWindowShowTransitionAction, NULL );
+}
+
 bool wxNonOwnedWindowCarbonImpl::Show(bool show)
 {
     bool plainTransition = true;
@@ -62,14 +77,8 @@ bool wxNonOwnedWindowCarbonImpl::Show(bool show)
 
     if (show)
     {
-#if wxOSX_USE_CARBON
-        if ( plainTransition )
-           ::ShowWindow( (WindowRef)m_macWindow );
-        else
-           ::TransitionWindow( (WindowRef)m_macWindow, kWindowZoomTransitionEffect, kWindowShowTransitionAction, NULL );
-
+        ShowWithoutActivating();
         ::SelectWindow( (WindowRef)m_macWindow ) ;
-#endif
     }
     else
     {
@@ -528,8 +537,9 @@ void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
                     break ;
             }
             break ;
-
-     case kEventMouseWheelMoved :
+     // TODO http://developer.apple.com/qa/qa2005/qa1453.html
+     // add declaration for 10.4 and change to kEventMouseScroll
+    case kEventMouseWheelMoved :
         {
             wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
 
@@ -1135,15 +1145,13 @@ wxNonOwnedWindowCarbonImpl::~wxNonOwnedWindowCarbonImpl()
 
 }
 
-void wxNonOwnedWindowCarbonImpl::Destroy()
+void wxNonOwnedWindowCarbonImpl::WillBeDestroyed()
 {
     if ( m_macEventHandler )
     {
         ::RemoveEventHandler((EventHandlerRef) m_macEventHandler);
         m_macEventHandler = NULL ;
     }
-
-    wxPendingDelete.Append( new wxDeferredObjectDeleter( this ) ) ;
 }
 
 void wxNonOwnedWindowInstallTopLevelWindowEventHandler(WindowRef window, EventHandlerRef* handler, void *ref)
@@ -1669,6 +1677,11 @@ void wxNonOwnedWindowCarbonImpl::WindowToScreen( int *x, int *y )
         *y = (int)p.y;
 }
 
+bool wxNonOwnedWindowCarbonImpl::IsActive()
+{
+    return ActiveNonFloatingWindow() == m_macWindow;
+}
+
 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
     long style, long extraStyle, const wxString& name )
 {