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