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_

Generated for HippoDraw Class Library by doxygen