// Signal Actions
//
-// Action on child actor. The child is found by alias so can be 'previous' etc.
+// Action on child actor. The child is found by name
struct ChildActorAction
{
std::string actorName;
std::string actionName;
- std::string childAlias;
+ std::string childName;
PropertyValueContainer parameters;
void operator()(void)
if(actor)
{
- Actor child_actor = actor.FindChildByAlias(childAlias);
+ Actor child_actor = actor.FindChildByName(childName);
if(child_actor)
{
}
else
{
- DALI_SCRIPT_WARNING("Could not find child by alias '%s'\n", childAlias.c_str());
+ DALI_SCRIPT_WARNING("Could not find child by name '%s'\n", childName.c_str());
}
}
};
{
ChildActorAction action;
action.actorName = *actorName;
- action.childAlias = *childActorName;
+ action.childName = *childActorName;
action.actionName = *actionName;
GetParameters(child, action.parameters);
callback = action;
return false; // Do not consume
}
-Actor Control::GetChildByAlias(const std::string& actorAlias)
-{
- return Actor();
-}
-
void Control::OnStageConnection()
{
RelayoutRequest();
*/
virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
- /**
- * @copydoc Dali::CustomActorImpl::GetChildByAlias(const std::string& actorAlias)
- */
- virtual Actor GetChildByAlias(const std::string& actorAlias);
-
// From CustomActorImpl, derived classes should NOT override these.
/**
}
/**
- * Search through this actor's hierarchy for an actor with the given name or alias.
- *
- * Actors can customize this function to provide actors with preferred alias'
- * For example 'previous' could return the last selected child.
- * If no aliased actor is found then FindChildByName() is called.
- *
- * @for Actor
- * @method findChildByAlias
- * @param {String} actor alias
- * @return {Object} actor on success, empty actor handle if not found
- */
-void ActorApi::FindChildByAlias( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
- v8::Isolate* isolate = args.GetIsolate();
- v8::HandleScope handleScope( isolate );
- Actor parent = GetActor( isolate, args );
- bool found( false );
- std::string name = V8Utils::GetStringParameter( PARAMETER_0, found, isolate, args );
- if( !found )
- {
- DALI_SCRIPT_EXCEPTION( isolate, "String parameter not found" );
- return;
- }
- Actor childActor = parent.FindChildByAlias( name );
- if( childActor )
- {
- // wrap the child
- v8::Local < v8::Object > wrappedLayer = ActorWrapper::WrapActor( isolate, childActor );
- args.GetReturnValue().Set( wrappedLayer );
- }
-}
-
-/**
* Search through this actor's hierarchy for an actor with the given unique ID.
* The actor itself is also considered in the search
*
void Unparent( const v8::FunctionCallbackInfo< v8::Value >& args);
void GetChildAt( const v8::FunctionCallbackInfo< v8::Value >& args);
void FindChildByName( const v8::FunctionCallbackInfo< v8::Value >& args);
- void FindChildByAlias( const v8::FunctionCallbackInfo< v8::Value >& args);
void FindChildById( const v8::FunctionCallbackInfo< v8::Value >& args);
void GetParent( const v8::FunctionCallbackInfo< v8::Value >& args );
void GetChildCount( const v8::FunctionCallbackInfo< v8::Value >& args );
{ "GetChildCount", ActorApi::GetChildCount, ACTOR_API },
{ "GetChildAt" , ActorApi::GetChildAt, ACTOR_API },
{ "FindChildByName", ActorApi::FindChildByName, ACTOR_API },
- { "FindChildByAlias", ActorApi::FindChildByAlias, ACTOR_API },
{ "FindChildById", ActorApi::FindChildById, ACTOR_API },
{ "GetParent" , ActorApi::GetParent, ACTOR_API },
{ "GetActorType" , ActorApi::GetActorType, ACTOR_API }, // custom for javascript