示例#1
0
void CFlashUIActionNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
	switch (event)
	{
	case eFE_Initialize:
		m_bWasStarted = false;
		m_startStack.clear();
		m_endStack.clear();
		m_selfEndStack.clear();
		m_startStack.init(pActInfo->pGraph);
		m_endStack.init(pActInfo->pGraph);
		m_selfEndStack.init(pActInfo->pGraph);
		UpdateAction(GetPortString(pActInfo, eI_UIAction).c_str(), GetPortBool(pActInfo, eI_Strict));
		pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
		break;
	case eFE_Activate:
		UpdateAction(GetPortString(pActInfo, eI_UIAction).c_str(), GetPortBool(pActInfo, eI_Strict));

		if (gEnv->pFlashUI && m_pAction)
		{
			if (IsPortActive(pActInfo, eI_StartAction))
			{
				SUIArguments args(GetPortString(pActInfo, eI_Args).c_str(), true);
				gEnv->pFlashUI->GetUIActionManager()->StartAction(m_pAction, args);
				ActivateOutput(pActInfo, eO_UIOnStart, true);
				m_bWasStarted = true;
			}
		}
		break;
	case eFE_Update:
		FlushNextAction(pActInfo);
		break;
	}
}
示例#2
0
	void Plugin::handleBatteryInfo (BatteryInfo info)
	{
		if (!Battery2Action_.contains (info.ID_))
		{
			QAction *act = new QAction (tr ("Battery status"), this);
			act->setProperty ("WatchActionIconChange", true);
			act->setProperty ("Liznoo/BatteryID", info.ID_);

			act->setProperty ("Action/Class", GetUniqueID () + "/BatteryAction");
			act->setProperty ("Action/ID", GetUniqueID () + "/" + info.ID_);

			emit gotActions (QList<QAction*> () << act, AEPLCTray);
			Battery2Action_ [info.ID_] = act;

			connect (act,
					SIGNAL (triggered ()),
					this,
					SLOT (handleHistoryTriggered ()));
		}

		UpdateAction (info);
		CheckNotifications (info);

		Battery2LastInfo_ [info.ID_] = info;
	}
void CCopasiSpringLayout::addCompartmentVariables(CLCompartmentGlyph* cg)
{
  if (!cg)
    return;

  VariableDescription desc;
  desc.isAngle = false;

  int first_index = mInitialState.size();

  //x position
  mInitialState.push_back(cg->getX());
  mVarDescription.push_back(desc);
  mMassVector.push_back(0.01);

  //y position
  mInitialState.push_back(cg->getY());
  mVarDescription.push_back(desc);
  mMassVector.push_back(0.01);

  //width
  mInitialState.push_back(cg->getWidth());
  mVarDescription.push_back(desc);
  mMassVector.push_back(0.01);

  //height
  mInitialState.push_back(cg->getHeight());
  mVarDescription.push_back(desc);
  mMassVector.push_back(0.01);

  mUpdateActions.push_back(UpdateAction(UpdateAction::COMPARTMENT_4V, cg, first_index, first_index + 1, first_index + 2, first_index + 3));
}
示例#4
0
void ObjectDock::CurrentChanged(const QModelIndex& idx,const QModelIndex&){
    UpdateAction();
    if(idx.isValid())
    {
        Preview(mpModel->filePath(idx));
    }
}
示例#5
0
void ColorPusher::NewColor()
{
	if(track) {
		color = colors.Get();
		UpdateAction();
	}
}
示例#6
0
void ColorPusher::CloseColors()
{
	push = false;
	if(color != saved_color) {
		color = saved_color;
		UpdateAction();
	}
	Refresh();
}
示例#7
0
void LogPosCtrl::OnReject()
{
	push = false;
	Ctrl::LogPos _pos = lc.Get();
	if(pos != _pos) {
		pos = _pos;
		OnSizeChange(); //restore
		UpdateAction();
	}
}
示例#8
0
stateResult_t rvMonsterStroggHover::State_CircleStrafe ( const stateParms_t& parms ) {
	if ( circleStrafing ) {
		// Perform actions along the way
		if ( UpdateAction ( ) ) {
			return SRESULT_WAIT;
		}
		return SRESULT_WAIT;
	}
	SetState( "State_Combat" );
	return SRESULT_DONE;
}
示例#9
0
void EffectDock::SetPath(const QString& path){
    mPath = path;
    if(mPath.isEmpty()){
        ui.tree->setModel(NULL);
        ui.tree->setContextMenuPolicy(Qt::NoContextMenu);
    }else if(ui.tree->model()==NULL){
        ui.tree->setModel(mpModel);
        ui.tree->setRootIndex(mpModel->setRootPath(mPath));
        ui.tree->setContextMenuPolicy(Qt::ActionsContextMenu);
        InitView();
    }else{
        ui.tree->setRootIndex(mpModel->setRootPath(mPath));
        //hack: setRootIndex时,并不会改变CurrentIndex,需要自己设置一个无效的CurrentIndex,
        //这应该是Qt的bug。
        ui.tree->setCurrentIndex(QModelIndex());
    }
    UpdateAction();
}
示例#10
0
END_CLASS_STATES

