当前位置: 首页>>代码示例>>C++>>正文


C++ PostEvent函数代码示例

本文整理汇总了C++中PostEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ PostEvent函数的具体用法?C++ PostEvent怎么用?C++ PostEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PostEvent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProcCommand

void ProcCommand()
{
	string comName = GetEventData();
	string nodName = GetEventData();

	switch(nodName)
	{
	case "B_OK":
		if(comName=="activate" || comName=="click")
		{
			ExecuteSailorPayment();
			PostEvent("evntDoPostExit",1,"l",RC_INTERFACE_SALARY_EXIT);
		}
	break;

	case "B_CANCEL":
		if(comName=="activate" || comName=="click")
		{
			SkipSailorPayment();
			PostEvent("evntDoPostExit",1,"l",RC_INTERFACE_SALARY_EXIT);
		}
		if(comName=="upstep")
		{
			if(GetSelectable("B_OK"))	{SetCurrentNode("B_OK");}
		}
	break;
	}
}
开发者ID:ekuznets,项目名称:PKM2,代码行数:28,代码来源:salary.c

示例2: PostEvent

void nxInputManager::Prepare(bool bRawInput,bool bDInput,bool bXInput)
{
    PostEvent(NX_INPUT_ENUMERATE,0,0);
    /// Create XINPUT devices
    if (bXInput)
    {
        for (DWORD i = 0;i < nxXInputDevice::XI_MAXDEVICES;++i)
        {
            nxDeviceId uDevId = CreateDeviceId();
            std::stringstream ss;
            ss << "XINPUT_" << (i+1);
            // Map the handle/index to the device id
            mpHandleId[i] = uDevId;
            // Map the "GUID" to the device id
            SetGUIDMapping(uDevId,ss.str());
        }
    }
    /// Create RAWINPUT devices
    if (bRawInput)
    {
        // Enumerate the raw input devices on the system
        std::vector<nxRawInputDevice> vcDevices;
        nxRawInputDevice::Enumerate(vcDevices);
        for (std::vector<nxRawInputDevice>::iterator it=vcDevices.begin();it!=vcDevices.end();++it)
        {
            // See if the GUID already has a device id
            nxDeviceId uDevId;
            const nxDeviceId*ptDevId=srDeviceGUID.LookupRight(it->GetGUID());
            // If the guid already has a device id, get it
            if (ptDevId)
            {
                uDevId = *ptDevId;
            }
            else // Otherwise, make one.
            {
                // If it doesn't, create one and add the mapping.
                uDevId = CreateDeviceId();
                SetGUIDMapping(uDevId,it->GetGUID());
            }

            // Map the handle to the device id
            mpHandleId[it->GetDeviceHandle()] = uDevId;
        }
    }
    /// Create DIRECTINPUT devices
    if (bDInput)
    {
        // Try to create a directinput interface if it doesn't exist already

        if (DirectInput8Create(nxInstanceHandle(), DIRECTINPUT_VERSION, IID_IDirectInput8, ( VOID** )&pDI, NULL) != DI_OK)
            pDI = NULL;
        else
        {
            // Enumerate the devices
            pDI->EnumDevices( DI8DEVCLASS_GAMECTRL,EnumJoysticksCallback,NULL, DIEDFL_ATTACHEDONLY );
        }
    }
    PostEvent(NX_INPUT_READY,0,0);
}
开发者ID:nacitar,项目名称:old-projects,代码行数:59,代码来源:nxInputManager.cpp

示例3: Entry

	virtual void * Entry() 
	{
		CUrlOpt opt(m_url, URL_OPT_REFRESH, m_proxy);
		m_bResult = (opt.Run() == CURLE_WRITE_ERROR);
		if (m_bResult)
			PostEvent(EVENT_TYPE_REFRESH_SUCC, m_proxy);
		else
			PostEvent(EVENT_TYPE_REFRESH_FAIL, m_proxy);
		return NULL;
	}
开发者ID:caicry,项目名称:wxUrlRefresh,代码行数:10,代码来源:ui_refresh.cpp

示例4: About

INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case WM_HOTKEY:
		switch ( HIWORD( lParam ) )
		{
		case VK_RIGHT:
			PostEvent( EVENT_TYPE_HOTKEY_NEXT );
			break;

		case VK_SPACE:
			PostEvent( EVENT_TYPE_HOTKEY_PAUSE );
			break;
		}
		break;
	
   case WM_WTSSESSION_CHANGE:
      switch ( wParam )
      {
      case WTS_SESSION_LOCK:	  
			PostEvent( EVENT_TYPE_CONSOLE_LOCK );
			break;
		 
      case WTS_SESSION_UNLOCK:
			PostEvent( EVENT_TYPE_CONSOLE_UNLOCK );
			break;
      }
      break;

   case WM_WINDOWPOSCHANGING:
      {
         WINDOWPOS * pPos = (WINDOWPOS*) lParam;
         pPos->flags |= SWP_HIDEWINDOW;
         pPos->flags &= ~SWP_SHOWWINDOW;
      }
      break;
   
	case WM_INITDIALOG:
		g_hwnd = hDlg;
		WTSRegisterSessionNotification( hDlg, NOTIFY_FOR_ALL_SESSIONS );
		RegisterHotKey( g_hwnd, 1, MOD_ALT | MOD_CONTROL, VK_SPACE );
		RegisterHotKey( g_hwnd, 2, MOD_ALT | MOD_CONTROL, VK_RIGHT );
		return (INT_PTR)TRUE;

	case WM_COMMAND:
		if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
		{
			EndDialog(hDlg, LOWORD(wParam));
			return (INT_PTR)TRUE;
		}
		break;
	}
	return (INT_PTR)FALSE;
}
开发者ID:cwbowron,项目名称:schemep3,代码行数:55,代码来源:system-events.cpp

示例5: custom_butclick

