]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
Keep the key up/down event consistency without relying on toupper()
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index e4405c54920d4c8f68e84f6ffde3c0f335d29760..c4cd59574e1a60448f864b90916b226643c7ea43 100644 (file)
@@ -497,6 +497,10 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
 #endif
                 }
             }
+
+            // disabled windows must not get any input messages
+            if ( currentMouseWindow && !currentMouseWindow->MacIsReallyEnabled() )
+                currentMouseWindow = NULL;
         }
     }
 
@@ -561,9 +565,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
         // make tooltips current
 
 #if wxUSE_TOOLTIPS
-        if ( wxevent.GetEventType() == wxEVT_MOTION
-            || wxevent.GetEventType() == wxEVT_ENTER_WINDOW
-            || wxevent.GetEventType() == wxEVT_LEAVE_WINDOW )
+        if ( wxevent.GetEventType() == wxEVT_MOTION )
             wxToolTip::RelayEvent( currentMouseWindow , wxevent );
 #endif
 
@@ -638,8 +640,8 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
                 cursorPoint += cursorTarget->GetPosition();
         }
 
-    } // else if ( currentMouseWindow )
-    else
+    }
+    else // currentMouseWindow == NULL
     {
         // don't mess with controls we don't know about
         // for some reason returning eventNotHandledErr does not lead to the correct behaviour
@@ -648,17 +650,17 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
         {
             EventModifiers modifiers = cEvent.GetParameter<EventModifiers>(kEventParamKeyModifiers, typeUInt32) ;
             Point clickLocation = windowMouseLocation ;
+#if TARGET_API_MAC_OSX
             if ( toplevelWindow->MacUsesCompositing() )
             {
-#ifdef __WXMAC_OSX__
                 HIPoint hiPoint ;
                 hiPoint.x = clickLocation.h ;
                 hiPoint.y = clickLocation.v ;
                 HIViewConvertPoint( &hiPoint , (ControlRef) toplevelWindow->GetHandle() , control  ) ;
                 clickLocation.h = (int)hiPoint.x ;
                 clickLocation.v = (int)hiPoint.y ;
-#endif
             }
+#endif // TARGET_API_MAC_OSX
 
             HandleControlClick( control , clickLocation , modifiers , (ControlActionUPP ) -1 ) ;
             result = noErr ;
@@ -723,12 +725,7 @@ static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef hand
                 wxFrame *frame = wxDynamicCast( toplevelWindow , wxFrame ) ;
                 if ( frame )
                 {
-#if wxUSE_STATUSBAR
-                    frame->PositionStatusBar();
-#endif
-#if wxUSE_TOOLBAR
-                    frame->PositionToolBar();
-#endif
+                    frame->PositionBars();
                 }
 
                 wxSizeEvent event( r.GetSize() , toplevelWindow->GetId() ) ;