本文整理汇总了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;
}
}
}
}
示例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);
}
}
示例3: CallEvent
void CClientWebBrowser::Events_OnNavigate ( const SString& strURL, bool bIsBlocked )
{
CLuaArguments Arguments;
Arguments.PushString ( strURL );
Arguments.PushBoolean ( bIsBlocked );
CallEvent ( "onClientBrowserNavigate", Arguments, false );
}
示例4: CallEvent
void CClientWebBrowser::Events_OnLoadingStart ( const SString& strURL, bool bMainFrame )
{
CLuaArguments Arguments;
Arguments.PushString ( strURL );
Arguments.PushBoolean ( bMainFrame );
CallEvent ( "onClientBrowserLoadingStart", Arguments, false );
}
示例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 );
}
}
示例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);
}
示例7: msgCommon
bool TestCase::OnBtnReturnClicked(IMsgBase* pMsg)
{
// return to menu
MsgCommon msgCommon(MI_USER_RETURN);
CallEvent(msgCommon);
return true;
}
示例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);
}
}
示例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();
}
}
}
示例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;
}
}
示例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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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);
}
}
}
示例15: switch
void CBaseListBox::OnKeyDown(char key)
{
switch(key)
{
case VK_UP:
Prev();
break;
case VK_DOWN:
Next();
break;
default:
return;
}
CallEvent(UI_CHANGE);
}