Example #1
0
void WxeApp::shutdown(wxeMetaCommand& Ecmd) {
  delete dummy_window;
  ExitMainLoop();
}
Example #2
0
void MyDllApp::OnTerminate(wxThreadEvent& WXUNUSED(event))
{
    ExitMainLoop();
}
Example #3
0
void wxAppBase::Exit()
{
    ExitMainLoop();
}
void
Client::OnWorkerEvent(WorkerEvent& pEvent) {
    switch (pEvent.m_eventType) {
        case WorkerEvent::CONNECTING:
            if (pEvent.isFailed())
            {
                m_statConnecting--;
                m_statFailed++;
            }
        break;
        case WorkerEvent::SENDING:
            if (pEvent.isFailed())
            {
                m_statFailed++;
                m_statSending--;
            }
            else
            {
                m_statConnecting--;
                m_statSending++;
            }
        break;
        case WorkerEvent::RECEIVING:
            if (pEvent.isFailed())
            {
                m_statReceiving--;
                m_statFailed++;
            }
            else
            {
                m_statSending--;
                m_statReceiving++;
            }
        break;
        case WorkerEvent::DISCONNECTING:
            if (pEvent.isFailed())
            {
                m_statDisconnecting--;
                m_statFailed++;
            }
            else
            {
                m_statReceiving--;
                m_statDisconnecting++;
            }
        break;
        case WorkerEvent::DONE:
            m_statDone++;
            m_statDisconnecting--;
        break;
    };

    if (pEvent.isFailed() || pEvent.m_eventType == WorkerEvent::DONE)
    {
        for(TList::compatibility_iterator it = m_threadWorkers.GetFirst(); it ; it = it->GetNext()) {
            if (it->GetData() == pEvent.m_sender) {
                m_threadWorkers.DeleteNode(it);
                break;
            }
        }
        for(EList::compatibility_iterator it2 = m_eventWorkers.GetFirst(); it2 ; it2 = it2->GetNext())
        {
            if (it2->GetData() == pEvent.m_sender) {
                delete it2->GetData();
                m_eventWorkers.DeleteNode(it2);
                break;
            }
        }
        if ((m_threadWorkers.GetCount() == 0) && (m_eventWorkers.GetCount() == 0))
        {
            mTimer.Stop();
            dumpStatistics();
            wxSleep(2);
            ExitMainLoop();
        }
        else
        {
            mTimer.Start(timeout_val,true);
        }
    }
}
Example #5
0
void CSelectMode::OnLeftUp( wxMouseEvent& event )
{
	if(wxGetApp().drag_gripper)
	{
		double to[3], from[3];
		wxGetApp().m_digitizing->digitize(wxPoint(event.GetX(), event.GetY()));
		extract(wxGetApp().m_digitizing->digitized_point.m_point, to);
		wxGetApp().grip_to = wxGetApp().m_digitizing->digitized_point.m_point;
		extract(wxGetApp().grip_from, from);
		wxGetApp().drag_gripper->OnGripperReleased(from, to);
		wxGetApp().m_digitizing->SetOnlyCoords(wxGetApp().drag_gripper, false);
		wxGetApp().drag_gripper = NULL;
	}
	else if(window_box_exists)
	{
		if(!event.ControlDown())wxGetApp().m_marked_list->Clear(true);
		std::list<HeeksObj*> obj_list;
		GetObjectsInWindow(event, obj_list);
		wxGetApp().m_marked_list->Add(obj_list, true);
		wxGetApp().m_current_viewport->DrawWindow(window_box, true); // undraw the window
		window_box_exists = false;
	}
	else
	{
		// select one object
		m_last_click_point = CClickPoint();
		MarkedObjectOneOfEach marked_object;
		wxGetApp().FindMarkedObject(wxPoint(event.GetX(), event.GetY()), &marked_object);
		if(marked_object.m_map.size()>0){
			HeeksObj* previously_marked = NULL;
			if(wxGetApp().m_marked_list->size() == 1)
			{
				previously_marked = *(wxGetApp().m_marked_list->list().begin());
			}
			HeeksObj* o = marked_object.GetFirstOfTopOnly();
			unsigned long depth = marked_object.GetDepth();
			HeeksObj* object = o;

			while(o)
			{
				if(o == previously_marked)
				{
					object = o;
					break;
				}

				o = marked_object.Increment();

				if(o)
				{
					// prefer highest order objects
					if(o->GetType() < object->GetType())object = o;
				}
			}
			if(!event.ShiftDown() && !event.ControlDown())
			{
				wxGetApp().m_marked_list->Clear(true);
			}
			if (wxGetApp().m_marked_list->ObjectMarked(object))
			{
				if (!event.ShiftDown())
				{
					wxGetApp().m_marked_list->Remove(object, true);
				}
			}
			else
			{
				wxGetApp().m_marked_list->Add(object, true);
				m_last_click_point = CClickPoint(wxPoint(event.GetX(), event.GetY()), depth);
				gp_Lin ray = wxGetApp().m_current_viewport->m_view_point.SightLine(wxPoint(event.GetX(), event.GetY()));
				double ray_start[3], ray_direction[3];
				extract(ray.Location(), ray_start);
				extract(ray.Direction(), ray_direction);
				marked_object.GetFirstOfTopOnly();
				object->SetClickMarkPoint(marked_object.GetCurrent(), ray_start, ray_direction);
			}
		}
		else
		{
			if(!event.ShiftDown() && !event.ControlDown())
			{
				wxGetApp().m_marked_list->Clear(true);
			}
		}
	}

	if(m_just_one && m_doing_a_main_loop && (wxGetApp().m_marked_list->size() > 0))
	{
		ExitMainLoop();
	}
	else
	{
		wxGetApp().m_current_viewport->m_need_refresh = true;
	}
}
Example #6
0
	void Run(){ExitMainLoop();}
Example #7
0
void CDoubleInput::OnMouse( wxMouseEvent& event )
{
	bool event_used = false;
	if(LeftAndRightPressed(event, event_used))
		ExitMainLoop();
}
Example #8
0
	void Run(){
		CDoubleInput::m_success = true;
		ExitMainLoop();
	}
Example #9
0
void WxeApp::shutdown(wxeMetaCommand& Ecmd) {
  wxe_status = WXE_EXITING;
  ExitMainLoop();
  delete wxe_queue;
  delete wxe_queue_cb_saved;
}
Example #10
0
void App::onQuit(wxCommandEvent&)
{
    ExitMainLoop();
}
Example #11
0
void WxeApp::shutdown(wxeMetaCommand& Ecmd) {
  ExitMainLoop();
}
Example #12
0
void OyunApp::OnMenuExit(wxCommandEvent & WXUNUSED(event))
{
	// Quit, forcibly
	ExitMainLoop();
}