Exemplo n.º 1
0
void MouseArea::OnReleased(uint32 msg_id, uint32 param1, uint32 param2)
{
	int xPos = LOWORD(param2);
	int yPos = HIWORD(param2);
	if (isInside(xPos, yPos))
		GetEventMgr()->Invoke(GetID(), "Released", YY::VarList() << xPos<<yPos);
}
Exemplo n.º 2
0
NS_YY_BEGIN


void TreeViewModel::SetRoot(YY_OBJECTID id)
{
	m_root = id;
	GetEventMgr()->Invoke(GetID(), "DataChanged");
}
Exemplo n.º 3
0
ccsCOMPL_STAT wsf2ex1APPLICATION::Init(int argCount, char *arg[])
{
    wsf2libLOG_TRACE();
    ErrReset();


    // Turn off logging of warning on EXIT command
    evhTASK::LogExitWarning(FALSE);

    // Parses the command line arguments
    // and extract the configuration parameters
    // for ENV NAME, DB POINT and PROC NAME from the
    // command line or from the enviroment variables
    if (EvaluateArgs(argCount, arg, wsf2ex1DB_ROOT_POINT) == FAILURE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_INIT, __FILE_LINE__, "wrong argument(s)");
	return FAILURE;
	}

    // Initialize CCS and connect to database
    if(InitCCS() == FAILURE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_INIT, __FILE_LINE__, "cannot init CCS");
	return FAILURE;      
	}

    // Logs current startup configuration
    eccsLOG_1(("%s - Application started (proc name: %s, DB root point: %s)", 
	       GetProcName(), GetProcName(), GetDbRoot()));
    logData(wsf2ex1MOD,"%s - Application started (proc name: %s, DB root point: %s)", 
	    GetProcName(), GetProcName(), GetDbRoot());

   /*
    * Create factory for ACTIONS, DATA, CONFIG and CONTROL
    */
    wsf2libASSERT(mActionMgr == NULL);
    mActionMgr = new wsf2ex1ACTION_MGR(GetDbRoot(), argCount, arg, GetEventMgr());
    if (mActionMgr == NULL)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_FATAL, __FILE_LINE__, "no memory for allocating wsf2ex1ACTION_MGR");
	return FAILURE;
	}
    if (wsf2libHELPER::ObjectOk(mActionMgr, "ACTION_MGR") == ccsFALSE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_CREATE, __FILE_LINE__, "wsf2ex1ACTION_MGR");
	return FAILURE;	
	}

    /*
     * Set FSM context
     * TBD: rename method
     */
    SetControl(mActionMgr->GetControl());

    /*
     * Instantiate events and actions
     */
    if (CreateEvents(wsf2ex1EVENTS_FILENAME) == FAILURE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_CREATE, __FILE_LINE__, "Events");
	return FAILURE;	
	}
    if (mActionMgr->CreateActions() == FAILURE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_CREATE, __FILE_LINE__, "Actions");
	return FAILURE;	
	}
    /*
     * Load SCXML Model
     */
    if (LoadModel(wsf2ex1MODEL_FILENAME, mActionMgr->SCXMLGetActions(), mActionMgr->SCXMLGetActivities()) == FAILURE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_FATAL, __FILE_LINE__, "cannot load SCXML model");
	return FAILURE;
	}

    /*
     * Initialize all events and actions and data structures
     */
    if (mActionMgr->Init() == FAILURE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_FATAL, __FILE_LINE__, "initializing actions and data structures");
	return FAILURE;
	}

    /*
     * Start the execution of SCXML model
     */
    if (StartModel() == FAILURE)
	{
	errAdd(wsf2ex1MOD, wsf2ex1ERR_FATAL, __FILE_LINE__, "cannot start SCXML model execution");
	return FAILURE;
	}

    return SUCCESS;
} 
Exemplo n.º 4
0
void ScrollView::SetModel(BaseObject* pModel)
{
	m_pModel = pModel;
	GetEventMgr()->Disconnect(pModel->GetID(), "DataChanged", fastdelegate::MakeDelegate(this, &ScrollView::onEvent_DataChanged));
	GetEventMgr()->Connect(pModel->GetID(), "DataChanged", fastdelegate::MakeDelegate(this, &ScrollView::onEvent_DataChanged));
}