Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 
00019 #if QT_VERSION < 0x040000
00020 #else
00021 //Added by the Qt porting tool:
00022 #include <QLabel>
00023 #endif
00024 
00025 #include <string>
00026 
00027 class QLabel;
00028 class QLineEdit;
00029 class QCheckBox;
00030 class QScrollBar;
00031 class Range;
00032 
00039 class AxisWidget : public QWidget
00040 {
00041 
00042   Q_OBJECT
00043   
00044 private:
00045   
00047   QLabel * lowTextLabel;
00048   
00050   QLabel * highTextLabel;
00051 
00053   QScrollBar * lowSlider;
00054 
00056   QScrollBar * highSlider;
00057 
00059   QLineEdit * lowTextBox;
00060 
00062   QLineEdit * highTextBox;
00063 
00065   QCheckBox * zoomPanCheckBox;
00066   
00068   bool m_isCut;
00069 
00071   double getWidthFromSlider ( const Range & fullRange );
00072   
00074   double getPositionFromSlider ( const Range & fullRange );
00075 
00077   double getLowFromSlider ( const Range & fullRange );
00078   
00080   double getHighFromSlider ( const Range & fullRange );
00081   
00083   void setSlider ( QScrollBar * s, double value, const Range & fullRange );
00084   
00087   void setSliderZero ( QScrollBar * s, double value, const Range & fullRange );
00088   
00089 public:
00090   
00093   AxisWidget ( QWidget * parent = 0, 
00094                const char * name = 0,
00095                Qt::WFlags wflags = 0 );
00096   
00098   virtual ~AxisWidget ();
00099   
00104   void processTextBoxReturnPressed ( Range & currentRange,
00105                                      const Range & fullRange );
00106 
00109   void processLowSliderReleased ( const Range & fullRange );
00110 
00113   void processLowSliderMoved ( int value,
00114                                Range & currentRange,
00115                                const Range & fullRange );
00116 
00119   void processHighSliderReleased ( const Range & fullRange );
00120 
00123   void processHighSliderMoved ( int value,
00124                                 Range & currentRange,
00125                                 const Range & fullRange );
00126 
00129   void processZoomPanCheckBoxClicked ( const Range & currentRange,
00130                                        const Range & fullRange );
00131 
00133   void setCut ( bool flag );
00134 
00138   void setLowText ( const  QString & s, bool readonly = false );
00139 
00143   void setHighText ( const QString & s, bool readonly = false );
00144 
00147   QScrollBar * getLowSlider ();
00148 
00150   int getLowSliderValue ();
00151   
00153   void setLowSliderValue ( int value );
00154 
00157   QScrollBar * getHighSlider ();
00158 
00160   int getHighSliderValue ();
00161   
00163   void setHighSliderValue ( int value );
00164 
00167   void invalidRangeError ( const std::string & bad );
00168 
00170   void setAllDisabled ( bool flag );
00171 
00174   void updateCutControlValues ( const Range & currentRange,
00175                                 const Range & fullRange );
00176 
00178   bool isZoomPanChecked ();
00179 
00182   void setZoomPan ( bool check, bool disables = false );
00183 
00184 signals:
00185 
00187   void lowTextReturnPressed ();
00188 
00190   void highTextReturnPressed ();
00191 
00193   void lowSliderReleased ();
00194 
00196   void lowSliderPressed ();
00197 
00199   void lowSliderValueChanged ( int value );
00200 
00202   void highSliderReleased ();
00203 
00205   void highSliderPressed ();
00206 
00208   void highSliderValueChanged ( int value );
00209 
00211   void zoomPanCheckBoxClicked ();
00212   
00213 };
00214 
00215 #endif // _AxisWidget_H_

Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3