Fl_Adjuster.H 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // "$Id: Fl_Adjuster.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
  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. /* \file
  19. Fl_Adjuster widget . */
  20. // 3-button "slider", made for Nuke
  21. #ifndef Fl_Adjuster_H
  22. #define Fl_Adjuster_H
  23. #ifndef Fl_Valuator_H
  24. #include "Fl_Valuator.H"
  25. #endif
  26. /**
  27. The Fl_Adjuster widget was stolen from Prisms, and has proven
  28. to be very useful for values that need a large dynamic range.
  29. \image html adjuster1.png
  30. \image latex adjuster1.png "Fl_Adjuster" width=4cm
  31. <P>When you press a button and drag to the right the value increases.
  32. When you drag to the left it decreases. The largest button adjusts by
  33. 100 * step(), the next by 10 * step() and that
  34. smallest button by step(). Clicking on the buttons
  35. increments by 10 times the amount dragging by a pixel does. Shift +
  36. click decrements by 10 times the amount.
  37. */
  38. class FL_EXPORT Fl_Adjuster : public Fl_Valuator {
  39. int drag;
  40. int ix;
  41. int soft_;
  42. protected:
  43. void draw();
  44. int handle(int);
  45. void value_damage();
  46. public:
  47. Fl_Adjuster(int X,int Y,int W,int H,const char *l=0);
  48. /**
  49. If "soft" is turned on, the user is allowed to drag the value outside
  50. the range. If they drag the value to one of the ends, let go, then
  51. grab again and continue to drag, they can get to any value. Default is
  52. one.
  53. */
  54. void soft(int s) {soft_ = s;}
  55. /**
  56. If "soft" is turned on, the user is allowed to drag the value outside
  57. the range. If they drag the value to one of the ends, let go, then
  58. grab again and continue to drag, they can get to any value. Default is
  59. one.
  60. */
  61. int soft() const {return soft_;}
  62. //DAD Extensios
  63. DECLARE_CLASS_CHEAP_RTTI_2(Fl_Adjuster, Fl_Valuator)
  64. };
  65. #endif
  66. //
  67. // End of "$Id: Fl_Adjuster.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
  68. //