diff --git a/Modules/Overlays/QmitkCustomWidgetOverlay.cpp b/Modules/Overlays/QmitkCustomWidgetOverlay.cpp new file mode 100644 index 0000000000..ebfe2feb5b --- /dev/null +++ b/Modules/Overlays/QmitkCustomWidgetOverlay.cpp @@ -0,0 +1,40 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date: 2010-01-14 14:20:26 +0100 (Thu, 14 Jan 2010) $ +Version: $Revision: 21047 $ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include "QmitkCustomWidgetOverlay.h" + + +QmitkCustomWidgetOverlay::QmitkCustomWidgetOverlay( const char* id ) +: QmitkOverlay(id) +{ + QmitkOverlay::AddDropShadow( m_Widget ); +} + +QmitkCustomWidgetOverlay::~QmitkCustomWidgetOverlay() +{ +} + +void QmitkCustomWidgetOverlay::SetWidget( QWidget* widget ) +{ + if ( widget != NULL ) + { + m_Widget = widget; + } +} + + + diff --git a/Modules/Overlays/QmitkCustomWidgetOverlay.h b/Modules/Overlays/QmitkCustomWidgetOverlay.h new file mode 100644 index 0000000000..e9c50220e3 --- /dev/null +++ b/Modules/Overlays/QmitkCustomWidgetOverlay.h @@ -0,0 +1,65 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date: 2009-05-28 17:19:30 +0200 (Thu, 28 May 2009) $ +Version: $Revision: 17495 $ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +#ifndef QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB +#define QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB + +// MITK +#include "QmitkOverlay.h" + +#include "OverlaysExports.h" + + +/** \class QmitkCustomWidgetOverlay +* \brief object representing a custom widget that is handled and positioned +* as an overlay. +* +* A QmitkCustomWidgetOverlay is a generic sub-class of QmitkOverlay. It +* offers the possibility to set the internal m_Widget from the outside. +* +* This offers the possibility to position custom widgets 'on top of' other +* widgets using the positioning mechanism of all overlays. +* +* \warn The custom widgets need to be configured and connected manually. +* Properties cannot be set. +* +* \ingroup Overlays +*/ + + + class Overlays_EXPORT QmitkCustomWidgetOverlay : public QmitkOverlay + { + public: + + /** + * @brief Default Constructor + **/ + QmitkCustomWidgetOverlay( const char* id ); + + /** + * @brief Default Destructor + **/ + virtual ~QmitkCustomWidgetOverlay(); + + void SetWidget( QWidget* widget ); + + }; + + +#endif /* QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB */ + diff --git a/Modules/Overlays/files.cmake b/Modules/Overlays/files.cmake index 1d3b3feef8..590b6bb3b2 100644 --- a/Modules/Overlays/files.cmake +++ b/Modules/Overlays/files.cmake @@ -1,14 +1,17 @@ -set(CPP_FILES +SET(CPP_FILES + QmitkCustomWidgetOverlay.cpp QmitkOverlay.cpp QmitkOverlayController.cpp QmitkScalarBar.cpp QmitkScalarBarOverlay.cpp QmitkTextOverlay.cpp ) -set(MOC_H_FILES + +SET(MOC_H_FILES + QmitkCustomWidgetOverlay.h QmitkOverlay.h QmitkOverlayController.h QmitkScalarBar.h QmitkScalarBarOverlay.h ) \ No newline at end of file