]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/property.cpp
Allow wxPGProperty::IsChildSelected() to work recursively
[wxWidgets.git] / src / propgrid / property.cpp
index 3ec89352ebdd7b2b9539c7fad7cf718e407ff179..d0f4aa31fecfb4051900b74a7aac3616b0911b75 100644 (file)
@@ -2569,12 +2569,19 @@ void wxPGProperty::DeleteChildren()
     }
 }
 
-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;
     }