AxisWidget.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00014 #ifndef _AxisWidget_H_
00015 #define _AxisWidget_H_
00016 
00017 #include <qwidget.h>
00018 #if QT_VERSION < 0x040000
00019 #else
00020 //Added by the Qt porting tool:
00021 #include <QtGui/QLabel>
00022 #endif
00023 
00024 #include <string>
00025 
00026 class QLabel;
00027 class QLineEdit;
00028 class QCheckBox;
00029 class QScrollBar;
00030 
00031 namespace hippodraw {
00032 
00033 class Range;
00034 
00041 class AxisWidget : public QWidget
00042 {
00043 
00044   Q_OBJECT
00045   
00046 private:
00047   
00049   QLabel * lowTextLabel;
00050   
00052   QLabel * highTextLabel;
00053 
00055   QScrollBar * lowSlider;
00056 
00058   QScrollBar * highSlider;
00059 
00061   QLineEdit * lowTextBox;
00062 
00064   QLineEdit * highTextBox;
00065 
00067   QCheckBox * zoomPanCheckBox;
00068   
00070   bool m_isCut;
00071 
00073   double getWidthFromSlider ( const Range & fullRange );
00074   
00076   double getPositionFromSlider ( const Range & fullRange );
00077 
00079   double getLowFromSlider ( const Range & fullRange );
00080   
00082   double getHighFromSlider ( const Range & fullRange );
00083   
00085   void setSlider ( QScrollBar * s, double value, const Range & fullRange );
00086   
00089   void setSliderZero ( QScrollBar * s, double value, const Range & fullRange );
00090   
00091 public:
00092   
00095   AxisWidget ( QWidget * parent = 0, 
00096                const char * name = 0,
00097                Qt::WFlags wflags = 0 );
00098   
00100   virtual ~AxisWidget ();
00101   
00106   void processTextBoxReturnPressed ( Range & currentRange,
00107                                      const Range & fullRange );
00108 
00111   void processLowSliderReleased ( const Range & fullRange );
00112 
00115   void processLowSliderMoved ( int value,
00116                                Range & currentRange,
00117                                const Range & fullRange );
00118 
00121   void processHighSliderReleased ( const Range & fullRange );
00122 
00125   void processHighSliderMoved ( int value,
00126                                 Range & currentRange,
00127                                 const Range & fullRange );
00128 
00131   void processZoomPanCheckBoxClicked ( const Range & currentRange,
00132                                        const Range & fullRange );
00133 
00135   void setCut ( bool flag );
00136 
00140   void setLowText ( const  QString & s, bool readonly = false );
00141 
00145   void setHighText ( const QString & s, bool readonly = false );
00146 
00149   QScrollBar * getLowSlider ();
00150 
00152   int getLowSliderValue ();
00153   
00155   void setLowSliderValue ( int value );
00156 
00159   QScrollBar * getHighSlider ();
00160 
00162   int getHighSliderValue ();
00163   
00165   void setHighSliderValue ( int value );
00166 
00169   void invalidRangeError ( const std::string & bad );
00170 
00172   void setAllDisabled ( bool flag );
00173 
00176   void updateCutControlValues ( const Range & currentRange,
00177                                 const Range & fullRange );
00178 
00180   bool isZoomPanChecked ();
00181 
00184   void setZoomPan ( bool check, bool disables = false );
00185 
00186 signals:
00187 
00189   void lowTextReturnPressed ();
00190 
00192   void highTextReturnPressed ();
00193 
00195   void lowSliderReleased ();
00196 
00198   void lowSliderPressed ();
00199 
00201   void lowSliderValueChanged ( int value );
00202 
00204   void highSliderReleased ();
00205 
00207   void highSliderPressed ();
00208 
00210   void highSliderValueChanged ( int value );
00211 
00213   void zoomPanCheckBoxClicked ();
00214   
00215 };
00216 
00217 } // namespace hippodraw
00218 
00219 #endif // _AxisWidget_H_

Generated for HippoDraw Class Library by doxygen