00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _FLU_DUAL_SLIDER_H
00017 #define _FLU_DUAL_SLIDER_H
00018
00019 #include <FL/Fl.H>
00020 #include <FL/Fl_Valuator.H>
00021 #include <FL/Fl_Slider.H>
00022
00023 #include <stdlib.h>
00024 #include <string.h>
00025 #include <stdio.h>
00026
00027 #include "FLU/Flu_Enumerations.h"
00028
00030 class FLU_EXPORT Flu_Dual_Slider : public Fl_Valuator
00031 {
00032 public:
00033
00035 Flu_Dual_Slider( int x, int y, int w, int h, const char *l = 0 );
00036
00038 ~Flu_Dual_Slider();
00039
00041 int handle( int event );
00042
00044 void draw();
00045
00047 inline void overlap( bool b )
00048 { _overlap = b; }
00049
00051 inline bool overlap() const
00052 { return _overlap; }
00053
00055 inline void low_value( float v )
00056 { lowValue = v; Fl_Valuator::value(v); }
00057
00059 inline float low_value() const
00060 { return minimum()>maximum() ? (minimum()+maximum()-highValue) : lowValue; }
00061
00063 inline void high_value( float v )
00064 { highValue = v; Fl_Valuator::value(v); }
00065
00067 inline float high_value() const
00068 { return minimum()>maximum() ? (minimum()+maximum()-lowValue) : highValue; }
00069
00071 inline void value( float lo, float hi )
00072 { low_value(lo); high_value(hi); }
00073
00074 protected:
00075
00076 inline bool _horizontal()
00077 { return( type() == FL_HOR_NICE_SLIDER || type() == FL_HOR_SLIDER ); }
00078 inline bool _nice()
00079 { return( type() == FL_HOR_NICE_SLIDER || type() == FL_VERT_NICE_SLIDER ); }
00080
00081 float highValue, lowValue;
00082
00083 bool _lFocus, _flip, _overlap;
00084 int _grab, _delta;
00085 float _lVal, _hVal;
00086 int _lHandle[4], _hHandle[4];
00087 bool _lGrabbed, _hGrabbed;
00088 int _grabDelta;
00089 };
00090
00091 #endif