X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77d2aaf0b4857e52f72b6756aa5abd2fedf22f5d..0afeb753e0a6a3fdba290bf3612bb2f012d44d95:/src/osx/cocoa/nonownedwnd.mm diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 6ae40522fe..030b1e6a23 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -145,6 +145,8 @@ bool shouldHandleSelector(SEL selector) // wx native implementation // +static NSResponder* s_nextFirstResponder = NULL; + @interface wxNSWindow : NSWindow { } @@ -152,6 +154,7 @@ bool shouldHandleSelector(SEL selector) - (void) sendEvent:(NSEvent *)event; - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen; - (void)noResponderFor: (SEL) selector; +- (BOOL)makeFirstResponder:(NSResponder *)aResponder; @end @implementation wxNSWindow @@ -206,6 +209,14 @@ bool shouldHandleSelector(SEL selector) return YES; } +- (BOOL)makeFirstResponder:(NSResponder *)aResponder +{ + s_nextFirstResponder = aResponder; + BOOL retval = [super makeFirstResponder:aResponder]; + s_nextFirstResponder = nil; + return retval; +} + @end @interface wxNSPanel : NSPanel @@ -215,6 +226,7 @@ bool shouldHandleSelector(SEL selector) - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen; - (void)noResponderFor: (SEL) selector; - (void)sendEvent:(NSEvent *)event; +- (BOOL)makeFirstResponder:(NSResponder *)aResponder; @end @implementation wxNSPanel @@ -265,6 +277,14 @@ bool shouldHandleSelector(SEL selector) } } +- (BOOL)makeFirstResponder:(NSResponder *)aResponder +{ + s_nextFirstResponder = aResponder; + BOOL retval = [super makeFirstResponder:aResponder]; + s_nextFirstResponder = nil; + return retval; +} + @end @@ -1041,6 +1061,12 @@ void wxNonOwnedWindowCocoaImpl::RestoreWindowLevel() [m_macWindow setLevel:m_macWindowLevel]; } +WX_NSResponder wxNonOwnedWindowCocoaImpl::GetNextFirstResponder() +{ + return s_nextFirstResponder; +} + + // // //