Fl_Progress.H 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // "$Id: Fl_Progress.H 7903 2010-11-28 21:06:39Z matt $"
  3. //
  4. // Progress bar widget definitions.
  5. //
  6. // Copyright 2000-2010 by Michael Sweet.
  7. //
  8. // This library is free software; you can redistribute it and/or
  9. // modify it under the terms of the GNU Library General Public
  10. // License as published by the Free Software Foundation; either
  11. // version 2 of the License, or (at your option) any later version.
  12. //
  13. // This library is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. // Library General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Library General Public
  19. // License along with this library; if not, write to the Free Software
  20. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  21. // USA.
  22. //
  23. // Please report all bugs and problems on the following page:
  24. //
  25. // http://www.fltk.org/str.php
  26. //
  27. /* \file
  28. Fl_Progress widget . */
  29. #ifndef _Fl_Progress_H_
  30. # define _Fl_Progress_H_
  31. //
  32. // Include necessary headers.
  33. //
  34. #include "Fl_Widget.H"
  35. //
  36. // Progress class...
  37. //
  38. /**
  39. Displays a progress bar for the user.
  40. */
  41. class FL_EXPORT Fl_Progress : public Fl_Widget
  42. {
  43. float value_,
  44. minimum_,
  45. maximum_;
  46. protected:
  47. virtual void draw();
  48. public:
  49. Fl_Progress(int x, int y, int w, int h, const char *l = 0);
  50. /** Sets the maximum value in the progress widget. */
  51. void maximum(float v) { maximum_ = v; redraw(); }
  52. /** Gets the maximum value in the progress widget. */
  53. float maximum() const { return (maximum_); }
  54. /** Sets the minimum value in the progress widget. */
  55. void minimum(float v) { minimum_ = v; redraw(); }
  56. /** Gets the minimum value in the progress widget. */
  57. float minimum() const { return (minimum_); }
  58. /** Sets the current value in the progress widget. */
  59. void value(float v) { value_ = v; redraw(); }
  60. /** Gets the current value in the progress widget. */
  61. float value() const { return (value_); }
  62. };
  63. #endif // !_Fl_Progress_H_
  64. //
  65. // End of "$Id: Fl_Progress.H 7903 2010-11-28 21:06:39Z matt $".
  66. //