X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fbackgroundmgr.cpp;h=2d7714570bb5515d6db2f7092c49b8e09453e86c;hb=b4f2d26b8657e786cecf339a13fe8e53c2a0e6b5;hp=b6d0bd66d0091744e88e79f324da91fdf02638c8;hpb=3b09207d7c37bc3d48e331657353123ed2f66ed9;p=ctsim.git diff --git a/src/backgroundmgr.cpp b/src/backgroundmgr.cpp index b6d0bd6..2d77145 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.6 2001/02/25 06:32:12 kevin Exp $ +** $Id: backgroundmgr.cpp,v 1.12 2001/03/05 20:29:23 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 @@ -39,9 +39,7 @@ #include "backgroundmgr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif +#ifdef HAVE_WXTHREADS IMPLEMENT_DYNAMIC_CLASS(BackgroundManager, wxMiniFrame) @@ -64,10 +62,11 @@ BackgroundManager::BackgroundManager () m_sizeLabel.Set (140, 20); m_sizeBorder.Set (4, 4); m_sizeCellSpacing.Set (3, 3); - m_sizeButton.Set (70, 20); + //m_sizeButton.Set (70, 20); + m_sizeButton.Set (0, 0); m_sizeCell.Set (m_sizeGauge.x + m_sizeLabel.x + m_sizeCellSpacing.x + m_sizeButton.x, 25); - + Show(false); } @@ -127,22 +126,21 @@ BackgroundManager::OnAddTask (wxCommandEvent& event) wxPoint posGauge (m_sizeBorder.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); wxPoint posLabel (m_sizeBorder.x + m_sizeGauge.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); - wxPoint posButton (m_sizeBorder.x + m_sizeGauge.x + m_sizeLabel.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); wxGauge* pGauge = new wxGauge (m_pCanvas, -1, iNumUnits, posGauge, m_sizeGauge); wxStaticText* pLabel = new wxStaticText (m_pCanvas, -1, pszTaskName, posLabel, m_sizeLabel); - wxButton* pCancelButton = new wxButton (m_pCanvas, iFirstUnusedPos, _T("Cancel"), posButton, m_sizeButton, wxBU_LEFT); + // wxPoint posButton (m_sizeBorder.x + m_sizeGauge.x + m_sizeLabel.x, m_sizeBorder.y + iFirstUnusedPos * m_sizeCell.y); +// wxButton* pCancelButton = new wxButton (m_pCanvas, iFirstUnusedPos, _T("Cancel"), posButton, m_sizeButton, wxBU_LEFT); m_vecpBackgroundTasks.push_back (pTask); m_vecpGauges.push_back (pGauge); m_vecpNames.push_back (new std::string (pszTaskName)); m_vecpPositions.push_back (iFirstUnusedPos); m_vecpLabels.push_back (pLabel); - m_vecpCancelButtons.push_back (pCancelButton); + //m_vecpCancelButtons.push_back (pCancelButton); m_iNumTasks++; resizeWindow(); if (m_iNumTasks == 1) { - theApp->getMainFrame()->SetFocus(); // necessary to keep wxWindows from crashing Show(true); theApp->getMainFrame()->SetFocus(); // necessary to keep wxWindows from crashing } @@ -163,19 +161,19 @@ BackgroundManager::OnRemoveTask (wxCommandEvent& event) GaugeContainer::iterator iGauge = m_vecpGauges.begin(); PositionContainer::iterator iPosition = m_vecpPositions.begin(); LabelContainer::iterator iLabel = m_vecpLabels.begin(); - ButtonContainer::iterator iCancelButton = m_vecpCancelButtons.begin(); + //ButtonContainer::iterator iCancelButton = m_vecpCancelButtons.begin(); for (TaskContainer::iterator iTask = m_vecpBackgroundTasks.begin(); iTask != m_vecpBackgroundTasks.end(); iTask++) { if (*iTask == pTask) { delete *iName; delete *iGauge; delete *iLabel; - delete *iCancelButton; + //delete *iCancelButton; m_vecpBackgroundTasks.erase (iTask); m_vecpGauges.erase (iGauge); m_vecpNames.erase (iName); m_vecpPositions.erase (iPosition); m_vecpLabels.erase (iLabel); - m_vecpCancelButtons.erase (iCancelButton); + //m_vecpCancelButtons.erase (iCancelButton); m_iNumTasks--; break; } @@ -183,7 +181,7 @@ BackgroundManager::OnRemoveTask (wxCommandEvent& event) iGauge++; iPosition++; iLabel++; - iCancelButton++; + //iCancelButton++; } resizeWindow(); @@ -219,7 +217,7 @@ BackgroundManager::resizeWindow() { int iHighestPosition = -1; - for (int i = 0; i < m_vecpPositions.size(); i++) + for (unsigned int i = 0; i < m_vecpPositions.size(); i++) if (iHighestPosition < m_vecpPositions[i]) iHighestPosition = m_vecpPositions[i]; @@ -232,15 +230,15 @@ BackgroundManager::resizeWindow() 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) -: m_pBackgroundManager(pMgr), wxPanel (pMgr) +: wxPanel (pMgr), m_pBackgroundManager(pMgr) { } - +#if 0 void BackgroundManagerCanvas::OnPaint (wxPaintEvent& event) { @@ -248,3 +246,6 @@ BackgroundManagerCanvas::OnPaint (wxPaintEvent& event) // dc.DrawLine (0, 0, 30, 30); // dc.DrawLine (30,0, 0, 30); } +#endif + +#endif // HAVE_WXTHREADS