diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index a96a6631f0..795cadc188 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -512,12 +512,11 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand case kEventWindowActivated : { toplevelWindow->MacActivate( cEvent.GetTicks() , true) ; - wxActivateEvent wxevent(wxEVT_ACTIVATE, true , toplevelWindow->GetId()); wxevent.SetTimestamp( cEvent.GetTicks() ) ; wxevent.SetEventObject(toplevelWindow); toplevelWindow->GetEventHandler()->ProcessEvent(wxevent); - result = noErr ; + // we still sending an eventNotHandledErr in order to allow for default processing break ; } case kEventWindowDeactivated : @@ -527,7 +526,7 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand wxevent.SetTimestamp( cEvent.GetTicks() ) ; wxevent.SetEventObject(toplevelWindow); toplevelWindow->GetEventHandler()->ProcessEvent(wxevent); - result = noErr ; + // we still sending an eventNotHandledErr in order to allow for default processing break ; } case kEventWindowShown : @@ -961,8 +960,10 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title, { ::CreateRootControl( (WindowRef)m_macWindow , (ControlRef*)&m_macControl ) ; } + // the root control level handleer MacInstallEventHandler() ; + // the frame window event handler InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ; MacInstallTopLevelWindowEventHandler() ; diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 9d09716b24..28e556b17d 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -105,10 +105,14 @@ pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessa static const EventTypeSpec eventList[] = { #if TARGET_API_MAC_OSX - { kEventClassControl , kEventControlDraw } , + { kEventClassControl , kEventControlDraw } , + { kEventClassControl , kEventControlVisibilityChanged } , + { kEventClassControl , kEventControlEnabledStateChanged } , + { kEventClassControl , kEventControlHiliteChanged } , // { kEventClassControl , kEventControlInvalidateForSizeChange } , // 10.3 only // { kEventClassControl , kEventControlBoundsChanged } , -// kEventControlEnabledStateChanged , kEventControlVisibilityChanged , kEventControlHiliteChanged + + {} #else {} #endif @@ -149,6 +153,15 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl result = eventNotHandledErr; } break ; + case kEventControlVisibilityChanged : + thisWindow->MacVisibilityChanged() ; + break ; + case kEventControlEnabledStateChanged : + thisWindow->MacEnabledStateChanged() ; + break ; + case kEventControlHiliteChanged : + thisWindow->MacHiliteChanged() ; + break ; default : break ; } @@ -1540,6 +1553,7 @@ bool wxWindowMac::Enable(bool enable) void wxWindowMac::MacPropagateVisibilityChanged() { +#if !TARGET_API_MAC_OSX MacVisibilityChanged() ; wxWindowListNode *node = GetChildren().GetFirst(); @@ -1550,10 +1564,12 @@ void wxWindowMac::MacPropagateVisibilityChanged() child->MacPropagateVisibilityChanged( ) ; node = node->GetNext(); } +#endif } void wxWindowMac::MacPropagateEnabledStateChanged( ) { +#if !TARGET_API_MAC_OSX MacEnabledStateChanged() ; wxWindowListNode *node = GetChildren().GetFirst(); @@ -1564,10 +1580,12 @@ void wxWindowMac::MacPropagateEnabledStateChanged( ) child->MacPropagateEnabledStateChanged() ; node = node->GetNext(); } +#endif } void wxWindowMac::MacPropagateHiliteChanged( ) { +#if !TARGET_API_MAC_OSX MacHiliteChanged() ; wxWindowListNode *node = GetChildren().GetFirst(); @@ -1578,6 +1596,7 @@ void wxWindowMac::MacPropagateHiliteChanged( ) child->MacPropagateHiliteChanged() ; node = node->GetNext(); } +#endif } //