00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef Fl_Valuator_H
00032 #define Fl_Valuator_H
00033
00034 #ifndef Fl_Widget_H
00035 #include "Fl_Widget.H"
00036 #endif
00037
00038
00039 #define FL_VERTICAL 0
00040 #define FL_HORIZONTAL 1
00041
00042
00055 class FL_EXPORT Fl_Valuator : public Fl_Widget {
00056
00057 double value_;
00058 double previous_value_;
00059 double min, max;
00060 double A; int B;
00061
00062 protected:
00064 int horizontal() const {return type()& FL_HORIZONTAL;}
00065 Fl_Valuator(int X, int Y, int W, int H, const char* L);
00066
00068 double previous_value() const {return previous_value_;}
00070 void handle_push() {previous_value_ = value_;}
00071 double softclamp(double);
00072 void handle_drag(double newvalue);
00073 void handle_release();
00074 virtual void value_damage();
00076 void set_value(double v) {value_ = v;}
00077
00078 public:
00079
00081 void bounds(double a, double b) {min=a; max=b;}
00083 double minimum() const {return min;}
00085 void minimum(double a) {min = a;}
00087 double maximum() const {return max;}
00089 void maximum(double a) {max = a;}
00110 void range(double a, double b) {min = a; max = b;}
00112 void step(int a) {A = a; B = 1;}
00114 void step(double a, int b) {A = a; B = b;}
00115 void step(double s);
00127 double step() const {return A/B;}
00128 void precision(int);
00129
00131 double value() const {return value_;}
00132 int value(double);
00133
00134 virtual int format(char*);
00135 double round(double);
00136 double clamp(double);
00137 double increment(double, int);
00138 };
00139
00140 #endif
00141
00142
00143
00144