當前位置: 首頁>>代碼示例>>C++>>正文


C++ CallEvent函數代碼示例

本文整理匯總了C++中CallEvent函數的典型用法代碼示例。如果您正苦於以下問題:C++ CallEvent函數的具體用法?C++ CallEvent怎麽用?C++ CallEvent使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了CallEvent函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: while

  void MapEventManager::CallEvents (const Time& dt)
  {
    while (!leaveEvents_.IsEmpty ())
    {
      MapEventContext* event = leaveEvents_.Dequeue (event);
      CallEvent (MapEventActionType::Leave, dt, *event);

      if (abortEvents_)
        return;
    }

    while (!enterEvents_.IsEmpty ())
    {
      MapEventContext* event = enterEvents_.Dequeue (event);
      CallEvent (MapEventActionType::Enter, dt, *event);

      if (abortEvents_)
        return;
    }

    for (auto& objectEvents : events_)
    {
      for (auto& eventTriggering : objectEvents.second)
      {
        for (MapEventContext* event : eventTriggering.second)
        {
          CallEvent (MapEventActionType::In, dt, *event);

          if (abortEvents_)
            return;
        }
      }
    }
  }
開發者ID:Noxalus,項目名稱:YAPOG,代碼行數:34,代碼來源:MapEventManager.cpp

示例2: CallEvent

void ItemHandleEvents::onMcfProgress(MCFCore::Misc::ProgressInfo& info)
{
	if (info.percent != m_LastProg.percent || info.flag != m_LastProg.flag)
	{
		m_LastProg = info;
		CallEvent(m_EventHistory, m_vHelperList, &Helper::ItemHandleHelperI::onMcfProgress, info);
	}
	else
	{
		CallEvent(m_vHelperList, &Helper::ItemHandleHelperI::onMcfProgress, info);
	}
}
開發者ID:aszlig,項目名稱:Desurium,代碼行數:12,代碼來源:ItemHandleEvents.cpp

示例3: CallEvent

void CClientWebBrowser::Events_OnNavigate ( const SString& strURL, bool bIsBlocked )
{
    CLuaArguments Arguments;
    Arguments.PushString ( strURL );
    Arguments.PushBoolean ( bIsBlocked );
    CallEvent ( "onClientBrowserNavigate", Arguments, false );
}
開發者ID:F420,項目名稱:mtasa-blue,代碼行數:7,代碼來源:CClientWebBrowser.cpp

示例4: CallEvent

void CClientWebBrowser::Events_OnLoadingStart ( const SString& strURL, bool bMainFrame )
{
    CLuaArguments Arguments;
    Arguments.PushString ( strURL );
    Arguments.PushBoolean ( bMainFrame );
    CallEvent ( "onClientBrowserLoadingStart", Arguments, false );
}
開發者ID:CyberSys,項目名稱:mtasa-blue,代碼行數:7,代碼來源:CClientWebBrowser.cpp

示例5: assert

void CElement::SetCustomData ( const char* szName, const CLuaArgument& Variable, CLuaMain* pLuaMain, bool bSynchronized, CPlayer* pClient, bool bTriggerEvent )
{
    assert ( szName );
    if ( strlen ( szName ) > MAX_CUSTOMDATA_NAME_LENGTH )
    {
        // Don't allow it to be set if the name is too long
        CLogger::ErrorPrintf ( "Custom data name too long (%s)\n", *SStringX ( szName ).Left ( MAX_CUSTOMDATA_NAME_LENGTH + 1 ) );
        return;
    }

    // Grab the old variable
    CLuaArgument oldVariable;
    const SCustomData * pData = m_pCustomData->Get ( szName );
    if ( pData )
    {
        oldVariable = pData->Variable;
    }

    // Set the new data
    m_pCustomData->Set ( szName, Variable, pLuaMain, bSynchronized );

    if ( bTriggerEvent )
    {
        // Trigger the onElementDataChange event on us
        CLuaArguments Arguments;
        Arguments.PushString ( szName );
        Arguments.PushArgument ( oldVariable );
        Arguments.PushArgument ( Variable );
        CallEvent ( "onElementDataChange", Arguments, pClient );
    }
}
開發者ID:Bargas,項目名稱:mtasa-blue,代碼行數:31,代碼來源:CElement.cpp

