casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackBox.qo.h
Go to the documentation of this file.
1 //# TrackBox.qo.h: boxes used for cursor tracking for display data.
2 //# Copyright (C) 2013
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: QtDisplayPanelGui.qo.h,v 1.7 2006/10/10 21:42:05 dking Exp $
27 
28 #ifndef QTVIEWER_TRACKBOX_H_
29 #define QTVIEWER_TRACKBOX_H_
30 #include <QGroupBox>
31 #include <QTextEdit>
32 #include <string>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36  class QtDisplayData;
37 
38  // <summary>
39  // Helper class for QtDisplayPanelGui, for display of tracking information.
40  // </summary>
41 
42  // <synopsis>
43  // TrackBox is the widget for the position the tracking information of
44  // a single QtDisplayData within a QtDisplayPanelGui. trkgWidget_ will
45  // show a TrackBox for each registered QDD capable of displaying tracking
46  // information, in registration order. TrackBox is simply a QGroupBox with
47  // a QTextEdit inside it. The QGroupBox displays the QDD's name and has
48  // a checkbox that can be used to hide the tracking text area to save
49  // space. TrackBox is intended to be used exclusively by QtDisplayPanelGui.
50  // </synopsis>
51 
52  class TrackBox : public QGroupBox {
53 
54  Q_OBJECT;
55 
56  public:
57 
58  TrackBox(QtDisplayData* qdd, QWidget* parent=0);
59  virtual ~TrackBox( );
60 
61  void setText( std::string trkgString);
62  void clear() {
63  trkgEdit_->clear();
64  }
66  return qdd_;
67  }
68  std::string name() {
69  return objectName().toStdString();
70  }
71 
72  static int heightOpen( ) { return 75; }
73  static int heightClosed( ) { return 25; }
74  static int heightHeader( ) { return 30; }
75 
76  signals:
77  void visibilityChange( bool visible, QtDisplayData * );
78 
79  private slots:
80  void visibility_event( bool visible );
81 
82  protected:
83 
84  // Attempts automatic adjustment of tracking display height
85  // according to contents.
86  void setTrackingHeight_();
87 
88  QtDisplayData* qdd_; // (the QDD whose tracking info it displays).
89  QTextEdit* trkgEdit_; // (the box's tracking info display area).
90 
91  private:
92  TrackBox() { } // (not intended for use)
93 
94  };
95 
96 }
97 #endif
static int heightHeader()
Definition: TrackBox.qo.h:74
void visibility_event(bool visible)
std::string name()
Definition: TrackBox.qo.h:68
void visibilityChange(bool visible, QtDisplayData *)
void setTrackingHeight_()
Attempts automatic adjustment of tracking display height according to contents.
static int heightOpen()
Definition: TrackBox.qo.h:72
QTextEdit * trkgEdit_
Definition: TrackBox.qo.h:89
QtDisplayData * qdd_
Definition: TrackBox.qo.h:88
Helper class for QtDisplayPanelGui, for display of tracking information.
Definition: TrackBox.qo.h:52
virtual ~TrackBox()
QtDisplayData * dd()
Definition: TrackBox.qo.h:65
static int heightClosed()
Definition: TrackBox.qo.h:73
void setText(std::string trkgString)