| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkWin32OutputWindow.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:49 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
Portions of this code are covered under the VTK copyright. |
| 13 |
|
See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details. |
| 14 |
|
|
| 15 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 16 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 17 |
IND |
*****PURPOSE. See the above copyright notices for more information. |
| 18 |
|
|
| 19 |
|
=========================================================================*/ |
| 20 |
|
#ifndef __itkWin32OutputWindow_h |
| 21 |
|
#define __itkWin32OutputWindow_h |
| 22 |
|
|
| 23 |
|
#include "itkWin32Header.h" |
| 24 |
|
#include "itkOutputWindow.h" |
| 25 |
|
#include "itkObjectFactory.h" |
| 26 |
|
#include "itkWindows.h" |
| 27 |
|
namespace itk |
| 28 |
|
{ |
| 29 |
|
|
| 30 |
|
/** \class Win32OutputWindow |
| 31 |
|
* \brief Collect error and debug messages on Win32-based systems. |
| 32 |
|
* |
| 33 |
|
* This class is used for error and debug message output on the windows |
| 34 |
|
* platform. It creates a read only EDIT control to display the |
| 35 |
|
* output. This class should not be used directly. It should |
| 36 |
|
* only be used through the interface of OutputWindow. This class |
| 37 |
|
* only handles one output window per process. If the window is destroyed, |
| 38 |
|
* the Object::GlobalWarningDisplayOff() function is called. The |
| 39 |
|
* window is created the next time text is written to the window. |
| 40 |
|
* |
| 41 |
|
* \ingroup OSSystemObjects |
| 42 |
|
*/ |
| 43 |
|
|
| 44 |
|
class ITKCommon_EXPORT Win32OutputWindow : public OutputWindow |
| 45 |
|
{ |
| 46 |
|
public: |
| 47 |
|
/** Standard class typedefs. */ |
| 48 |
|
typedef Win32OutputWindow Self; |
| 49 |
TDA |
typedef OutputWindow Superclass; |
| 50 |
|
typedef SmartPointer<Self> Pointer; |
| 51 |
TDA |
typedef SmartPointer<const Self> ConstPointer; |
| 52 |
|
|
| 53 |
|
/** Method for creation through the object factory. */ |
| 54 |
|
itkNewMacro(Self); |
| 55 |
|
|
| 56 |
|
/** Run-time type information (and related methods). */ |
| 57 |
|
itkTypeMacro(Win32OutputWindow, OutputWindow); |
| 58 |
|
|
| 59 |
|
/** Put the text into the display window. |
| 60 |
|
* Each new line is converted to a carriage return, new line. */ |
| 61 |
|
virtual void DisplayText(const char*); |
| 62 |
|
|
| 63 |
|
static LRESULT APIENTRY WndProc(HWND hWnd, UINT message, |
| 64 |
|
WPARAM wParam, LPARAM lParam); |
| 65 |
|
protected: |
| 66 |
|
Win32OutputWindow() {} |
| 67 |
|
virtual ~Win32OutputWindow(); |
| 68 |
|
|
| 69 |
|
void PromptText(const char* text); |
| 70 |
|
static void AddText(const char*); |
| 71 |
|
static int Initialize(); |
| 72 |
|
|
| 73 |
|
private: |
| 74 |
|
Win32OutputWindow(const Self&); //purposely not implemented |
| 75 |
|
void operator=(const Self&); //purposely not implemented |
| 76 |
|
|
| 77 |
|
static HWND m_OutputWindow; |
| 78 |
|
}; |
| 79 |
|
|
| 80 |
|
} // end namespace itk |
| 81 |
|
#endif // __itkWin32OutputWindow_h |
| 82 |
|
|