static void
custom_butclick( CursorDevicePtr dev, short button )
{
	static int toggle=0;
	
	if( !toggle ) {
		PostEvent( keyDown, (0x3b << 8) | 0xff );
		PostEvent( mouseDown, 0 );
	} else {
		PostEvent( mouseUp, 0 );
		PostEvent( keyUp, (0x3b << 8) | 0xff );
	}
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:13,代码来源:main.c

示例6: PostEvent

/*!
    \fn swMain::_prepare_keyinput_ev( Event* _ev )
 */
Event* swMain::_prepare_keyinput_ev( Event* _ev )
{
    event_t ev = 0;
    MessageEvent* Mes;
    KeyPressEvent* Kev;
    ///@todo Before pushing the key event, there is lots of function keys and other keyboard commands to translate into MessageEvent or refined KeyInput event
    if( _ev->NcursesEvent() == KEY_RESIZE){
        PostEvent( (Mes = new MessageEvent(event::TermResize) ) );
        return Mes;
    }
    // Just push the event
    PostEvent( _ev );//( Kev = new KeyPressEvent( _ev->What(), bMeta ) ) );
    return  _ev;
}
开发者ID:BackupTheBerlios,项目名称:scwdk-svn,代码行数:17,代码来源:swmain.cpp

示例7: AnimationEvent

void Animate::DoExitCommands( int slot )
{
	tiki_cmd_t cmds;
	AnimationEvent *ev;

	if( animFlags[ slot ] & ANIM_NOEXIT ) {
		return;
	}

	// exit the previous animation
	if( gi.Frame_Commands( edict->tiki, edict->s.frameInfo[ slot ].index, TIKI_FRAME_EXIT, &cmds ) )
	{
		int ii, j;

		for( ii = 0; ii < cmds.num_cmds; ii++ )
		{
			ev = new AnimationEvent( cmds.cmds[ ii ].args[ 0 ] );

			ev->SetAnimationNumber( edict->s.frameInfo[ slot ].index );
			ev->SetAnimationFrame( 0 );

			for( j = 1; j < cmds.cmds[ ii ].num_args; j++ )
			{
				ev->AddToken( cmds.cmds[ ii ].args[ j ] );
			}

			PostEvent( ev, 0 );
		}
	}

	animFlags[ slot ] |= ANIM_NOEXIT;
}
开发者ID:kingtiger01,项目名称:openmohaa-1,代码行数:32,代码来源:animate.cpp

示例8: SkipSailorPayment

void SkipSailorPayment()
{
	ref mchref = GetMainCharacter();
	int morale = 45;
	if( CheckAttribute(mchref,"Ship.Crew.Morale") ) morale = sti(mchref.Ship.Crew.Morale);
	morale -= nMoraleDecreaseQ;
	if(morale<0)	morale = 0;

	mchref.CrewPayment = nPaymentQ;

	int cn;
	for(int i=0; i<4; i++)
	{
		cn = GetCompanionIndex(mchref,i);
		if(cn>=0)
		{
			Characters[cn].Ship.Crew.Morale = morale;
		}
	}

	if(morale<MORALE_NORMAL)
	{
		if(morale<=I_MIN_MORALE) {
			PostEvent("ievent_GameOver",1,"s","mutiny");
		}
	}
}
开发者ID:ekuznets,项目名称:PKM2,代码行数:27,代码来源:salary.c

示例9: PostEvent

void CReceiverThread::PostClosePort( const QString &strCOMx )
{
    CComThreadEvent* pEvent = CComThreadEvent::CreateThreadEvent( CComThreadEvent::ThreadReceiver, CComThreadEvent::EventClosePort );
    pEvent->SetPortName( strCOMx );

    PostEvent( pEvent );
}
开发者ID:Anne081031,项目名称:ParkCode,代码行数:7,代码来源:creceiverthread.cpp

示例10: LOG

nsresult
nsSocketTransportService::DetachSocket(SocketContext *sock)
{
    LOG(("nsSocketTransportService::DetachSocket [handler=%x]\n", sock->mHandler));

    // inform the handler that this socket is going away
    sock->mHandler->OnSocketDetached(sock->mFD);

    // cleanup
    sock->mFD = nsnull;
    NS_RELEASE(sock->mHandler);

    // find out what list this is on.
    PRUint32 index = sock - mActiveList;
    if (index < NS_SOCKET_MAX_COUNT)
        RemoveFromPollList(sock);
    else
        RemoveFromIdleList(sock);

    // NOTE: sock is now an invalid pointer
    
    //
    // notify the first element on the pending socket queue...
    //
    if (!PR_CLIST_IS_EMPTY(&mPendingSocketQ)) {
        // move event from pending queue to event queue
        PLEvent *event = PLEVENT_FROM_LINK(PR_LIST_HEAD(&mPendingSocketQ));
        PR_REMOVE_AND_INIT_LINK(&event->link);
        PostEvent(event);
    }
    return NS_OK;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:32,代码来源:nsSocketTransportService2.cpp

示例11: execute

void wxGISGPToolManager::OnFinish(IProcess* pProcess, bool bHasErrors)
{
    size_t nIndex;
    for(nIndex = 0; nIndex < m_ProcessArray.size(); nIndex++)
        if(pProcess == m_ProcessArray[nIndex].pProcess)
            break;

    wxDateTime end = wxDateTime::Now();
    if(m_ProcessArray[nIndex].pTrackCancel)
    {
        if(bHasErrors)
        {
            m_ProcessArray[nIndex].pTrackCancel->PutMessage(wxString::Format(_("An error occured while executing %s. Failed to execute (%s)."), m_ProcessArray[nIndex].pTool->GetName().c_str(), m_ProcessArray[nIndex].pTool->GetName().c_str()), -1, enumGISMessageErr);
            m_ProcessArray[nIndex].pTrackCancel->PutMessage(_("Error!"), -1, enumGISMessageTitle);
        }
        else
        {
            m_ProcessArray[nIndex].pTrackCancel->PutMessage(wxString::Format(_("Executed (%s) successfully"), m_ProcessArray[nIndex].pTool->GetName().c_str()), -1, enumGISMessageInfo);
            m_ProcessArray[nIndex].pTrackCancel->PutMessage(_("Done"), -1, enumGISMessageTitle);
        }

        wxTimeSpan span = end - m_ProcessArray[nIndex].pProcess->GetBeginTime();
        m_ProcessArray[nIndex].pTrackCancel->PutMessage(wxString::Format(_("End Time: %s (Elapsed Time: %s)"), end.Format().c_str(), span.Format(_("%H hours %M min. %S sec.")).c_str()), -1, enumGISMessageInfo);
    }

	wxGISProcessEvent event(wxPROCESS_FINISH, nIndex, bHasErrors);
	PostEvent(event);

	RunNextTask();
}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:30,代码来源:gptoolmngr.cpp

示例12: QCameraEvent

void QAnalogCameraThread::PostStartSourceStreamEvent( int nChannel, bool bRegister )
{
    QCameraEvent* pEvent = new QCameraEvent( ( QEvent::Type ) QCameraEvent::CameraStartSourceStream );
    pEvent->SetChannel( nChannel );
    pEvent->SetRecognize( bRegister );
    PostEvent( pEvent );
}
开发者ID:Anne081031,项目名称:ParkSolution,代码行数:7,代码来源:qanalogcamerathread.cpp

示例13: wxCHECK_RET

void wxGISMapView::OnMapDrawing(wxMxMapViewUIEvent& event)
{
    wxEventType eType = event.GetEventType();
    if(eType == wxMXMAP_DRAWING_START)
    {
        if(m_nDrawingState != enumGISMapFlashing) //maybe m_nDrawingState == enumGISMapNone
        m_nDrawingState = enumGISMapDrawing;

        wxCHECK_RET(m_pAni, wxT("Animation progress is not initiated"));
        m_pAni->ShowProgress(true);
        m_pAni->Play();
    }
    else if(eType == wxMXMAP_DRAWING_STOP)
    {
        if(!m_pGISDisplay->IsDerty() && m_nDrawingState == enumGISMapDrawing)
            m_nDrawingState = enumGISMapNone;

        if( m_nDrawingState == enumGISMapNone )
        {
            m_ClipGeometry.Clear();
        }

	    //m_nDrawingState = enumGISMapNone;
	    Refresh();

        wxCHECK_RET(m_pAni, wxT("Animation progress is not initiated"));
        m_pAni->Stop();
        m_pAni->ShowProgress(false);
    }

	PostEvent(event);
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:32,代码来源:mapview.cpp

示例14: e

	void EventQueue::Tick() {
		// create temporary lists, so new events generated won't execute next tick ( avoid possible loop with events generating themselves )
		std::deque<Event> tmp_EventQueue = LocalEventQueue;

		LocalEventQueue.clear();

		// Add the Events from other Threads to the EventQueue
		Event e("INVALID_EVENT");
		while (ThreadedEventQueue.try_pop(e))
		{
			//if ( !e.Is( "VIEW_DBG_STRING" ) && !e.Is( "EVT_FRAME") && !e.Is("EVT_TICK") ) Engine::out() << "[FE:"<< Module::Get()->GetName() <<"] Found Remote Event: " << e.getDebugName() << std::endl;
			tmp_EventQueue.push_back(e);

			// exclude remote origin events
			LocalEventsThisSecond--;
		}

		for (auto& e : tmp_EventQueue)
		{

			LocalEventsThisSecond++;
			PostEvent(e);
		}

	}
开发者ID:Lirrec,项目名称:SchiffbruchEngine,代码行数:25,代码来源:EventQueue.cpp

示例15: wxCHECK_RET

void wxGISTaskManager::AddMessage(const wxXmlNode* pIniNode)
{
    wxCHECK_RET(pIniNode, wxT("Input wxXmlNode pointer is null"));
    int nTaskId = GetDecimalValue(pIniNode, wxT("id"), wxNOT_FOUND);
    if(nTaskId == wxNOT_FOUND)
        return;
    wxGISTask* pTasks = m_moTasks[nTaskId];
    if(pTasks == NULL)
        return;

    long nMsgId = GetDecimalValue(pIniNode, wxT("msg_id"), wxNOT_FOUND);
    if(nMsgId == wxNOT_FOUND)
        return;

    wxGISEnumMessageType eType = (wxGISEnumMessageType)GetDecimalValue(pIniNode, wxT("msg_type"), enumGISMessageUnk);
    wxDateTime dt = GetDateValue(pIniNode, wxT("msg_dt"), wxDateTime::Now());
    wxString sInfoData = pIniNode->GetAttribute(wxT("msg"));

    if(!dt.IsValid() || sInfoData.IsEmpty())
        return;

    pTasks->AddMessage(new wxGISTaskMessage(nMsgId, sInfoData, eType, dt));

    //notify
    wxGISTaskEvent event(nTaskId, wxGISTASK_MESSAGEADDED, nMsgId);
    PostEvent(event);
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:27,代码来源:tskmngr.cpp


注:本文中的PostEvent函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。