示例6: CallEvent

void CBaseListBox::OnMouse(float wx, float wy, bool lBtn, bool rBtn)
{
	if (!lBtn || !InControl(wx, wy) || GetFont() == 0)return;
	size_t k = (size_t)((bounds.GetClientTop() - wy)/GetFont()->Height()) + itemScroll;
	itemIndex = (k >= items.size())?items.size() - 1:k;
	CallEvent(UI_CHANGE);
}
開發者ID:8441918,項目名稱:evg-parser,代碼行數:7,代碼來源:uiListBox.cpp

示例7: msgCommon

bool TestCase::OnBtnReturnClicked(IMsgBase* pMsg)
{
	// return to menu
	MsgCommon msgCommon(MI_USER_RETURN);
	CallEvent(msgCommon);
	return true;
}
開發者ID:mshandle,項目名稱:spank,代碼行數:7,代碼來源:TestCase.cpp

示例8: CallEvent

void kGUIMenuObj::OpenMenu(kGUIMenuColObj *menu,int x,int y)
{
	kGUIMenuEntryObj *me;

	/* this callback can be trapped to enable / disable menu entries */
	if(!m_depth)
		CallEvent(EVENT_ENTER);

	m_activeentry.SetEntry(m_depth++,menu);
	menu->SetEventHandler(0,0);
	menu->SetEventHandler(this,CALLBACKNAME(MenuEvent));
	menu->SetDrawPopRow(false);
	menu->Activate(x,y);
	Dirty();

	/* check to see if the first entry has a sub-menu */
	me=menu->GetCurrentEntry();
	if(me->GetSubMenu())
	{
		kGUICorners c;

		/* activate sub-menu */
		me->GetCorners(&c);
		OpenMenu(me->GetSubMenu(),c.rx-6,c.ty+2);
	}
}
開發者ID:CarlHuff,項目名稱:kgui,代碼行數:26,代碼來源:kguimenu2.cpp

示例9: l

void CBoxHttpHost::OnStart(void)
{
	if(m_bIsStart)return;
	m_bIsStart = TRUE;

	CSingleLock l(&m_cs, TRUE);

	CallEvent(L"OnApplicationStart", NULL, NULL, TRUE);

	CBoxObject<CBoxHttpHost> pHost;
	CComVariant var;
	int i;
	int count = m_pContents->get_Count();

	for(i = 0; i < count; i ++)
	{
		var.Clear();
		m_pContents->GetValue(i, var);
		if(var.vt == VT_DISPATCH)
		{
			pHost = var.pdispVal;
			if(pHost != NULL)
				pHost->OnStart();
		}
	}
}
開發者ID:2Quico,項目名稱:netbox,代碼行數:26,代碼來源:BoxHttpHost.cpp

示例10: ComPort1_Handler

//yea this is a mess with commented out commands
void ComPort1_Handler(){ //This is the interrupt handler
	unsigned char which,tmp;
	unsigned char tmpy[2];
	which=inportb(COM1_INTERRUPT_ID);
	tmp=which&0x06; //isolate the type of interrupt
	switch(tmp){
		case ID_MODEM_STATUS: //ignored
		//do nothing
		break;
		case  ID_TRANSMITTER_EMPTY: //ready to write
			ReadyWrite=TRUE; //sets the status to ready for writing
		break;
		case ID_RECEIVED_DATA: //theirs data in the port so go get it!
		Com1Count++;
		if(Com1Count==32){Com1Count=0;}
		ReadyRead=TRUE;
		Com1Buffer[Com1Count]=inportb(COM1_TRANSMIT_RECEIVE_BUFFER);
          CallEvent(COM1_READ,0,0);
		if(IgnoreReads || Com1ReadLength<=Com1ReadCounter){
			//ReadyRead=TRUE;
		}
		break;
		case ID_RECEIVER_STATUS: //ERROR!!
		which=inportb(COM1_LINE_STATUS);
		which=which&30; //isolates bits 1-4
		switch(which){
			case OVERRUN_ERROR: //buffer overrun
			Com1IgnoredReadBuffer=inportb(COM1_TRANSMIT_RECEIVE_BUFFER);
			Com1Error=Com1Error|OVERRUN_ERROR;
			break;
			case PARITY_ERROR:
			Com1Error=Com1Error|PARITY_ERROR;
			//do nothing I guess
			break;
			case FRAMING_ERROR:
			Com1Error=Com1Error|FRAMING_ERROR;
			//do nothing again
			break;
			case CONNECT_LOST:
			Com1Error=Com1Error|CONNECT_LOST;
			break;
		}
		CallEvent(COM1_ERROR,Com1Error,0);
		break;
	}

}
開發者ID:Earlz,項目名稱:ancientstuff,代碼行數:48,代碼來源:Comports.c

