00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef ODINPLOT_RANGE_H
00019 #define ODINPLOT_RANGE_H
00020
00021 #include <qwidget.h>
00022
00023 #include <odinqt/floatedit.h>
00024
00025 class QScrollBar;
00026
00027
00028 class RangeWidget : public QWidget {
00029
00030 Q_OBJECT
00031
00032 public:
00033 RangeWidget(double total_min, double total_max, double start_min, double start_max, QWidget *parent);
00034 ~RangeWidget();
00035
00036 double get_min() {return min_x->get_value();}
00037 double get_max() {return max_x->get_value();}
00038
00039
00040 void set_range(double min, double max, bool discard_scrollbar=false);
00041
00042 signals:
00043 void new_range();
00044
00045
00046
00047 private slots:
00048 void new_scroll_val(int v);
00049
00050 void new_minmax_val(float);
00051
00052 private:
00053 friend class QScrollBar;
00054 friend class floatLineEdit;
00055
00056 void check_and_set_range(double min, double max);
00057 void update_scrollbar();
00058
00059 GuiGridLayout* grid;
00060 GuiScrollBar* scrollbar;
00061 floatLineEdit *min_x, *max_x;
00062
00063 double total_min_cache, total_max_cache;
00064
00065 bool react_on_scrollbar_change;
00066 };
00067
00068
00069
00070 #endif