// static methods for associating native controls and their implementations
+ // finds the impl associated with this native control
static wxWidgetImpl*
FindFromWXWidget(WXWidget control);
+ // finds the impl associated with this native control, if the native control itself is not known
+ // also checks whether its parent is eg a registered scrollview, ie whether the control is a native subpart
+ // of a known control
+ static wxWidgetImpl*
+ FindBestFromWXWidget(WXWidget control);
+
static void RemoveAssociations( wxWidgetImpl* impl);
static void Associate( WXWidget control, wxWidgetImpl *impl );
return control;
}
+// no compositing to take into account under carbon
+wxWidgetImpl* wxWidgetImpl::FindBestFromWXWidget(WXWidget control)
+{
+ return FindFromWXWidget(control);
+}
+
// ---------------------------------------------------------------------------
// Carbon Events
// ---------------------------------------------------------------------------
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 ;