- baseHandle = typeInfo.CreateInstance();
- Handle handle = Handle::DownCast(baseHandle);
- Actor actor = Actor::DownCast(handle);
-
- if(handle)
- {
-
- DALI_SCRIPT_VERBOSE("Create:%s\n", typeInfo.GetName().c_str());
-
-#if defined(DEBUG_ENABLED)
- if(handle)
- {
- DALI_SCRIPT_VERBOSE(" Is Handle Object=%d\n", (long*)handle.GetObjectPtr());
- DALI_SCRIPT_VERBOSE(" Is Handle Property Count=%d\n", handle.GetPropertyCount());
- }
-
- if(actor)
- {
- DALI_SCRIPT_VERBOSE(" Is Actor id=%d\n", actor.GetId());
- }
-
- Toolkit::Control control = Toolkit::Control::DownCast(handle);
- if(control)
- {
- DALI_SCRIPT_VERBOSE(" Is Control id=%d\n", actor.GetId());
- }
-#endif // DEBUG_ENABLED
-
- if( templateNode )
- {
- ApplyProperties( root, *templateNode, handle, replacements );
-
- if( OptionalChild actors = IsChild( *templateNode, KEYNAME_ACTORS ) )
- {
- for( TreeConstIter iter = (*actors).CBegin(); iter != (*actors).CEnd(); ++iter )
- {
- DoCreate( root, (*iter).second, actor, replacements );
- }
- }
- }
-
- if( actor )
- {
- // add children of all the styles
- if( OptionalChild actors = IsChild( node, KEYNAME_ACTORS ) )
- {
- for( TreeConstIter iter = (*actors).CBegin(); iter != (*actors).CEnd(); ++iter )
- {
- DoCreate( root, (*iter).second, actor, replacements );
- }
- }
-
- // apply style on top as they need the children to exist
- ApplyAllStyleProperties( root, node, actor, replacements );
-
- // then add to parent
- if( parent )
- {
- parent.Add( actor );
- }
- }
- else
- {
- ApplyProperties( root, node, handle, replacements );
- }
- }
- else
- {
- DALI_SCRIPT_WARNING("Cannot create handle from type '%s'\n", typeInfo.GetName().c_str());
- }