Apparently I lost a } in a Mac OS X specific section of the code. Sowwy. Fixed.
[mussa.git] / qui / ThresholdWidget.hpp
index eed7ee812adf2fe12f279785ccb0597730b07461..42d4e3b4f9f41ecb3e4a76048b0bab9663e1420a 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _THRESHOLD_WIDGET_H_ 
 #define _THRESHOLD_WIDGET_H_
 
+#include <QHBoxLayout>
+#include <QLabel>
 #include <QSpinBox>
 #include <QWidget>
 
@@ -9,23 +11,43 @@ class ThresholdWidget : public QWidget
   Q_OBJECT 
 
 public: 
-  ThresholdWidget(QWidget *parent = 0, int min=21, int max=30);
-
-  //! return what percent of our maximum threshold we are.
-  float percent() const;
+  ThresholdWidget(QWidget *parent = 0, int min=20, int max=30);
+  
+  //! is the widget in read only mode
+  bool isReadOnly() const;
+  //! set the widget to specified read only state
+  void setReadOnly(bool);
+
+  //! return min_threshold/max_threshold
+  double min_ratio() const;
+  //! return current_threshold/maximum_threshold
+  double ratio() const;
   //! return our current threshold
   int threshold() const;
+  //! update percent threshold
+  void updatePercentThreshold();
+  
+  void reset(int min, int max, int threshold);
 
 public slots:
-  void setThreshold(int threshold);
+  void setBasepairThreshold(int threshold);
+  //void setPercentThreshold(int percent_threshold);
+  //! set the min and max base pair range
   void setRange(int min, int max);
 
 signals:
+  //! the current number of base pairs needed for a window of conservation
   void thresholdChanged(int new_threshold);
 
 protected:
-  QSpinBox basepair_spinner;
-
+  void setupWidgets();
+  QHBoxLayout *layout;
+  QSpinBox *basepair_spinner;
+  QLabel *window_size_label;
+  QLabel *percent_label;
+
+  int cur_bp_threshold;
+  int cur_percent_threshold;
 };
 const int threshold_max_display_digits = 2;