void CGUIPanelContainer::OnLeft() { CGUIAction action = GetAction(ACTION_MOVE_LEFT); bool wrapAround = action.GetNavigation() == GetID() || !action.HasActionsMeetingCondition(); if (m_orientation == VERTICAL && MoveLeft(wrapAround)) return; if (m_orientation == HORIZONTAL && MoveUp(wrapAround)) return; CGUIControl::OnLeft(); }
void CGUIPanelContainer::OnDown() { CGUIAction action = GetAction(ACTION_MOVE_DOWN); bool wrapAround = action.GetNavigation() == GetID() || !action.HasActionsMeetingCondition(); if (m_orientation == VERTICAL && MoveDown(wrapAround)) return; if (m_orientation == HORIZONTAL && MoveRight(wrapAround)) return; return CGUIControl::OnDown(); }
void SDLInput::OnTick(const natU64 _dt) { SDL_Event event; while ( SDL_PollEvent(&event) ) { switch (event.type) { case SDL_QUIT: GetEntity()->GetKernel()->SetShutdown(); break; case SDL_KEYDOWN: { SDLKey key = event.key.keysym.sym; Input::eAction action = GetAction(static_cast<natU32>(key)); ChangeState(action, true); } break; case SDL_KEYUP: { SDLKey key = event.key.keysym.sym; Input::eAction action = GetAction(static_cast<natU32>(key)); ChangeState(action, false); } break; case SDL_MOUSEBUTTONDOWN: { natU8 button = event.button.button; Input::eAction action = GetAction(static_cast<natU8>(button)); ChangeState(action, true); } break; case SDL_MOUSEBUTTONUP: { natU8 button = event.button.button; Input::eAction action = GetAction(static_cast<natU8>(button)); ChangeState(action, false); } break; default: break; } } }
func Damage(int change, int cause) { if (cause == FX_Call_DmgBlast) { // Explosions knock the hoist off the rail if (GetAction() == "OnRail") DisengageRail(); if (pickup) DropVehicle(); } }
CPDF_Action CPDFSDK_BAAnnot::GetAAction(CPDF_AAction::AActionType eAAT) { CPDF_AAction AAction = GetAAction(); if (AAction.ActionExist(eAAT)) return AAction.GetAction(eAAT); if (eAAT == CPDF_AAction::ButtonUp) return GetAction(); return CPDF_Action(); }
//------------------------------------------------------------------------ int CScriptBind_UIAction::DisableAction( IFunctionHandler *pH, const char * actionName ) { IUIAction* pAction = GetAction( actionName ); if ( pAction ) { pAction->SetEnabled( false ); return pH->EndFunction( true ); } UIACTION_WARNING( "LUA: UIAction %s does not exist", actionName ); return pH->EndFunction( false ); }
void CGUIPanelContainer::OnRight() { CGUIAction action = GetAction(ACTION_MOVE_RIGHT); bool wrapAround = action.GetNavigation() == GetID() || !action.HasActionsMeetingCondition(); if (GetGlobalWrapDisable()) wrapAround = false; if (m_orientation == VERTICAL && MoveRight(wrapAround)) return; if (m_orientation == HORIZONTAL && MoveDown(wrapAround)) return; return CGUIControl::OnRight(); }
private func Wind2Turn() { // Zielobjekt verloren if (!GetActionTarget()) return(RemoveObject()); // Drehgeschwindigkeit var turn = BoundBy(GetWind()/20 +5, 1, 9); if(!(GetAction() eq Format("Turn%d", turn))) SetAction(Format("Turn%d", turn)); // Energieerzeugung DoEnergy(GetActMapVal("Delay", Format("Turn%d", turn))*30, GetActionTarget()); }
//------------------------------------------------------------------------ int CScriptBind_UIAction::RegisterActionListener( IFunctionHandler *pH, SmartScriptTable pTable, const char* actionName, const char* eventName, const char* callback ) { if (!pTable) { UIACTION_WARNING( "LUA: RegisterActionListener received non-valid script table!"); return pH->EndFunction( false ); } IUIAction* pAction = strlen(actionName) > 0 ? GetAction( actionName ) : NULL; m_ActionCallbacks.AddCallback(pTable, callback, SUILuaCallbackInfo<IUIAction>::CreateInfo(pAction, eventName ? eventName : "")); return pH->EndFunction(true); }
void CSinaSvr::OnDocumentComplete(CString URL) { SimpleBrowser::OnDocumentComplete(URL); if (GetAction() == ACT_LOGIN_SINA) { m_ActionStatus = SINA_LOGINING; CheckLoginStatus(URL); } }
//----------------------------------------------------------------------------- // Purpose: // Output : Returns true if changes were effected //----------------------------------------------------------------------------- bool CBaseActionWithStopTimeDialog::OnSaveChanges( void ) { bool bret = BaseClass::OnSaveChanges(); char stoptype[ 512 ]; m_pStopType->GetText( stoptype, sizeof( stoptype ) ); char stop[ 512 ]; m_pStop->GetText( stop, sizeof( stop ) ); float fstop = (float)atof( stop ); int istop = (int)atoi( stop ); if ( !Q_strcasecmp( stoptype, "TimeUseFrame" ) ) { if ( GetAction()->m_nStopFrame != istop ) { bret = true; GetAction()->SetStopFrame( istop ); GetAction()->SetStopTime( -1.0f ); } } else { if ( GetAction()->m_flStopTime != fstop ) { bret = true; GetAction()->SetStopTime( fstop ); GetAction()->SetStopFrame( -1 ); } } return bret; }
//----------------------------------------------------------------------------- // Purpose: // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CBaseActionTextMessageStartDialog::OnSaveChanges( void ) { bool bret = BaseClass::OnSaveChanges(); client_textmessage_t *tm = GetAction()->GetTextMessage(); bret |= SaveDifferingFloat( m_pFadeInTime, &tm->fadein ); bret |= SaveDifferingFloat( m_pFadeOutTime, &tm->fadeout ); bret |= SaveDifferingFloat( m_pHoldTime, &tm->holdtime ); bret |= SaveDifferingFloat( m_pFXTime, &tm->fxtime ); bret |= SaveDifferingFloat( m_pX, &tm->x ); bret |= SaveDifferingFloat( m_pY, &tm->y ); bret |= SaveDifferingColor( m_pColor1, &tm->r1, &tm->g1, &tm->b1, &tm->a1 ); bret |= SaveDifferingColor( m_pColor2, &tm->r2, &tm->g2, &tm->b2, &tm->a2 ); char sz[ 1024 ]; m_pEffectType->GetText( sz, sizeof( sz ) ); int iEffect = EffectTypeForName( sz ); if ( iEffect != tm->effect ) { tm->effect = iEffect; bret = true; } m_pMessageText->GetText( sz, sizeof( sz ) ); if ( Q_strcasecmp( sz, GetAction()->GetMessageText() ) ) { GetAction()->SetMessageText( sz ); bret = true; } m_pFontName->GetText( sz, sizeof( sz ) ); if ( Q_strcasecmp( sz, GetAction()->GetFontName() ) ) { GetAction()->SetFontName( sz ); bret = true; } return bret; }
//----------------------------------------------------------------------------- // Purpose: // Output : Returns true if changes were effected //----------------------------------------------------------------------------- bool CBaseActionSkipAheadDialog::OnSaveChanges( void ) { bool bret = BaseClass::OnSaveChanges(); char skiptype[ 512 ]; m_pSkipType->GetText( skiptype, sizeof( skiptype ) ); char skipto[ 512 ]; m_pSkip->GetText( skipto, sizeof( skipto ) ); float fskip = (float)atof( skipto ); int iskip = (int)atoi( skipto ); if ( !Q_strcasecmp( skiptype, "TimeUseTick" ) ) { if ( GetAction()->m_nSkipToTick != iskip ) { bret = true; GetAction()->SetSkipToTick( iskip ); GetAction()->SetSkipToTime( -1.0f ); } } else { if ( GetAction()->m_flSkipToTime != fskip ) { bret = true; GetAction()->SetSkipToTime( fskip ); GetAction()->SetSkipToTick( -1 ); } } return bret; }
/// @brief Add a key for the specified action. /// /// @param _sKey Input key (need to be a valid key). /// @param _sAction Action name. void CActionMap::AddKey(const String &_sKey, const String &_sAction) { EKey eKey = GetKeyFromString(_sKey); if(eKey < K_Nb) { // Get the action SAction *pAction = GetAction(_sAction); if(pAction != 0) m_aActionMap.insert(ActionMap::value_type(eKey, pAction)); } else SamLogWarning("Unable to find key '%s' for the action '%s'", _sKey, _sAction); }
func Check() { var clnk; if(GetAction()S="Falling") return(Falling()); while(clnk=FindObject(0,-25,0,50,100,OCF_CrewMember(),0,0,0,clnk)) if(GetAlive(clnk) && !Random(2)) { Sound("Earthquake"); SetAction("Falling"); SetPhase(phase); RemoveVertex(0); RemoveVertex(0); } }
std::string CalendarAction::GetDebugString() const { std::ostringstream data; data << "CalendarAction::" << " Action: " << GetAction() << " Guid: " << GetPlayer()->GetGUID() << " Invite Id: " << GetInviteId() << " Extra data: " << GetExtraData() << " Event: " << Event.GetDebugString() << " Invite: " << Invite.GetDebugString(); return data.str(); }
void CGUIBaseContainer::OnRight() { CGUIAction action = GetAction(ACTION_MOVE_RIGHT); bool wrapAround = action.GetNavigation() == GetID() || !action.HasActionsMeetingCondition(); if (m_orientation == HORIZONTAL && MoveDown(wrapAround)) return; else if (m_orientation == VERTICAL) { CGUIListItemLayout *focusedLayout = GetFocusedLayout(); if (focusedLayout && focusedLayout->MoveRight()) return; } CGUIControl::OnRight(); }
// 设置场景操作句柄 void CGrowPointEditDlg::SetSceneManipulator(WX::SceneManipulator* sceneManipulator) { m_pSceneManipulator = sceneManipulator; if(m_pSceneManipulator) { m_pSceneManipulator->addSceneListener(this); // 得到底层的action GetAction(); SetActionMeshType(); SetActive(false); } }
func Piccheck() { if(FindContents(ZPM_)) { SetVisibility(VIS_All()); SetAction(GetAction(FindContents(ZPM_))); } else { SetAction("Inactive"); SetVisibility(VIS_None()); } return(1); }
bool HUDWindow::on_key_press_event( GdkEventKey* event ) { bool return_value = false; auto actionsMgr(GetActionsMgr().lock()); assert(actionsMgr); switch( event->keyval ) { case GDK_h: if( event->state & GDK_CONTROL_MASK ) { motk::ToggleActionPtr showHUDAction = motk::ToggleActionPtr::cast_dynamic( actionsMgr->GetAction( "View::ShowHUD" ) ); showHUDAction->set_active( false ); return_value = true; } break; case GDK_F: if( event->state & GDK_CONTROL_MASK ) { motk::ActionPtr changeHUDFont = motk::ActionPtr::cast_dynamic( actionsMgr->GetAction( "HUD::ChangeFont" ) ); changeHUDFont->activate(); } break; } // Call base class, to allow normal handling, // such as allowing the row to be selected by the right-click: // if( !return_value ) { return_value = Gtk::Window::on_key_press_event(event); } return return_value; }
static ACTION ReadAction( void ) /******************************/ /* Read an action from the terminal. * Return the action code. */ { char buffer[80]; if( gets( buffer ) == NULL ) { perror( "Error reading action" ); abort(); } return( GetAction( buffer ) ); }
CPDF_Action CPDFSDK_Annot::GetAAction(CPDF_AAction::AActionType eAAT) { CPDF_AAction AAction = GetAAction(); if (AAction.ActionExist(eAAT)) { return AAction.GetAction(eAAT); } else if (eAAT == CPDF_AAction::ButtonUp) { return GetAction(); } return NULL; }
// 添加到CByteArray bool CShape::CodeToDataBlock(DBWriteSet& setWriteDB, bool bExData) { CBaseObject::CodeToDataBlock(setWriteDB,bExData); setWriteDB.AddToByteArray((BYTE)GetCurRgnType()); setWriteDB.AddToByteArray(GetRegionID()); setWriteDB.AddToByteArray(GetRegionExID()); setWriteDB.AddToByteArray(GetPosX()); setWriteDB.AddToByteArray(GetPosY()); setWriteDB.AddToByteArray(GetDir()); setWriteDB.AddToByteArray(GetPos()); setWriteDB.AddToByteArray(GetSpeed()); setWriteDB.AddToByteArray(GetState()); setWriteDB.AddToByteArray(GetAction()); return true; }
void C4Object::SideBounds(C4Real &ctcox) { // layer bounds if (Layer) if (Layer->Def->BorderBound & C4D_Border_Layer) { C4PropList* pActionDef = GetAction(); if (!pActionDef || pActionDef->GetPropertyP(P_Procedure) != DFA_ATTACH) { TargetBounds(ctcox, Layer->GetX() + Layer->Shape.GetX() - Shape.GetX(), Layer->GetX() + Layer->Shape.GetX() + Layer->Shape.Wdt + Shape.GetX(), CNAT_Left, CNAT_Right); } } // landscape bounds if (Def->BorderBound & C4D_Border_Sides) TargetBounds(ctcox,0-Shape.GetX(),GBackWdt+Shape.GetX(),CNAT_Left,CNAT_Right); }
// 添加到CByteArray bool CShape::AddShapeToByteArray(vector<BYTE>* pByteArray) { _AddToByteArray(pByteArray,(CGUID&)GetExID()); _AddToByteArray(pByteArray, (long)GetCurRgnType()); _AddToByteArray(pByteArray, GetRegionID()); _AddToByteArray(pByteArray, GetRegionExID()); _AddToByteArray(pByteArray, GetPosX()); _AddToByteArray(pByteArray, GetPosY()); _AddToByteArray(pByteArray, GetDir()); _AddToByteArray(pByteArray, GetPos()); _AddToByteArray(pByteArray, GetSpeed()); _AddToByteArray(pByteArray, GetState()); _AddToByteArray(pByteArray, GetAction()); return true; }
void FToolBarButtonBlock::CreateMenuEntry(FMenuBuilder& MenuBuilder) const { TSharedPtr<const FUICommandInfo> MenuEntryAction = GetAction(); TSharedPtr<const FUICommandList> MenuEntryActionList = GetActionList(); if (MenuEntryAction.IsValid() && MenuEntryActionList.IsValid()) { MenuBuilder.PushCommandList(MenuEntryActionList.ToSharedRef()); MenuBuilder.AddMenuEntry(MenuEntryAction); MenuBuilder.PopCommandList(); } else if ( LabelOverride.IsSet() ) { const FUIAction& DirectAction = GetDirectActions(); MenuBuilder.AddMenuEntry( LabelOverride.Get(), ToolTipOverride.Get(), IconOverride.Get(), DirectAction ); } }
void C4Object::VerticalBounds(C4Real &ctcoy) { // layer bounds if (Layer) if (Layer->Def->BorderBound & C4D_Border_Layer) { C4PropList* pActionDef = GetAction(); if (!pActionDef || pActionDef->GetPropertyP(P_Procedure) != DFA_ATTACH) { TargetBounds(ctcoy, Layer->GetY() + Layer->Shape.GetY() - Shape.GetY(), Layer->GetY() + Layer->Shape.GetY() + Layer->Shape.Hgt + Shape.GetY(), CNAT_Top, CNAT_Bottom); } } // landscape bounds if (Def->BorderBound & C4D_Border_Top) TargetBounds(ctcoy,0-Shape.GetY(),+1000000,CNAT_Top,CNAT_Bottom); if (Def->BorderBound & C4D_Border_Bottom) TargetBounds(ctcoy,-1000000,GBackHgt+Shape.GetY(),CNAT_Top,CNAT_Bottom); }
/******************************************************************* * 函数名:ParserStarup * * 功能:语法分析的启动函数 *******************************************************************/ bool LRParser::ParserStarup() throw (ParserErrorException) { char symbol; // 符号栈的栈顶元素 CString action; // ACTION 表的状态 int state; // 状态栈的栈顶元素 if (InitialFor()) // 初始化工作 { while (true) { state = stateStack.top(); // 状态栈的栈顶元素 symbol = grammar[0]; // 输入串的顶端 action = GetAction(state, grammar[0]); if (action.IsEmpty()) { return false; } else if ('S' == action[0]) { // 移进动作 ShiftAction(action); } else if ('R' == action[0]) { // 归约动作 if (!ReduceAction(action)) { return false; } } else if (0 == action.Compare("ACC")) { // 接收动作 AcceptAction(); return true; } else { // 错误处理 new ParserErrorException(_T("非法的输入语句")); return false; } }// End of while } else { return false; }// End of else }
func Timer() { if(pBeamer && GetCursor(GetOwner()) != this()) return RemoveObject(); Frame++; if(Frame > 10) { Frame = 0; if(GetAction() eq "1") { SetAction("2"); } else { SetAction("1"); } } /*if(GetR() < 360) { SetR(GetR() + 1); } else { SetR(0); }*/ if(ObjectDistance(pBeamer) > LandscapeWidth() / 2 && !FindObject(ENRG)) { if(GetX() > GetX(pBeamer)) { SetXDir(-30); } else { SetXDir(30); } if(GetY() > GetY(pBeamer)) { SetYDir(-30); } else { SetYDir(30); } } SetRDir(3); }
/** \fn ActionSet::Replace(const ActionID&,const QString&,const QString&) * \brief Replace a specific key in a specific action. * * If the key is replaced, then we remove the old key from the * key list and add the new key and mark the action as modified. * * \param id The action identifier. * \param newkey The new key. * \param oldkey The key to be replaced. */ bool ActionSet::Replace(const ActionID &id, const QString &newkey, const QString &oldkey) { Action *a = GetAction(id); if (!a) return false; if (!a->ReplaceKey(newkey, oldkey)) return false; m_keyToActionMap[oldkey].removeAll(id); m_keyToActionMap[newkey].push_back(id); SetModifiedFlag(id, true); return true; }