X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62ade1805148edf0d228b92bbdade5323a8921b9..9f391ae1547bec52bbe31eec0ba77be9ed558a32:/src/mac/carbon/toplevel.cpp diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 1ce8d60fde..fac851267e 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "toplevel.h" #endif @@ -36,6 +36,7 @@ #include "wx/log.h" #include "wx/intl.h" #include "wx/settings.h" + #include "wx/control.h" #endif //WX_PRECOMP #include "wx/mac/uma.h" @@ -159,8 +160,9 @@ static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , Even static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) { OSStatus result = eventNotHandledErr ; - - wxWindow* focus = wxWindow::FindFocus() ; + // call DoFindFocus instead of FindFocus, because for Composite Windows(like WxGenericListCtrl) + // FindFocus does not return the actual focus window,but the enclosing window + wxWindow* focus = wxWindow::DoFindFocus(); if ( focus == NULL ) return result ; @@ -211,8 +213,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event event.m_x = point.h; event.m_y = point.v; - event.m_timeStamp = when; - wxWindow* focus = wxWindow::FindFocus() ; + event.SetTimestamp(when); event.SetEventObject(focus); if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey ) @@ -449,6 +450,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev currentMouseWindow = wxFindControlFromMacControl( control ) ; if ( currentMouseWindow == NULL && cEvent.GetKind() == kEventMouseMoved ) { +#if wxUSE_TOOLBAR // for wxToolBar to function we have to send certaint events to it // instead of its children (wxToolBarTools) ControlRef parent ; @@ -456,6 +458,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev wxWindow *wxParent = wxFindControlFromMacControl( parent ) ; if ( wxParent && wxParent->IsKindOf( CLASSINFO( wxToolBar ) ) ) currentMouseWindow = wxParent ; +#endif } } }