forward enable functionality to inner view in scrollview (eg for multiline textviews)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-02-08 14:11:56 +00:00
parent e4c903b2ea
commit 6ade9e8917

View File

@@ -1920,15 +1920,23 @@ void wxWidgetCocoaImpl::GetBestRect( wxRect *r ) const
bool wxWidgetCocoaImpl::IsEnabled() const
{
if ( [m_osxView respondsToSelector:@selector(isEnabled) ] )
return [m_osxView isEnabled];
NSView* targetView = m_osxView;
if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
targetView = [(NSScrollView*) m_osxView documentView];
if ( [targetView respondsToSelector:@selector(isEnabled) ] )
return [targetView isEnabled];
return true;
}
void wxWidgetCocoaImpl::Enable( bool enable )
{
if ( [m_osxView respondsToSelector:@selector(setEnabled:) ] )
[m_osxView setEnabled:enable];
NSView* targetView = m_osxView;
if ( [m_osxView isKindOfClass:[NSScrollView class] ] )
targetView = [(NSScrollView*) m_osxView documentView];
if ( [targetView respondsToSelector:@selector(setEnabled:) ] )
[targetView setEnabled:enable];
}
void wxWidgetCocoaImpl::PulseGauge()