X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3678169caab0f713415414dce013a638305f3cce..09ffaca3a6d4d6b5f9cd513a26b0f264623f2109:/src/osx/cocoa/window.mm?ds=sidebyside diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index a5aaeac505..f7c6fcb8c3 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -71,9 +71,22 @@ NSView* GetFocusedViewInWindow( NSWindow* keyWindow ) WXWidget wxWidgetImpl::FindFocus() { - return GetFocusedViewInWindow( [NSApp keyWindow] ); + return GetFocusedViewInWindow( [NSApp keyWindow] );; } +wxWidgetImpl* wxWidgetImpl::FindBestFromWXWidget(WXWidget control) +{ + wxWidgetImpl* impl = FindFromWXWidget(control); + + // NSScrollViews can have their subviews like NSClipView + // therefore check and use the NSScrollView peer in that case + if ( impl == NULL && [[control superview] isKindOfClass:[NSScrollView class]]) + impl = FindFromWXWidget([control superview]); + + return impl; +} + + NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size , bool adjustForOrigin ) { int x, y, w, h ;