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 #ifndef QMITK_STRINGPROPERTYONDEMANDDEDITOR_H_INCLUDED 00018 #define QMITK_STRINGPROPERTYONDEMANDDEDITOR_H_INCLUDED 00019 00020 #include <mitkPropertyObserver.h> 00021 #include "QmitkExtExports.h" 00022 #include <mitkStringProperty.h> 00023 #include <QLayout> 00024 #include <QLabel> 00025 00026 class QmitkExt_EXPORT QClickableLabel2 : public QLabel 00027 { 00028 Q_OBJECT 00029 00030 signals: 00031 void clicked(); 00032 00033 public: 00034 00035 QClickableLabel2( QWidget * parent, Qt::WindowFlags f = 0 ) 00036 :QLabel(parent, f) 00037 { 00038 } 00039 00040 virtual void mouseReleaseEvent( QMouseEvent* ) 00041 { 00042 emit clicked(); 00043 } 00044 }; 00045 00046 00048 class QmitkExt_EXPORT QmitkStringPropertyOnDemandEdit : public QFrame, public mitk::PropertyEditor 00049 { 00050 Q_OBJECT 00051 00052 public: 00053 00054 QmitkStringPropertyOnDemandEdit( mitk::StringProperty*, QWidget* parent ); 00055 virtual ~QmitkStringPropertyOnDemandEdit(); 00056 00057 //virtual void setPalette ( const QPalette & ); 00058 //virtual void setBackgroundMode ( BackgroundMode ); 00059 protected: 00060 00061 virtual void PropertyChanged(); 00062 virtual void PropertyRemoved(); 00063 00064 mitk::StringProperty* m_StringProperty; 00065 00066 QHBoxLayout* m_layout; 00067 QLabel* m_label; 00068 QClickableLabel2* m_toolbutton; 00069 00070 protected slots: 00071 00072 void onToolButtonClicked(); 00073 00074 private: 00075 00076 }; 00077 00078 #endif 00079