00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #include "mitkStatusBar.h" 00020 #include <itkObjectFactory.h> 00021 #include <itkOutputWindow.h> 00022 00023 00024 namespace mitk { 00025 00026 StatusBarImplementation* StatusBar::m_Implementation = NULL; 00027 StatusBar* StatusBar::m_Instance = NULL; 00028 00032 void StatusBar::DisplayText(const char* t) 00033 { 00034 if (m_Implementation != NULL) 00035 m_Implementation->DisplayText(t); 00036 } 00037 00041 void StatusBar::DisplayText(const char* t, int ms) 00042 { 00043 if (m_Implementation != NULL) 00044 m_Implementation->DisplayText(t, ms); 00045 } 00046 00047 void StatusBar::DisplayErrorText(const char *t) 00048 { 00049 if (m_Implementation != NULL) 00050 m_Implementation->DisplayErrorText(t); 00051 } 00052 void StatusBar::DisplayWarningText(const char *t) 00053 { 00054 if (m_Implementation != NULL) 00055 m_Implementation->DisplayWarningText(t); 00056 } 00057 void StatusBar::DisplayWarningText(const char *t, int ms) 00058 { 00059 if (m_Implementation != NULL) 00060 m_Implementation->DisplayWarningText(t, ms); 00061 } 00062 void StatusBar::DisplayGenericOutputText(const char *t) 00063 { 00064 if (m_Implementation != NULL) 00065 m_Implementation->DisplayGenericOutputText(t); 00066 } 00067 void StatusBar::DisplayDebugText(const char *t) 00068 { 00069 if (m_Implementation != NULL) 00070 m_Implementation->DisplayDebugText(t); 00071 } 00072 void StatusBar::DisplayGreyValueText(const char *t) 00073 { 00074 if (m_Implementation != NULL) 00075 m_Implementation->DisplayGreyValueText(t); 00076 } 00077 void StatusBar::Clear() 00078 { 00079 if ( m_Implementation != NULL) 00080 m_Implementation->Clear(); 00081 } 00082 void StatusBar::SetSizeGripEnabled(bool enable) 00083 { 00084 if (m_Implementation != NULL) 00085 { 00086 m_Implementation->SetSizeGripEnabled(enable); 00087 } 00088 } 00092 StatusBar* StatusBar::GetInstance() 00093 { 00094 if (m_Instance == NULL)//if not set, then send a errormessage on OutputWindow 00095 { 00096 m_Instance = new StatusBar(); 00097 } 00098 00099 return m_Instance; 00100 } 00101 00105 void StatusBar::SetImplementation(StatusBarImplementation* implementation) 00106 { 00107 if ( m_Implementation == implementation ) 00108 { 00109 return; 00110 } 00111 m_Implementation = implementation; 00112 } 00113 00114 StatusBar::StatusBar() 00115 { 00116 } 00117 00118 StatusBar::~StatusBar() 00119 { 00120 } 00121 00122 }//end namespace mitk