added hilite change notification

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-03-29 08:39:31 +00:00
parent 8155488b31
commit 8ab505498d
5 changed files with 104 additions and 49 deletions

View File

@@ -1503,6 +1503,41 @@ wxString wxWindowMac::GetTitle() const
return m_label ;
}
bool wxWindowMac::Show(bool show)
{
if ( !wxWindowBase::Show(show) )
return FALSE;
// TODO use visibilityChanged Carbon Event for OSX
bool former = MacIsReallyShown() ;
SetControlVisibility( (ControlRef) m_macControl , show , true ) ;
if ( former != MacIsReallyShown() )
MacPropagateVisibilityChanged() ;
return TRUE;
}
bool wxWindowMac::Enable(bool enable)
{
wxASSERT( m_macControl != NULL ) ;
if ( !wxWindowBase::Enable(enable) )
return FALSE;
bool former = MacIsReallyEnabled() ;
if ( enable )
EnableControl( (ControlRef) m_macControl ) ;
else
DisableControl( (ControlRef) m_macControl ) ;
if ( former != MacIsReallyEnabled() )
MacPropagateEnabledStateChanged() ;
return TRUE;
}
//
// status change propagations (will be not necessary for OSX later )
//
void wxWindowMac::MacPropagateVisibilityChanged()
{
MacVisibilityChanged() ;
@@ -1517,20 +1552,54 @@ void wxWindowMac::MacPropagateVisibilityChanged()
}
}
bool wxWindowMac::Show(bool show)
void wxWindowMac::MacPropagateEnabledStateChanged( )
{
if ( !wxWindowBase::Show(show) )
return FALSE;
MacEnabledStateChanged() ;
// TODO use visibilityChanged Carbon Event for OSX
bool former = MacIsReallyShown() ;
SetControlVisibility( (ControlRef) m_macControl , show , true ) ;
if ( former != MacIsReallyShown() )
MacPropagateVisibilityChanged() ;
return TRUE;
wxWindowListNode *node = GetChildren().GetFirst();
while ( node )
{
wxWindowMac *child = node->GetData();
if ( child->IsEnabled() )
child->MacPropagateEnabledStateChanged() ;
node = node->GetNext();
}
}
void wxWindowMac::MacPropagateHiliteChanged( )
{
MacHiliteChanged() ;
wxWindowListNode *node = GetChildren().GetFirst();
while ( node )
{
wxWindowMac *child = node->GetData();
// if ( child->IsEnabled() )
child->MacPropagateHiliteChanged() ;
node = node->GetNext();
}
}
//
// status change notifications
//
void wxWindowMac::MacVisibilityChanged()
{
}
void wxWindowMac::MacHiliteChanged()
{
}
void wxWindowMac::MacEnabledStateChanged()
{
}
//
// status queries on the inherited window's state
//
bool wxWindowMac::MacIsReallyShown()
{
// only under OSX the visibility of the TLW is taken into account
@@ -1552,50 +1621,20 @@ bool wxWindowMac::MacIsReallyShown()
#endif
}
void wxWindowMac::MacVisibilityChanged()
{
}
void wxWindowMac::MacPropagateEnabledStateChanged( )
{
MacEnabledStateChanged() ;
wxWindowListNode *node = GetChildren().GetFirst();
while ( node )
{
wxWindowMac *child = node->GetData();
if ( child->IsEnabled() )
child->MacPropagateEnabledStateChanged() ;
node = node->GetNext();
}
}
bool wxWindowMac::Enable(bool enable)
{
wxASSERT( m_macControl != NULL ) ;
if ( !wxWindowBase::Enable(enable) )
return FALSE;
bool former = MacIsReallyEnabled() ;
if ( enable )
UMAActivateControl( (ControlRef) m_macControl ) ;
else
UMADeactivateControl( (ControlRef) m_macControl ) ;
if ( former != MacIsReallyEnabled() )
MacPropagateEnabledStateChanged() ;
return TRUE;
}
bool wxWindowMac::MacIsReallyEnabled()
{
return IsControlEnabled( (ControlRef) m_macControl ) ;
}
void wxWindowMac::MacEnabledStateChanged()
bool wxWindowMac::MacIsReallyHilited()
{
return IsControlActive( (ControlRef) m_macControl ) ;
}
//
//
//
int wxWindowMac::GetCharHeight() const
{
wxClientDC dc ( (wxWindowMac*)this ) ;