You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.1KB

  1. //
  2. // "$Id: Fl_Progress.H 8306 2011-01-24 17:04:22Z 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. float value_,
  43. minimum_,
  44. maximum_;
  45. protected:
  46. virtual void draw();
  47. public:
  48. Fl_Progress(int x, int y, int w, int h, const char *l = 0);
  49. /** Sets the maximum value in the progress widget. */
  50. void maximum(float v) { maximum_ = v; redraw(); }
  51. /** Gets the maximum value in the progress widget. */
  52. float maximum() const { return (maximum_); }
  53. /** Sets the minimum value in the progress widget. */
  54. void minimum(float v) { minimum_ = v; redraw(); }
  55. /** Gets the minimum value in the progress widget. */
  56. float minimum() const { return (minimum_); }
  57. /** Sets the current value in the progress widget. */
  58. void value(float v) { value_ = v; redraw(); }
  59. /** Gets the current value in the progress widget. */
  60. float value() const { return (value_); }
  61. };
  62. #endif // !_Fl_Progress_H_
  63. //
  64. // End of "$Id: Fl_Progress.H 8306 2011-01-24 17:04:22Z matt $".
  65. //