1 /*****************************************************************************
4 ** Name: backgroundmgr.h
5 ** Purpose: Header file for background manager
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: February 2001
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2001 Kevin Rosenberg
12 ** $Id: backgroundmgr.h,v 1.8 2001/03/05 20:29:23 kevin Exp $
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
28 #ifndef _BACKGROUND_MGR_H
31 #include "wx/wxprec.h"
36 #include "wx/minifram.h"
43 #include "threadrecon.h"
49 class BackgroundManagerCanvas;
52 //class BackgroundManager : public wxMDIChildFrame
54 class BackgroundManager : public wxMiniFrame
57 DECLARE_DYNAMIC_CLASS(BackgroundManager)
59 wxCriticalSection m_criticalSection;
60 BackgroundManagerCanvas* m_pCanvas;
63 typedef std::vector<BackgroundSupervisor*> TaskContainer;
64 typedef std::vector<wxGauge*> GaugeContainer;
65 typedef std::vector<std::string*> StringContainer;
66 typedef std::vector<int> PositionContainer;
67 typedef std::vector<wxStaticText*> LabelContainer;
68 typedef std::vector<wxButton*> ButtonContainer;
69 TaskContainer m_vecpBackgroundTasks;
70 GaugeContainer m_vecpGauges;
71 StringContainer m_vecpNames;
72 PositionContainer m_vecpPositions;
73 LabelContainer m_vecpLabels;
74 ButtonContainer m_vecpCancelButtons;
79 wxSize m_sizeCellSpacing;
83 wxGauge* lookupGauge(BackgroundSupervisor* pTask);
88 TaskContainer& getTasks() { return m_vecpBackgroundTasks;}
89 GaugeContainer& getGauges() { return m_vecpGauges;}
90 StringContainer& getNames() { return m_vecpNames;}
91 PositionContainer& getPositions() { return m_vecpPositions;}
92 LabelContainer& getLabels() { return m_vecpLabels;}
93 ButtonContainer& getCancelButtons() { return m_vecpCancelButtons;}
95 void OnAddTask (wxCommandEvent& event);
96 void OnRemoveTask (wxCommandEvent& event);
97 void OnUnitTick (wxCommandEvent& event);
98 void OnCloseWindow(wxCloseEvent& event);
99 void OnCancelButton(wxCommandEvent& event);
101 DECLARE_EVENT_TABLE()
105 class BackgroundManagerCanvas : public wxPanel {
107 DECLARE_DYNAMIC_CLASS(BackgroundManagerCanvas)
108 BackgroundManager* m_pBackgroundManager;
111 BackgroundManagerCanvas (BackgroundManager* pBkgdMgr = NULL);
113 void OnPaint (wxPaintEvent& event);
115 DECLARE_EVENT_TABLE()
118 #endif // HAVE_WXTHREADS
120 #endif // _BACKGROUNDMGR_H