git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67768
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
/**
Returns true if child property is selected.
*/
- bool IsChildSelected() const;
+ bool IsChildSelected( bool recursive = false ) const;
// Removes child property with given pointer. Does not delete it.
void RemoveChild( wxPGProperty* p );
}
}
-bool wxPGProperty::IsChildSelected() const
+bool wxPGProperty::IsChildSelected( bool recursive ) const
{
size_t i;
for ( i = 0; i < GetChildCount(); i++ )
{
- if ( m_parentState->DoIsPropertySelected( Item(i) ) )
+ wxPGProperty* child = Item(i);
+
+ // Test child
+ if ( m_parentState->DoIsPropertySelected( child ) )
+ return true;
+
+ // Test sub-childs
+ if ( recursive && child->IsChildSelected( recursive ) )
return true;
}
void wxPropertyGrid::RefreshProperty( wxPGProperty* p )
{
- if ( m_pState->DoIsPropertySelected(p) || p->IsChildSelected() )
+ if ( m_pState->DoIsPropertySelected(p) || p->IsChildSelected(true) )
{
// NB: We must copy the selection.
wxArrayPGProperty selection = m_pState->m_selection;