]> git.saurik.com Git - wxWidgets.git/commitdiff
Also update cursor when over toolbar and titlebar
authorRobert Roebling <robert@roebling.de>
Tue, 13 Jan 2009 20:10:24 +0000 (20:10 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 13 Jan 2009 20:10:24 +0000 (20:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/nonownedwnd.cpp

index 67c13fac0bfb8eb0ec26b22344838864c028db56..c062fa3122391e59ee36209c1355d43cf29e3c04 100644 (file)
@@ -611,9 +611,9 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
                     // instead of its children (wxToolBarTools)
                     ControlRef parent ;
                     GetSuperControl(control, &parent );
                     // instead of its children (wxToolBarTools)
                     ControlRef parent ;
                     GetSuperControl(control, &parent );
-                    wxWindow *wxParent = (wxWindow*) wxFindWindowFromWXWidget((WXWidget) parent ) ;
-                    if ( wxParent && wxParent->IsKindOf( CLASSINFO( wxToolBar ) ) )
-                        currentMouseWindow = wxParent ;
+                    wxWindow *wxparent = (wxWindow*) wxFindWindowFromWXWidget((WXWidget) parent ) ;
+                    if ( wxparent && wxparent->IsKindOf( CLASSINFO( wxToolBar ) ) )
+                        currentMouseWindow = wxparent ;
 #endif
                 }
 #endif
 #endif
                 }
 #endif
@@ -733,7 +733,7 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
 
         wxWindow* cursorTarget = currentMouseWindow ;
         wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ;
 
         wxWindow* cursorTarget = currentMouseWindow ;
         wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ;
-
+        
         extern wxCursor gGlobalCursor;
 
         if (!gGlobalCursor.IsOk())
         extern wxCursor gGlobalCursor;
 
         if (!gGlobalCursor.IsOk())
@@ -749,6 +749,17 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
     }
     else // currentMouseWindow == NULL
     {
     }
     else // currentMouseWindow == NULL
     {
+        if (toplevelWindow && !control)
+        {
+           extern wxCursor gGlobalCursor;
+           if (!gGlobalCursor.IsOk())
+           {
+                // update cursor when over toolbar and titlebar etc.
+                wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ;
+                toplevelWindow->MacSetupCursor( cursorPoint );
+           }
+        }
+    
         // don't mess with controls we don't know about
         // for some reason returning eventNotHandledErr does not lead to the correct behaviour
         // so we try sending them the correct control directly
         // don't mess with controls we don't know about
         // for some reason returning eventNotHandledErr does not lead to the correct behaviour
         // so we try sending them the correct control directly