Updated manual
[mussa.git] / qui / ThresholdWidget.hpp
1 #ifndef _THRESHOLD_WIDGET_H_ 
2 #define _THRESHOLD_WIDGET_H_
3
4 #include <QLabel>
5 #include <QSpinBox>
6 #include <QWidget>
7
8 class ThresholdWidget : public QWidget
9 {
10   Q_OBJECT 
11
12 public: 
13   ThresholdWidget(QWidget *parent = 0, int min=20, int max=30);
14
15   //! return min_threshold/max_threshold
16   double min_ratio() const;
17   //! return current_threshold/maximum_threshold
18   double ratio() const;
19   //! return our current threshold
20   int threshold() const;
21
22 public slots:
23   void setBasepairThreshold(int threshold);
24   void setPercentThreshold(int percent_threshold);
25   //! set the min and max base pair range
26   void setRange(int min, int max);
27
28 signals:
29   //! the current number of base pairs needed for a window of conservation
30   void thresholdChanged(int new_threshold);
31
32 protected:
33   QSpinBox basepair_spinner;
34   QLabel window_size_label;
35   QSpinBox percent_spinner;
36
37   int cur_bp_threshold;
38   int cur_percent_threshold;
39 };
40 const int threshold_max_display_digits = 2;
41
42 #endif