- for(TreeNodeList::reverse_iterator iter = allStyles.rbegin(); iter != allStyles.rend(); ++iter)
- {
- if( (*iter)->GetType() == TreeNode::ARRAY )
- {
- // if its an array then its a list of styles to set to objects already in the hiearchy by name
- if( Dali::Actor actor = Dali::Actor::DownCast( handle ) )
- {
- const TreeNode& styleList = *(*iter);
- for( TreeNode::ConstIterator iterSubStyle = styleList.CBegin(); iterSubStyle != styleList.CEnd(); ++iterSubStyle )
- {
- const TreeNode* nameNode = (*iterSubStyle).second.Find("name");
- if( nameNode && nameNode->GetType() == TreeNode::STRING )
- {
- Dali::Actor found = actor.FindChildByName( nameNode->GetString() );
- if( found )
- {
- SetProperties( (*iterSubStyle).second, found, *this, replacement );
- }
- else
- {
- DALI_SCRIPT_VERBOSE("Cannot find object '%s' in tree to style\n", nameNode->GetString());
- }
- }
- else
- {
- DALI_SCRIPT_VERBOSE("Style name is not a string '%s' '%d'\n",
- nameNode->GetString(), (*iterSubStyle).second.GetType());
- }
- }
- }
- else
- {
- DALI_SCRIPT_VERBOSE("Cannot apply style list to non actor\n");
- }
- }
- else
- {
- DALI_ASSERT_DEBUG( (*iter)->GetType() == TreeNode::OBJECT );
- SetProperties( *style, handle, *this, replacement );
- }
- }
- }
- else
- {
- DALI_SCRIPT_WARNING("Could not find style:%s\n", styleName.c_str());
- }