示例11: CallEvent

void CClientMarker::Callback_OnLeave ( CClientColShape& Shape, CClientEntity& Entity )
{
    if ( IS_PLAYER ( &Entity ) )
    {
        // Call the marker hit event
        CLuaArguments Arguments;
        Arguments.PushElement ( &Entity );            // player that hit it
        Arguments.PushBoolean ( ( Shape.GetDimension () == Entity.GetDimension () ) ); // matching dimension?
        CallEvent ( "onClientMarkerLeave", Arguments, true );
    }
}
開發者ID:EagleShen,項目名稱:MTA,代碼行數:11,代碼來源:CClientMarker.cpp

示例12: Destroy

////////////////////////////////////////////////////////////
//
// CClientSound::DistanceStreamOut
//
// Sound is now far enough away to not be heard, so can be deactivated
//
////////////////////////////////////////////////////////////
void CClientSound::DistanceStreamOut ( void )
{
    if ( m_pAudio )
    {
        m_pSoundManager->OnDistanceStreamOut ( this );
        Destroy ();

        // Call Stream Out event
        CLuaArguments Arguments;
        CallEvent ( "onClientElementStreamOut", Arguments, true );
    }
}
開發者ID:ntauthority,項目名稱:openvice,代碼行數:19,代碼來源:CClientSound.cpp

示例13: Create

////////////////////////////////////////////////////////////
//
// CClientSound::DistanceStreamIn
//
// Sound is now close enough to be heard, so must be activated
//
////////////////////////////////////////////////////////////
void CClientSound::DistanceStreamIn ( void )
{
    if ( !m_pAudio )
    {
        Create ();
        m_pSoundManager->OnDistanceStreamIn ( this );

        // Call Stream In event
        CLuaArguments Arguments;
        CallEvent ( "onClientElementStreamIn", Arguments, true );
    }
}
開發者ID:ntauthority,項目名稱:openvice,代碼行數:19,代碼來源:CClientSound.cpp

示例14: assert

void Entity::addComponent(ComponentPtr component)
{
    std::type_index id = std::type_index(typeid(*component.get()));
    assert(componentMap.count(id) == 0);

    EntityPtr ptr = this->shared_from_this();

    component->attachEntity = ptr;
    this->components.push_back(component);

    this->componentMap[id] = component;

    CacheComponents();

    component->registerEvents();

    if (this->state >= EntityState::Awaked) {
        CallEvent(component.get(), Events::Awake);
        if (this->node.get() != nullptr && this->node->hasParent()) {
            CallEvent(component.get(), Events::Enter);
        }
    }
}
開發者ID:mink365,項目名稱:RacingEngine,代碼行數:23,代碼來源:Entity.cpp

示例15: switch

void CBaseListBox::OnKeyDown(char key)
{
	switch(key)
	{
	case VK_UP:
		Prev();
		break;
	case VK_DOWN:
		Next();
		break;
	default:
		return;
	}
	CallEvent(UI_CHANGE);
}
開發者ID:8441918,項目名稱:evg-parser,代碼行數:15,代碼來源:uiListBox.cpp


注:本文中的CallEvent函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。