r628: no message
[ctsim.git] / src / backgroundmgr.cpp
index 6d4a50cafd2ff13479b45be2c7432ee1bab600a9..52ee7965cf1fc8f8af3fd3e6f501930f7f94446c 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2001 Kevin Rosenberg
 **
-**  $Id: backgroundmgr.cpp,v 1.15 2001/03/09 21:31:51 kevin Exp $
+**  $Id: backgroundmgr.cpp,v 1.16 2001/03/11 06:34:37 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
@@ -67,6 +67,7 @@ BackgroundManager::BackgroundManager ()
 
   m_sizeCell.Set (m_sizeGauge.x + m_sizeLabel.x + m_sizeCellSpacing.x + m_sizeButton.x, 25);
 
+  theApp->getMainFrame()->SetFocus();
   Show(false);
 }
 
@@ -150,9 +151,9 @@ BackgroundManager::OnAddTask (wxCommandEvent& event)
 
   resizeWindow();
   if (m_iNumTasks == 1) {
-       SetFocus();
+       theApp->getMainFrame()->SetFocus();
     Show(true);  
-    theApp->getMainFrame()->SetFocus();  // necessary to keep wxWindows from crashing
+       theApp->getMainFrame()->SetFocus();
   }
 }
 
@@ -186,8 +187,11 @@ BackgroundManager::OnRemoveTask (wxCommandEvent& event)
   }
   pSupervisor->ackRemoveBackgroundManager();
   resizeWindow();
-  if (m_iNumTasks <= 0)
+  if (m_iNumTasks <= 0) {
+    theApp->getMainFrame()->SetFocus();
     Show(false);
+    theApp->getMainFrame()->SetFocus();
+  }
 }
 
 void