projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r579: no message
[ctsim.git]
/
src
/
backgroundmgr.cpp
diff --git
a/src/backgroundmgr.cpp
b/src/backgroundmgr.cpp
index ee789deb155b0128914c7f259a24c42b9c8cda9e..34f568bccbc1e7c2fa12509dc0758ffe5fd3a06c 100644
(file)
--- 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
**
** 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.
7 2001/02/25 07:36:26
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
**
** 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 "ctsim.h"
#include "docs.h"
#include "views.h"
-#include "
threadrecon
.h"
+#include "
backgroundsupr
.h"
#include "backgroundmgr.h"
#include "backgroundmgr.h"
@@
-67,7
+67,7
@@
BackgroundManager::BackgroundManager ()
m_sizeButton.Set (70, 20);
m_sizeCell.Set (m_sizeGauge.x + m_sizeLabel.x + m_sizeCellSpacing.x + m_sizeButton.x, 25);
m_sizeButton.Set (70, 20);
m_sizeCell.Set (m_sizeGauge.x + m_sizeLabel.x + m_sizeCellSpacing.x + m_sizeButton.x, 25);
-
+
Show(false);
}
Show(false);
}
@@
-141,7
+141,10
@@
BackgroundManager::OnAddTask (wxCommandEvent& event)
m_iNumTasks++;
resizeWindow();
m_iNumTasks++;
resizeWindow();
- Show(true);
+ if (m_iNumTasks == 1) {
+ Show(true);
+ theApp->getMainFrame()->SetFocus(); // necessary to keep wxWindows from crashing
+ }
}
void
}
void
@@
-197,6
+200,8
@@
BackgroundManager::lookupGauge (BackgroundSupervisor* pTask)
{
wxGauge* pGauge = NULL;
int i = 0;
{
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];
for (TaskContainer::iterator iTask = m_vecpBackgroundTasks.begin(); iTask != m_vecpBackgroundTasks.end(); iTask++) {
if (*iTask == pTask) {
pGauge = m_vecpGauges[i];
@@
-226,7
+231,7
@@
BackgroundManager::resizeWindow()
IMPLEMENT_DYNAMIC_CLASS(BackgroundManagerCanvas, wxPanel)
BEGIN_EVENT_TABLE(BackgroundManagerCanvas, wxPanel)
IMPLEMENT_DYNAMIC_CLASS(BackgroundManagerCanvas, wxPanel)
BEGIN_EVENT_TABLE(BackgroundManagerCanvas, wxPanel)
-EVT_PAINT(BackgroundManagerCanvas::OnPaint)
+
//
EVT_PAINT(BackgroundManagerCanvas::OnPaint)
END_EVENT_TABLE()
BackgroundManagerCanvas::BackgroundManagerCanvas (BackgroundManager* pMgr)
END_EVENT_TABLE()
BackgroundManagerCanvas::BackgroundManagerCanvas (BackgroundManager* pMgr)
@@
-234,7
+239,7
@@
BackgroundManagerCanvas::BackgroundManagerCanvas (BackgroundManager* pMgr)
{
}
{
}
-
+#if 0
void
BackgroundManagerCanvas::OnPaint (wxPaintEvent& event)
{
void
BackgroundManagerCanvas::OnPaint (wxPaintEvent& event)
{
@@
-242,3
+247,4
@@
BackgroundManagerCanvas::OnPaint (wxPaintEvent& event)
// dc.DrawLine (0, 0, 30, 30);
// dc.DrawLine (30,0, 0, 30);
}
// dc.DrawLine (0, 0, 30, 30);
// dc.DrawLine (30,0, 0, 30);
}
+#endif
\ No newline at end of file