]> git.saurik.com Git - wxWidgets.git/commitdiff
toolbartool has to send events to parent for tooltips to work
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 12 Sep 2004 09:32:26 +0000 (09:32 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 12 Sep 2004 09:32:26 +0000 (09:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp

index 714293fc36be981546c744ba238cc55861046c2d..18b9a9b984f93bb7e89a35835bd0e2a8b6a16c45 100644 (file)
@@ -442,7 +442,19 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
             if ( control == 0 )
                 currentMouseWindow = (wxWindow*) data ;
             else
             if ( control == 0 )
                 currentMouseWindow = (wxWindow*) data ;
             else
+            {
                 currentMouseWindow = wxFindControlFromMacControl( control ) ;
                 currentMouseWindow = wxFindControlFromMacControl( control ) ;
+                if ( currentMouseWindow == NULL )
+                {
+                       // for wxToolBar to function we have to send certaint events to it
+                       // instead of its children (wxToolBarTools)     
+                    ControlRef parent ;
+                    GetSuperControl(control, &parent );
+                    wxWindow *wxParent = wxFindControlFromMacControl( parent ) ;
+                    if ( wxParent && wxParent->IsKindOf( CLASSINFO( wxToolBar ) ) )
+                        currentMouseWindow = wxParent ;
+                }
+            }
         }        
     }
     
         }        
     }