r632: Added Clipboard functions to image files
[ctsim.git] / src / backgroundmgr.cpp
index 6d4a50cafd2ff13479b45be2c7432ee1bab600a9..55e611b766560c452c18ba86b1ba6024135f1870 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.18 2001/03/11 17:55:29 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,8 @@ BackgroundManager::OnAddTask (wxCommandEvent& event)
 
   resizeWindow();
   if (m_iNumTasks == 1) {
-       SetFocus();
+    m_pCanvas->SetFocus();
     Show(true);  
-    theApp->getMainFrame()->SetFocus();  // necessary to keep wxWindows from crashing
   }
 }
 
@@ -186,8 +186,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