00001 //# TrackBox.qo.h: boxes used for cursor tracking for display data. 00002 //# Copyright (C) 2013 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id: QtDisplayPanelGui.qo.h,v 1.7 2006/10/10 21:42:05 dking Exp $ 00027 00028 #ifndef QTVIEWER_TRACKBOX_H_ 00029 #define QTVIEWER_TRACKBOX_H_ 00030 #include <QGroupBox> 00031 #include <QTextEdit> 00032 #include <string> 00033 00034 namespace casa { //# NAMESPACE CASA - BEGIN 00035 00036 class QtDisplayData; 00037 00038 // <summary> 00039 // Helper class for QtDisplayPanelGui, for display of tracking information. 00040 // </summary> 00041 00042 // <synopsis> 00043 // TrackBox is the widget for the position the tracking information of 00044 // a single QtDisplayData within a QtDisplayPanelGui. trkgWidget_ will 00045 // show a TrackBox for each registered QDD capable of displaying tracking 00046 // information, in registration order. TrackBox is simply a QGroupBox with 00047 // a QTextEdit inside it. The QGroupBox displays the QDD's name and has 00048 // a checkbox that can be used to hide the tracking text area to save 00049 // space. TrackBox is intended to be used exclusively by QtDisplayPanelGui. 00050 // </synopsis> 00051 00052 class TrackBox : public QGroupBox { 00053 00054 Q_OBJECT; 00055 00056 public: 00057 00058 TrackBox(QtDisplayData* qdd, QWidget* parent=0); 00059 virtual ~TrackBox( ); 00060 00061 void setText( std::string trkgString); 00062 void clear() { 00063 trkgEdit_->clear(); 00064 } 00065 QtDisplayData* dd() { 00066 return qdd_; 00067 } 00068 std::string name() { 00069 return objectName().toStdString(); 00070 } 00071 00072 static int heightOpen( ) { return 75; } 00073 static int heightClosed( ) { return 25; } 00074 static int heightHeader( ) { return 30; } 00075 00076 signals: 00077 void visibilityChange( bool visible, QtDisplayData * ); 00078 00079 private slots: 00080 void visibility_event( bool visible ); 00081 00082 protected: 00083 00084 // Attempts automatic adjustment of tracking display height 00085 // according to contents. 00086 void setTrackingHeight_(); 00087 00088 QtDisplayData* qdd_; // (the QDD whose tracking info it displays). 00089 QTextEdit* trkgEdit_; // (the box's tracking info display area). 00090 00091 private: 00092 TrackBox() { } // (not intended for use) 00093 00094 }; 00095 00096 } 00097 #endif