AxisWidget.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _AxisWidget_H_
15 #define _AxisWidget_H_
16 
17 #include <qwidget.h>
18 #if QT_VERSION < 0x040000
19 #else
20 //Added by the Qt porting tool:
21 #include <QtGui/QLabel>
22 #endif
23 
24 #include <string>
25 
26 class QLabel;
27 class QLineEdit;
28 class QCheckBox;
29 class QScrollBar;
30 
31 namespace hippodraw {
32 
33 class Range;
34 
41 class AxisWidget : public QWidget
42 {
43 
44  Q_OBJECT
45 
46 private:
47 
50 
53 
56 
59 
62 
65 
68 
70  bool m_isCut;
71 
73  double getWidthFromSlider ( const Range & fullRange );
74 
76  double getPositionFromSlider ( const Range & fullRange );
77 
79  double getLowFromSlider ( const Range & fullRange );
80 
82  double getHighFromSlider ( const Range & fullRange );
83 
85  void setSlider ( QScrollBar * s, double value, const Range & fullRange );
86 
89  void setSliderZero ( QScrollBar * s, double value, const Range & fullRange );
90 
91 public:
92 
95  AxisWidget ( QWidget * parent = 0,
96  const char * name = 0,
97  Qt::WFlags wflags = 0 );
98 
100  virtual ~AxisWidget ();
101 
106  void processTextBoxReturnPressed ( Range & currentRange,
107  const Range & fullRange );
108 
111  void processLowSliderReleased ( const Range & fullRange );
112 
115  void processLowSliderMoved ( int value,
116  Range & currentRange,
117  const Range & fullRange );
118 
121  void processHighSliderReleased ( const Range & fullRange );
122 
125  void processHighSliderMoved ( int value,
126  Range & currentRange,
127  const Range & fullRange );
128 
131  void processZoomPanCheckBoxClicked ( const Range & currentRange,
132  const Range & fullRange );
133 
135  void setCut ( bool flag );
136 
140  void setLowText ( const QString & s, bool readonly = false );
141 
145  void setHighText ( const QString & s, bool readonly = false );
146 
150 
152  int getLowSliderValue ();
153 
155  void setLowSliderValue ( int value );
156 
160 
162  int getHighSliderValue ();
163 
165  void setHighSliderValue ( int value );
166 
169  void invalidRangeError ( const std::string & bad );
170 
172  void setAllDisabled ( bool flag );
173 
176  void updateCutControlValues ( const Range & currentRange,
177  const Range & fullRange );
178 
180  bool isZoomPanChecked ();
181 
184  void setZoomPan ( bool check, bool disables = false );
185 
186 signals:
187 
189  void lowTextReturnPressed ();
190 
192  void highTextReturnPressed ();
193 
195  void lowSliderReleased ();
196 
198  void lowSliderPressed ();
199 
201  void lowSliderValueChanged ( int value );
202 
204  void highSliderReleased ();
205 
207  void highSliderPressed ();
208 
210  void highSliderValueChanged ( int value );
211 
213  void zoomPanCheckBoxClicked ();
214 
215 };
216 
217 } // namespace hippodraw
218 
219 #endif // _AxisWidget_H_
double getLowFromSlider(const Range &fullRange)
Converts the slider position to Low.
Definition: AxisWidget.cxx:595
double getHighFromSlider(const Range &fullRange)
Converts the slider position to High.
Definition: AxisWidget.cxx:611
QScrollBar * getHighSlider()
Returns the high slider.
Definition: AxisWidget.cxx:509
void processZoomPanCheckBoxClicked(const Range &currentRange, const Range &fullRange)
Called by InspectorBase in response to the zoomPanCheckBoxClicked signal.
Definition: AxisWidget.cxx:392
void processLowSliderMoved(int value, Range &currentRange, const Range &fullRange)
Called by InspectorBase in response to the lowSliderMoved signal.
Definition: AxisWidget.cxx:258
QLineEdit * lowTextBox
The text box that shows the low value.
Definition: AxisWidget.h:61
void highSliderPressed()
Emitted when highSlider is pressed.
void setZoomPan(bool check, bool disables=false)
Checks zoomPanCheckBox if check is true, else un-checks it.
Definition: AxisWidget.cxx:558
double getPositionFromSlider(const Range &fullRange)
Converts the slider position to Position.
Definition: AxisWidget.cxx:580
QLineEdit * highTextBox
The text box that shows the high value.
Definition: AxisWidget.h:64
void highSliderValueChanged(int value)
Emitted when highSlider&#39;s value has changed.
void setSlider(QScrollBar *s, double value, const Range &fullRange)
Sets the slider s to the value value.
Definition: AxisWidget.cxx:625
bool m_isCut
A boolean that is true if the AxisWidget controls a cut.
Definition: AxisWidget.h:70
void setCut(bool flag)
Set the isCut flag.
Definition: AxisWidget.cxx:454
void updateCutControlValues(const Range &currentRange, const Range &fullRange)
Set the textboxes and sliders to the values given by the arguments.
Definition: AxisWidget.cxx:535
void lowSliderValueChanged(int value)
Emitted when lowSlider&#39;s value has changed.
QScrollBar * highSlider
The high slider.
Definition: AxisWidget.h:58
A custom widget that creates high and low sliders and text boxes, and implements zoom pan on them...
Definition: AxisWidget.h:41
bool isZoomPanChecked()
Returns whether zoomPanCheckBox is checked.
Definition: AxisWidget.cxx:553
void processHighSliderReleased(const Range &fullRange)
Called by InspectorBase in response to the highSliderReleased signal.
Definition: AxisWidget.cxx:248
void processTextBoxReturnPressed(Range &currentRange, const Range &fullRange)
Called by InspectorBase in response to the lowTextReturnPressed and highTextReturnPressed signals...
Definition: AxisWidget.cxx:157
void setSliderZero(QScrollBar *s, double value, const Range &fullRange)
Sets the slider s to the value value, where the slider zero corresponds to data zero.
Definition: AxisWidget.cxx:640
int getHighSliderValue()
Get the high slider value.
Definition: AxisWidget.cxx:514
QCheckBox * zoomPanCheckBox
The zoom pan check box.
Definition: AxisWidget.h:67
void zoomPanCheckBoxClicked()
Emitted when zoomPanCheckBox is clicked.
void lowSliderReleased()
Emitted when lowSlider is released.
void setHighText(const QString &s, bool readonly=false)
Set the text in the highTextBox.
Definition: AxisWidget.cxx:484
void lowSliderPressed()
Emitted when lowSlider is pressed.
QScrollBar * lowSlider
The low slider.
Definition: AxisWidget.h:55
QScrollBar * getLowSlider()
Returns the low slider widget.
Definition: AxisWidget.cxx:492
double getWidthFromSlider(const Range &fullRange)
Converts the slider position to Width.
Definition: AxisWidget.cxx:566
void invalidRangeError(const std::string &bad)
Throws up a message box when an attempt is made to set an invalid range.
Definition: AxisWidget.cxx:461
void highSliderReleased()
Emitted when highSlider is released.
void setLowText(const QString &s, bool readonly=false)
Set the text in the lowTextBox.
Definition: AxisWidget.cxx:478
void setLowSliderValue(int value)
Set the low slider value.
Definition: AxisWidget.cxx:502
Expresses a range of values.
Definition: Range.h:33
void processHighSliderMoved(int value, Range &currentRange, const Range &fullRange)
Called by InspectorBase in response to the highSliderMoved signal.
Definition: AxisWidget.cxx:332
void highTextReturnPressed()
Emitted when highTextBox gets return pressed.
virtual ~AxisWidget()
The required virtual destructor.
Definition: AxisWidget.cxx:144
void processLowSliderReleased(const Range &fullRange)
Called by InspectorBase in response to the lowSliderReleased signal.
Definition: AxisWidget.cxx:234
void setHighSliderValue(int value)
Set the high slider value.
Definition: AxisWidget.cxx:519
QLabel * highTextLabel
The &quot;High&quot; text label.
Definition: AxisWidget.h:52
int getLowSliderValue()
Get the low slider value.
Definition: AxisWidget.cxx:497
void setAllDisabled(bool flag)
Enable all controls if flag = false, disable if true.
Definition: AxisWidget.cxx:524
QLabel * lowTextLabel
The &quot;Low&quot; text label.
Definition: AxisWidget.h:49
AxisWidget(QWidget *parent=0, const char *name=0, Qt::WFlags wflags=0)
The standard QWidget constructor.
Definition: AxisWidget.cxx:44
void lowTextReturnPressed()
Emitted when lowTextBox gets return pressed.

Generated for HippoDraw Class Library by doxygen