1 // 2 // "$Id$" 3 // 4 // Adjuster widget header file for the Fast Light Tool Kit (FLTK). 5 // 6 // Copyright 1998-2010 by Bill Spitzak and others. 7 // 8 // This library is free software. Distribution and use rights are outlined in 9 // the file "COPYING" which should have been included with this file. If this 10 // file is missing or damaged, see the license at: 11 // 12 // http://www.fltk.org/COPYING.php 13 // 14 // Please report all bugs and problems on the following page: 15 // 16 // http://www.fltk.org/str.php 17 // 18 19 /* \file 20 Fl_Adjuster widget . */ 21 22 // 3-button "slider", made for Nuke 23 24 #ifndef Fl_Adjuster_H 25 #define Fl_Adjuster_H 26 27 #ifndef Fl_Valuator_H 28 #include "Fl_Valuator.H" 29 #endif 30 31 /** 32 The Fl_Adjuster widget was stolen from Prisms, and has proven 33 to be very useful for values that need a large dynamic range. 34 \image html adjuster1.png 35 \image latex adjuster1.png "Fl_Adjuster" width=4cm 36 <P>When you press a button and drag to the right the value increases. 37 When you drag to the left it decreases. The largest button adjusts by 38 100 * step(), the next by 10 * step() and that 39 smallest button by step(). Clicking on the buttons 40 increments by 10 times the amount dragging by a pixel does. Shift + 41 click decrements by 10 times the amount. 42 */ 43 class FL_EXPORT Fl_Adjuster : public Fl_Valuator { 44 int drag; 45 int ix; 46 int soft_; 47 protected: 48 void draw(); 49 int handle(int); 50 void value_damage(); 51 public: 52 Fl_Adjuster(int X,int Y,int W,int H,const char *l=0); 53 /** 54 If "soft" is turned on, the user is allowed to drag the value outside 55 the range. If they drag the value to one of the ends, let go, then 56 grab again and continue to drag, they can get to any value. Default is 57 one. 58 */ soft(int s)59 void soft(int s) {soft_ = s;} 60 /** 61 If "soft" is turned on, the user is allowed to drag the value outside 62 the range. If they drag the value to one of the ends, let go, then 63 grab again and continue to drag, they can get to any value. Default is 64 one. 65 */ soft()66 int soft() const {return soft_;} 67 }; 68 69 #endif 70 71 // 72 // End of "$Id$". 73 // 74