void CFlashUIConstraintsNode::ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
{
    if ( event == eFE_Initialize )
    {
        UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
    }
    else if ( event == eFE_Activate )
    {
        if ( IsPortActive( pActInfo, eI_UIElement ) )
        {
            UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
        }

        const int instanceId = GetPortInt( pActInfo, eI_InstanceID );
        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            IUIElement::SUIConstraints constraints;
            SPerInstanceCall1< IUIElement::SUIConstraints& > caller;
            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIConstraintsNode::GetConstraints), constraints, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" can't get Constraints for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str() ,instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) );
            }
            ActivateOutput( pActInfo, eO_PosType, (int) constraints.eType );
            ActivateOutput( pActInfo, eO_Left, constraints.iLeft );
            ActivateOutput( pActInfo, eO_Top, constraints.iTop );
            ActivateOutput( pActInfo, eO_Width, constraints.iWidth );
            ActivateOutput( pActInfo, eO_Height, constraints.iHeight );
            ActivateOutput( pActInfo, eO_Scale, constraints.bScale );
            ActivateOutput( pActInfo, eO_HAlign, (int) constraints.eHAlign );
            ActivateOutput( pActInfo, eO_VAlign, (int) constraints.eVAlign );
            ActivateOutput( pActInfo, eO_Maximize, constraints.bMax );
            ActivateOutput( pActInfo, eO_OnGet, true );
        }

        if ( IsPortActive( pActInfo, eI_Set ) )
        {
            IUIElement::SUIConstraints constraints;
            constraints.eType = (IUIElement::SUIConstraints::EPositionType) GetPortInt( pActInfo, eI_PosType );
            constraints.iLeft = GetPortInt( pActInfo, eI_Left );
            constraints.iTop = GetPortInt( pActInfo, eI_Top );
            constraints.iWidth = GetPortInt( pActInfo, eI_Width );
            constraints.iHeight = GetPortInt( pActInfo, eI_Height );
            constraints.eHAlign = (IUIElement::SUIConstraints::EPositionAlign) GetPortInt( pActInfo, eI_HAlign );
            constraints.eVAlign = (IUIElement::SUIConstraints::EPositionAlign) GetPortInt( pActInfo, eI_VAlign );
            constraints.bScale = GetPortBool( pActInfo, eI_Scale );
            constraints.bMax = GetPortBool( pActInfo, eI_Maximize );

            SPerInstanceCall1< const IUIElement::SUIConstraints& > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIConstraintsNode::SetConstraints), constraints);

            ActivateOutput( pActInfo, eO_OnSet, true );
        }
    }
}
示例#2
0
void CFlashUIMCTemplateRemoveNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	if (event == eFE_Initialize)
	{
		UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
	}
	else if (event == eFE_Activate)
	{
		if (IsPortActive( pActInfo, eI_UIElement ))
		{
			UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
		}

		if (!UpdateTmplDesc( GetPortString( pActInfo, eI_TemplateInstanceName ), pActInfo ))
			return;

		if (GetElement() && IsPortActive(pActInfo, eI_Remove))
		{
			const int instanceId = GetPortInt( pActInfo, eI_InstanceID );

			SPerInstanceCall1< const SUIMovieClipDesc* > caller;
			caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIMCTemplateRemoveNode::RemoveMoviclip), GetTmplDesc(true), false);

			ActivateOutput( pActInfo, eO_OnRemove, true );
		}
	}

}
示例#3
0
void CFlashUIVariableBaseNode::ProcessEvent( EFlowEvent event, SActivationInfo* pActInfo )
{
	if (event == eFE_Initialize)
	{
		UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIVariable)), pActInfo, m_isTemplate );
	}
	else if (event == eFE_Activate)
	{
		if (IsPortActive( pActInfo, GetInputPort(eI_UIVariable)))
		{
			UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIVariable)), pActInfo, m_isTemplate );
		}

		if (IsTemplate() && !UpdateTmplDesc( GetPortString( pActInfo, GetInputPort(eI_TemplateInstanceName)), pActInfo ))
			return;

		const int instanceId = GetPortInt( pActInfo, GetInputPort(eI_InstanceID));
		if (IsPortActive ( pActInfo, GetInputPort(eI_Set)))
		{
			const TFlowInputData &data = GetPortAny( pActInfo, GetInputPort(eI_Value));
			TUIData               value;
			ConvertToUIData(data, value, pActInfo);

			SPerInstanceCall1< const TUIData & > caller;
			caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIVariableBaseNode::SetVariable), value );

			ActivateOutput( pActInfo, eO_OnSet, true );
		}
		if (IsPortActive( pActInfo, GetInputPort(eI_Get)))
		{
			TUIData out;

			SPerInstanceCall1< TUIData & > caller;
			if (!caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIVariableBaseNode::GetVariable), out, false ))
			{
				UIACTION_WARNING( "FG: UIElement \"%s\" called get Variable for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetElement()->GetName(),instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));
			}

			string res;
			out.GetValueWithConversion( res );
			ActivateOutput( pActInfo, eO_Value, res );
		}
	}

}
示例#4
0
void CFlashUIArrayBaseNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	if (event == eFE_Initialize)
	{
		UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIArray)), pActInfo, m_isTemplate );
	}
	else if (event == eFE_Activate)
	{
		if (IsPortActive( pActInfo, GetInputPort(eI_UIArray)))
		{
			UpdateObjectDesc( GetPortString( pActInfo, GetInputPort(eI_UIArray)), pActInfo, m_isTemplate );
		}

		if (IsTemplate() && !UpdateTmplDesc( GetPortString( pActInfo, GetInputPort(eI_TemplateInstanceName)), pActInfo ))
			return;

		if (GetElement())
		{
			const int instanceId = GetPortInt( pActInfo, GetInputPort(eI_InstanceID));
			if (IsPortActive ( pActInfo, GetInputPort(eI_Set)))
			{
				SUIArguments values( GetPortString( pActInfo, GetInputPort(eI_Value)).c_str());

				SPerInstanceCall1< const SUIArguments & > caller;
				caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIArrayBaseNode::SetArray), values );

				ActivateOutput( pActInfo, eO_OnSet, true );
			}
			else if (IsPortActive( pActInfo, GetInputPort(eI_Get)))
			{
				SUIArguments out;

				SPerInstanceCall1< SUIArguments & > caller;
				if (!caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIArrayBaseNode::GetArray), out, false ))
				{
					UIACTION_WARNING( "FG: UIElement \"%s\" called get Array for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetElement()->GetName(),instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ));
				}

				ActivateOutput( pActInfo, eO_Value, string( out.GetAsString()));
			}
		}
	}
}
void CFlashUILayerNode::ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
{
    if ( event == eFE_Initialize )
    {
        UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
    }
    else if ( event == eFE_Activate )
    {
        if ( IsPortActive( pActInfo, eI_UIElement ) )
        {
            UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
        }

        const int instanceId =  GetPortInt( pActInfo, eI_InstanceID );

        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            int layer = 0;

            SPerInstanceCall1< int& > caller;
            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUILayerNode::GetLayer), layer, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" called get layer for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str() ,instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) );
            }

            ActivateOutput( pActInfo, eO_Layer, layer );
            ActivateOutput( pActInfo, eO_OnGet, true );
        }

        if ( IsPortActive( pActInfo, eI_Set ) )
        {
            const int layer = GetPortInt( pActInfo, eI_Layer );

            SPerInstanceCall1< int > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUILayerNode::SetLayer), layer );

            ActivateOutput( pActInfo, eO_OnSet, true );
        }
    }
}
void CFlashUIDisplayConfigNode::ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
{
    if ( event == eFE_Initialize )
    {
        UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
    }
    else if ( event == eFE_Activate )
    {
        if ( IsPortActive( pActInfo, eI_UIElement ) )
        {
            UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
        }

        const int instanceId =  GetPortInt( pActInfo, eI_InstanceID );

        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            SPerInstanceCall1< SActivationInfo* > caller;
            if ( !caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayConfigNode::GetFromInstance), pActInfo, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" called get flags for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str() ,instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) );
            }
            ActivateOutput( pActInfo, eO_OnGet, true );
        }

        if ( IsPortActive( pActInfo, eI_Set ) )
        {
            const float alpha = GetPortFloat( pActInfo, eI_Alpha );
            const int layer = GetPortInt( pActInfo, eI_Layer );
            const uint64 flags = GetFlags( pActInfo );

            SPerInstanceCall3< uint64, float, int > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayConfigNode::SetToInstance), flags, alpha, layer );
            ActivateOutput( pActInfo, eO_OnSet, true );
        }
    }
}
void CFlashUIDisplayNode::ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
{
    if ( event == eFE_Initialize )
    {
        UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
    }
    else if ( event == eFE_Activate )
    {
        if ( IsPortActive( pActInfo, eI_UIElement ) )
        {
            UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
        }

        const int instanceId = GetPortInt( pActInfo, eI_InstanceID );

        if ( IsPortActive( pActInfo, eI_Show ) )
        {
            SPerInstanceCall1< bool > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::SetVisible), true);
            ActivateOutput( pActInfo, eO_OnShow, true );
        }

        if ( IsPortActive( pActInfo, eI_Hide ) )
        {
            SPerInstanceCall1< bool > caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::SetVisible), false);
            ActivateOutput( pActInfo, eO_OnHide, true );
        }

        if ( IsPortActive( pActInfo, eI_Unload ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::Unload));
            ActivateOutput( pActInfo, eO_OnUnload, true );
        }

        if ( IsPortActive( pActInfo, eI_RequestHide ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::RequestHide));
            ActivateOutput( pActInfo, eO_OnRequestHide, true );
        }

        if ( IsPortActive( pActInfo, eI_Init ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::Init));
            ActivateOutput( pActInfo, eO_OnInit, true );
        }

        if ( IsPortActive( pActInfo, eI_Reload ) )
        {
            SPerInstanceCall0 caller;
            caller.Execute( GetElement(), instanceId, functor(*this, &CFlashUIDisplayNode::Reload));
            ActivateOutput( pActInfo, eO_OnReload, true );
        }

        if ( IsPortActive( pActInfo, eI_UnloadBootstrapper ) )
        {
            if (GetElement()) GetElement()->UnloadBootStrapper();
            ActivateOutput( pActInfo, eO_OnUnloadBootstrapper, true );
        }

        if ( IsPortActive( pActInfo, eI_ReloadBootstrapper ) )
        {
            if (GetElement()) GetElement()->ReloadBootStrapper();
            ActivateOutput( pActInfo, eO_OnReloadBootstrapper, true );
        }
    }
}