예제 #1
0
void pxEvtHandler::ProcessEvent( SysExecEvent& evt )
{
	if( wxThread::GetCurrentId() != m_OwnerThreadId )
	{
		SynchronousActionState sync;
		evt.SetSyncState( sync );
		PostEvent( evt );
		sync.WaitForResult();
	}
	else
		evt._DoInvokeEvent();
}
예제 #2
0
bool pxEvtHandler::Rpc_TryInvoke( FnType_Void* method, const wxChar* traceName )
{
	if( wxThread::GetCurrentId() != m_OwnerThreadId )
	{
		SynchronousActionState sync;
		SysExecEvent_MethodVoid evt(method);
		evt.Critical();
		evt.SetSyncState( sync );
		PostEvent( evt );
		sync.WaitForResult();

		return true;
	}
	
	return false;
}
예제 #3
0
void pxEvtHandler::ProcessEvent( SysExecEvent* evt )
{
	if( !evt ) return;

	if( wxThread::GetCurrentId() != m_OwnerThreadId )
	{
		SynchronousActionState sync;
		evt->SetSyncState( sync );
		PostEvent( evt );
		sync.WaitForResult();
	}
	else
	{
		ScopedPtr<SysExecEvent> deleteMe( evt );
		deleteMe->_DoInvokeEvent();
	}
}
예제 #4
0
	int ShowModal( BaseMessageBoxEvent& evt )
	{
		SynchronousActionState instdat;
		evt.SetSyncState( instdat );

		if( wxThread::IsMain() )
		{
			// main thread can handle the message immediately.
			wxGetApp().ProcessEvent( evt );
			return instdat.return_value;
		}
		else
		{
			// Not on main thread, must post the message there for handling instead:
			wxGetApp().AddPendingEvent( evt );
			return instdat.WaitForResult();		// Important! disable cancellation since we're using local stack vars.
		}
	}