1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 // Thermometer.cpp: implementation of the CThermometer class.
27 //////////////////////////////////////////////////////////////////////
30 #include "Thermometer.h"
31 #include "ConfigTool.h"
34 #define INCLUDEFILE "ide.common.h"
35 #include "IncludeSTL.h"
36 #include "common/StatusBar.h"
43 static char THIS_FILE[]=__FILE__;
47 //////////////////////////////////////////////////////////////////////
48 // Construction/Destruction
49 //////////////////////////////////////////////////////////////////////
51 CThermometer::CThermometer(int nMax,LPCTSTR psz)
53 TRACE(_T("Create thermometer nMax=%d string='%s'\n"),nMax,psz?psz:_T("<null>"));
56 AFX_MANAGE_STATE(CConfigTool::CallerModuleState);
58 AppInstance::getAppManager()->getStatusBar()->showProgressBar(psz?psz:_T(""), 0, nMax);
60 if(CConfigTool::GetMain()){
61 CConfigTool::GetMain()->SetThermometerMax(nMax);
63 CConfigTool::GetMain()->SetIdleMessage(psz);
69 CThermometer::~CThermometer()
71 TRACE(_T("Destroy thermometer\n"));
74 AFX_MANAGE_STATE(CConfigTool::CallerModuleState);
76 AppInstance::getAppManager()->getStatusBar()->hideProgressBar();
78 if(CConfigTool::GetMain()){
79 CConfigTool::GetMain()->SetThermometerMax(0);
80 CConfigTool::GetMain()->SetIdleMessage(NULL);
85 void CThermometer::Set(int n)
89 AFX_MANAGE_STATE(CConfigTool::CallerModuleState);
91 AppInstance::getAppManager()->getStatusBar()->updateProgressBar(n);
93 if(CConfigTool::GetMain()){
94 CConfigTool::GetMain()->UpdateThermometer(n);