00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef Fl_Valuator_H
00023 #define Fl_Valuator_H
00024
00025 #ifndef Fl_Widget_H
00026 #include "Fl_Widget.H"
00027 #endif
00028
00029
00030 #define FL_VERTICAL 0
00031 #define FL_HORIZONTAL 1
00032
00033
00049 class FL_EXPORT Fl_Valuator : public Fl_Widget {
00050
00051 double value_;
00052 double previous_value_;
00053 double min, max;
00054 double A; int B;
00055
00056 protected:
00058 int horizontal() const {return type()& FL_HORIZONTAL;}
00059 Fl_Valuator(int X, int Y, int W, int H, const char* L);
00060
00062 double previous_value() const {return previous_value_;}
00064 void handle_push() {previous_value_ = value_;}
00065 double softclamp(double);
00066 void handle_drag(double newvalue);
00067 void handle_release();
00068 virtual void value_damage();
00070 void set_value(double v) {value_ = v;}
00071
00072 public:
00073
00075 void bounds(double a, double b) {min=a; max=b;}
00077 double minimum() const {return min;}
00079 void minimum(double a) {min = a;}
00081 double maximum() const {return max;}
00083 void maximum(double a) {max = a;}
00104 void range(double a, double b) {min = a; max = b;}
00106 void step(int a) {A = a; B = 1;}
00108 void step(double a, int b) {A = a; B = b;}
00109 void step(double s);
00121 double step() const {return A/B;}
00122 void precision(int digits);
00123
00125 double value() const {return value_;}
00126 int value(double);
00127
00128 virtual int format(char*);
00129 double round(double);
00130 double clamp(double);
00131 double increment(double, int);
00132 };
00133
00134 #endif
00135
00136
00137
00138