** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: threadproj.cpp,v 1.6 2001/03/01 07:30:49 kevin Exp $
+** $Id: threadproj.cpp,v 1.10 2001/03/04 04:16:20 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
#include "wx/wx.h"
#endif
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
#include "ct.h"
#include "ctsim.h"
#include "docs.h"
#include "backgroundmgr.h"
#include "backgroundsupr.h"
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
+#ifdef HAVE_WXTHREADS
+
wxCriticalSection doneSection;
wxCriticalSectionLocker critsect (doneSection);
- ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc();
- if (! pProjDoc) {
- sys_error (ERR_SEVERE, "Unable to create projection file");
- return;
- }
-
Projections* pProjections = getProjections();
- pProjDoc->setProjections (pProjections);
- if (theApp->getAskDeleteNewDocs())
- pProjDoc->Modify (true);
- pProjDoc->UpdateAllViews (NULL);
- if (ProjectionFileView* projView = pProjDoc->getView()) {
- projView->OnUpdate (projView, NULL);
- projView->getFrame()->SetFocus();
- projView->getFrame()->Show(true);
- }
- *theApp->getLog() << m_pszLabel << "\n";
pProjections->setRemark (m_pszLabel);
pProjections->setCalcTime (getTimerEnd());
+ wxCommandEvent eventLog (wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT );
+ wxString msg (m_pszLabel);
+ msg += "\n";
+ eventLog.SetString( msg );
+ wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
+
+ wxCommandEvent newProjEvent (wxEVT_COMMAND_MENU_SELECTED, NEW_PROJECTIONFILE_EVENT);
+ newProjEvent.SetClientData (pProjections);
+ wxPostEvent (theApp->getMainFrame(), newProjEvent);
+
setDone();
}
ProjectorWorker::OnExit ()
{
}
+
+#endif // HAVE_WXTHREADS