make IsEnabled() return false even if the window parent, and not the window itself, is disabled and added IsThisEnabled() implementing the old IsEnabled() behaviour; also significantly simplify the window state management code in all ports by factoring out the common parts in wxWindowBase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2139,19 +2139,9 @@ bool wxWindowMac::Show(bool show)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxWindowMac::Enable(bool enable)
|
||||
void wxWindowMac::DoEnable(bool enable)
|
||||
{
|
||||
wxASSERT( m_peer->Ok() ) ;
|
||||
bool former = MacIsReallyEnabled() ;
|
||||
if ( !wxWindowBase::Enable(enable) )
|
||||
return false;
|
||||
|
||||
m_peer->Enable( enable ) ;
|
||||
|
||||
if ( former != MacIsReallyEnabled() )
|
||||
MacPropagateEnabledStateChanged() ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2176,21 +2166,10 @@ void wxWindowMac::MacPropagateVisibilityChanged()
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxWindowMac::MacPropagateEnabledStateChanged()
|
||||
void wxWindowMac::OnEnabled(bool enabled)
|
||||
{
|
||||
#if !TARGET_API_MAC_OSX
|
||||
MacEnabledStateChanged() ;
|
||||
|
||||
wxWindowMac *child;
|
||||
wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
|
||||
while ( node )
|
||||
{
|
||||
child = node->GetData();
|
||||
if ( child->IsEnabled() )
|
||||
child->MacPropagateEnabledStateChanged() ;
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user