X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b43914a8be2258de608a7127ac43f00b65631b15..a45c9ba59b610080585f76b0d02e1f1499c96ffe:/src/osx/carbon/nonownedwnd.cpp diff --git a/src/osx/carbon/nonownedwnd.cpp b/src/osx/carbon/nonownedwnd.cpp index cab04631f5..f5e87300b6 100644 --- a/src/osx/carbon/nonownedwnd.cpp +++ b/src/osx/carbon/nonownedwnd.cpp @@ -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 ) {