Fl_Progress.H 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // "$Id: Fl_Progress.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
  3. //
  4. // Progress bar widget definitions.
  5. //
  6. // Copyright 2000-2010 by Michael Sweet.
  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_Progress widget . */
  20. #ifndef _Fl_Progress_H_
  21. # define _Fl_Progress_H_
  22. //
  23. // Include necessary headers.
  24. //
  25. #include "Fl_Widget.H"
  26. //
  27. // Progress class...
  28. //
  29. /**
  30. Displays a progress bar for the user.
  31. */
  32. class FL_EXPORT Fl_Progress : public Fl_Widget {
  33. float value_,
  34. minimum_,
  35. maximum_;
  36. protected:
  37. virtual void draw();
  38. public:
  39. Fl_Progress(int x, int y, int w, int h, const char *l = 0);
  40. /** Sets the maximum value in the progress widget. */
  41. void maximum(float v) { maximum_ = v; redraw(); }
  42. /** Gets the maximum value in the progress widget. */
  43. float maximum() const { return (maximum_); }
  44. /** Sets the minimum value in the progress widget. */
  45. void minimum(float v) { minimum_ = v; redraw(); }
  46. /** Gets the minimum value in the progress widget. */
  47. float minimum() const { return (minimum_); }
  48. /** Sets the current value in the progress widget. */
  49. void value(float v) { value_ = v; redraw(); }
  50. /** Gets the current value in the progress widget. */
  51. float value() const { return (value_); }
  52. DECLARE_CLASS_CHEAP_RTTI_2(Fl_Progress, Fl_Widget)
  53. };
  54. #endif // !_Fl_Progress_H_
  55. //
  56. // End of "$Id: Fl_Progress.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
  57. //