[773] | 1 | // |
---|
| 2 | // "$Id: ProgressBar.h 2973 2003-04-20 03:17:51Z easysw $" |
---|
| 3 | // |
---|
| 4 | // Progress indicator with bar that fills up and text showing the |
---|
| 5 | // job being done and expected time to go. Not fully implemented yet. |
---|
| 6 | // |
---|
| 7 | // Copyright 1998-2003 by Bill Spitzak and others. |
---|
| 8 | // |
---|
| 9 | // This library is free software; you can redistribute it and/or |
---|
| 10 | // modify it under the terms of the GNU Library General Public |
---|
| 11 | // License as published by the Free Software Foundation; either |
---|
| 12 | // version 2 of the License, or (at your option) any later version. |
---|
| 13 | // |
---|
| 14 | // This library is distributed in the hope that it will be useful, |
---|
| 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 17 | // Library General Public License for more details. |
---|
| 18 | // |
---|
| 19 | // You should have received a copy of the GNU Library General Public |
---|
| 20 | // License along with this library; if not, write to the Free Software |
---|
| 21 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
| 22 | // USA. |
---|
| 23 | // |
---|
| 24 | // Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
| 25 | // |
---|
| 26 | |
---|
| 27 | #ifndef fltk_ProgressBar_h |
---|
| 28 | #define fltk_ProgressBar_h |
---|
| 29 | |
---|
| 30 | #include "Widget.h" |
---|
| 31 | |
---|
| 32 | namespace fltk { |
---|
| 33 | |
---|
| 34 | class FL_API ProgressBar : public Widget { |
---|
| 35 | protected: |
---|
| 36 | double mMin; |
---|
| 37 | double mMax; |
---|
| 38 | double mPresent; |
---|
| 39 | double mStep; |
---|
| 40 | bool mShowPct; |
---|
| 41 | Color mTextColor; |
---|
| 42 | void draw(); |
---|
| 43 | public: |
---|
| 44 | ProgressBar(int x, int y, int w, int h, const char *lbl = 0); |
---|
| 45 | void range(double min, double max, double step = 1) { mMin = min; mMax = max; mStep = step; }; |
---|
| 46 | void step(double step) { mPresent += step; redraw(); }; |
---|
| 47 | double minimum() { return mMin; } |
---|
| 48 | double maximum() { return mMax; } |
---|
| 49 | void minimum(double nm) { mMin = nm; }; |
---|
| 50 | void maximum(double nm) { mMax = nm; }; |
---|
| 51 | double position() { return mPresent; } |
---|
| 52 | double step() { return mStep; } |
---|
| 53 | void position(double pos) { mPresent = pos; redraw(); } |
---|
| 54 | void showtext(bool st) { mShowPct = st; } |
---|
| 55 | bool showtext() { return mShowPct; } |
---|
| 56 | void text_color(Color col) { mTextColor = col; } |
---|
| 57 | Color text_color() { return mTextColor; } |
---|
| 58 | }; |
---|
| 59 | |
---|
| 60 | } |
---|
| 61 | #endif |
---|
| 62 | |
---|