/*
================
rvMonsterTurret::State_Combat
================
*/
stateResult_t rvMonsterTurret::State_Combat ( const stateParms_t& parms ) {
	// Aquire a new enemy if we dont have one
	if ( !enemy.ent ) {
		CheckForEnemy ( true );
	}

	FaceEnemy ( );
			
	// try moving, if there was no movement run then just try and action instead
	UpdateAction ( );
	
	return SRESULT_WAIT;
}
示例#11
0
void CFlashUIStartActionNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
	switch ( event )
	{
	case eFE_Initialize:
		UpdateAction( pActInfo->pGraph );
		m_stack.clear();
		m_stack.init( pActInfo->pGraph );
		if (m_pAction)
		{
			CRY_ASSERT_MESSAGE( gEnv->pFlashUI, "No FlashUI extension available!" );
			pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
			if (GetPortBool(pActInfo, eI_UseAsState))
				gEnv->pFlashUI->GetUIActionManager()->EnableAction( m_pAction, false );
		}
		break;
	case eFE_Update:
		FlushNextAction( pActInfo );
		break;
	}
}
示例#12
0
void CFlashUIEndActionNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
	switch ( event )
	{
	case eFE_Initialize:
		UpdateAction( pActInfo->pGraph );
		break;
	case eFE_Activate:
		if ( gEnv->pFlashUI && m_pAction && IsPortActive( pActInfo, eI_OnActionEnd) )
		{
			SUIArguments args( GetPortString( pActInfo, eI_Args).c_str(), true );
			gEnv->pFlashUI->GetUIActionManager()->EndAction( m_pAction, args );

			if (GetPortBool(pActInfo, eI_UseAsState))
			{
				gEnv->pFlashUI->GetUIActionManager()->EnableAction( m_pAction, false );
			}
		}
		break;
	}
}
示例#13
0
void CCopasiSpringLayout::addReactionVariables(CLReactionGlyph* rg)
{
  if (!rg)
    return;

  VariableDescription desc;
  desc.isAngle = false;

  int first_index = mInitialState.size();

  C_FLOAT64 xxx, yyy;

  //first look if the glyph is described by a curve
  if (rg->getCurve().getNumCurveSegments())
    {
      unsigned int numsegs = rg->getCurve().getNumCurveSegments();
      xxx = 0.5 * (rg->getCurve().getCurveSegments()[0].getStart().getX()
                   + rg->getCurve().getCurveSegments()[numsegs - 1].getEnd().getX());
      yyy = 0.5 * (rg->getCurve().getCurveSegments()[0].getStart().getY()
                   + rg->getCurve().getCurveSegments()[numsegs - 1].getEnd().getY());
    }
  else
    {
      xxx = rg->getX() + 0.5 * rg->getWidth();
      yyy = rg->getY() + 0.5 * rg->getHeight();
    }

  //x position
  mInitialState.push_back(xxx);
  mVarDescription.push_back(desc);
  mMassVector.push_back(1.0);

  //y position
  mInitialState.push_back(yyy);
  mVarDescription.push_back(desc);
  mMassVector.push_back(1.0);

  mUpdateActions.push_back(UpdateAction(UpdateAction::REACTION_2V, rg, first_index, first_index + 1));
}
示例#14
0
void ObjectDock::SetPath(const QString &path)
{
     mPath = path;
    if(mPath.isEmpty())
    {
        ui->tree->setModel(NULL);
        ui->tree->setContextMenuPolicy(Qt::NoContextMenu);
    }
    else if(ui->tree->model() == NULL)
    {
        ui->tree->setModel(mpModel);
        ui->tree->setRootIndex(mpModel->setRootPath(mPath));
        ui->tree->setContextMenuPolicy(Qt::ActionsContextMenu);
        InitView();
    }
    else
    {
        ui->tree->setRootIndex(mpModel->setRootPath(mPath));
        ui->tree->setCurrentIndex(QModelIndex());
    }
    UpdateAction();
}
示例#15
0
void CCopasiSpringLayout::addSpeciesVariables(CLMetabGlyph* mg)
{
  if (!mg)
    return;

  bool side = false; //TODO: find out if it is a side reactant

  VariableDescription desc;
  desc.isAngle = false;

  int first_index = mInitialState.size();

  //x position
  mInitialState.push_back(mg->getX());
  mVarDescription.push_back(desc);
  mMassVector.push_back(side ? 0.1 : 1.0);

  //y position
  mInitialState.push_back(mg->getY());
  mVarDescription.push_back(desc);
  mMassVector.push_back(side ? 0.1 : 1.0);

  mUpdateActions.push_back(UpdateAction(UpdateAction::SPECIES_2V, mg, first_index, first_index + 1));
}
示例#16
0
void CCopasiSpringLayout::addPositionVariables(CLGraphicalObject* pGO)
{
  if (!pGO)
    return;

  bool side = false; //TODO: find out if it is a side reactant

  VariableDescription desc;
  desc.isAngle = false;

  int first_index = mInitialState.size();

  //x position
  mInitialState.push_back(pGO->getX());
  mVarDescription.push_back(desc);
  mMassVector.push_back(side ? 0.1 : 1.0);

  //y position
  mInitialState.push_back(pGO->getY());
  mVarDescription.push_back(desc);
  mMassVector.push_back(side ? 0.1 : 1.0);

  mUpdateActions.push_back(UpdateAction(UpdateAction::POSITION_2V, pGO, first_index, first_index + 1));
}
示例#17
0
void LogPosPopUp::XaCB()
{
	pos.x.SetA(xa);
	WhenSizeChange();
	UpdateAction();
}
示例#18
0
void LogPosPopUp::XbCB()
{
	pos.x.SetB(xb);
	WhenSizeChange();
	UpdateAction();
}
示例#19
0
void LogPosPopUp::YaCB()
{
	pos.y.SetA(ya);
	WhenSizeChange();
	UpdateAction();
}
示例#20
0
void EffectDock::Init(){
    InitAction();
    UpdateAction();
}
示例#21
0
void EffectDock::CurrentChanged(const QModelIndex&,const QModelIndex&){
    UpdateAction();
}
示例#22
0
void LogPosPopUp::YbCB()
{
	pos.y.SetB(yb);
	WhenSizeChange();
	UpdateAction();
}
示例#23
0
void ObjectDock::Init(){
    InitAction();
    UpdateAction();
}
示例#24
0
void LogPosCtrl::OnAction()
{
	pos = lc.Get();
	UpdateAction();
}
示例#25
0
void RGBACtrl::Alpha()
{
	SyncText();
	UpdateAction();
}
示例#26
0
bool DocEdit::Key(dword key, int cnt)
{
	NextUndo();
	bool h;
	int q;
	bool select = key & K_SHIFT;
	int pgsk = max(8, 6 * GetSize().cy / 8);
	switch(key & ~K_SHIFT) {
	case K_CTRL_LEFT:
		PlaceCaret(GetPrevWord(cursor), select);
		break;
	case K_CTRL_RIGHT:
		PlaceCaret(GetNextWord(cursor), select);
		break;
	case K_HOME:
		HomeEnd(0, select);
		break;
	case K_END:
		HomeEnd(cx, select);
		break;
	case K_CTRL_HOME:
	case K_CTRL_PAGEUP:
		PlaceCaret(0, select);
		break;
	case K_CTRL_END:
	case K_CTRL_PAGEDOWN:
		PlaceCaret(total, select);
		break;
	case K_UP:
		if(GetCursor() == 0)
			return !updownleave;
		VertMove(-8, select, false);
		return true;
	case K_DOWN:
		if(GetCursor() == GetLength())
			return !updownleave;
		VertMove(8, select, false);
		return true;
	case K_PAGEUP:
		VertMove(-pgsk, select, true);
		return true;
	case K_PAGEDOWN:
		VertMove(pgsk, select, true);
		return true;
	case K_LEFT:
		if(cursor)
			PlaceCaret(cursor - 1, select);
		break;
	case K_RIGHT:
		if(cursor < total)
			PlaceCaret(cursor + 1, select);
		break;
	default:
		if(IsReadOnly()) return MenuBar::Scan(WhenBar, key);
		switch(key) {
		case K_BACKSPACE:
		case K_SHIFT|K_BACKSPACE:
			if(RemoveSelection()) break;
			if(cursor == 0) return true;
			cursor--;
			Remove(cursor, 1);
			break;
		case K_CTRL_BACKSPACE:
			if(RemoveSelection()) break;
			if(cursor <= 0) return true;
			q = cursor - 1;
			h = IsLetter(GetChar(q));
			while(q > 0 && IsLetter(GetChar(q - 1)) == h) q--;
			Remove(q, cursor - q);
			SetCursor(q);
			break;
		case K_DELETE:
			if(RemoveSelection()) break;
			if(cursor >= total) return true;
			if(cursor < total)
				Remove(cursor, 1);
			break;
		case K_CTRL_DELETE:
			if(RemoveSelection()) break;
			if(cursor >= total) return true;
			q = cursor;
			h = IsLetter(GetChar(q));
			while(IsLetter(GetChar(q)) == h && q < total) q++;
			Remove(cursor, q - cursor);
			break;
		case K_ENTER:
			if(!processenter)
				return true;
			key = '\n';
		default:
			if(filter && key >= 32 && key < 65535)
				key = (*filter)(key);
			if(key >= ' ' && key < 65536 || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) {
				if(key == K_TAB && !processtab)
					return false;
				if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM)
				   && FromUnicode((wchar)key, charset) == DEFAULTCHAR)
					return true;
				RemoveSelection();
				Insert(cursor, WString(key == K_SHIFT_SPACE ? ' ' : key, cnt), true);
				cursor += cnt;
				break;
			}
			return MenuBar::Scan(WhenBar, key);
		}
		UpdateAction();
	}
	PlaceCaret(true);
	return true;
}