X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fbackgroundmgr.cpp;h=b6d0bd66d0091744e88e79f324da91fdf02638c8;hp=ee789deb155b0128914c7f259a24c42b9c8cda9e;hb=3b09207d7c37bc3d48e331657353123ed2f66ed9;hpb=6480e936da257519dd36840862ac995ca8c374da diff --git a/src/backgroundmgr.cpp b/src/backgroundmgr.cpp index ee789de..b6d0bd6 100644 --- a/src/backgroundmgr.cpp +++ b/src/backgroundmgr.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundmgr.cpp,v 1.5 2001/02/23 21:58:31 kevin Exp $ +** $Id: backgroundmgr.cpp,v 1.6 2001/02/25 06:32:12 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 @@ -35,7 +35,7 @@ #include "ctsim.h" #include "docs.h" #include "views.h" -#include "threadrecon.h" +#include "backgroundsupr.h" #include "backgroundmgr.h" @@ -141,7 +141,11 @@ BackgroundManager::OnAddTask (wxCommandEvent& event) m_iNumTasks++; resizeWindow(); - Show(true); + if (m_iNumTasks == 1) { + theApp->getMainFrame()->SetFocus(); // necessary to keep wxWindows from crashing + Show(true); + theApp->getMainFrame()->SetFocus(); // necessary to keep wxWindows from crashing + } } void @@ -197,6 +201,8 @@ BackgroundManager::lookupGauge (BackgroundSupervisor* pTask) { wxGauge* pGauge = NULL; int i = 0; + + wxCriticalSectionLocker locker (m_criticalSection); for (TaskContainer::iterator iTask = m_vecpBackgroundTasks.begin(); iTask != m_vecpBackgroundTasks.end(); iTask++) { if (*iTask == pTask) { pGauge = m_vecpGauges[i];