Diffstat (limited to 'noncore/applets/wirelessapplet/mgraph.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/wirelessapplet/mgraph.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/applets/wirelessapplet/mgraph.h b/noncore/applets/wirelessapplet/mgraph.h new file mode 100644 index 0000000..e0e9c4e --- a/dev/null +++ b/noncore/applets/wirelessapplet/mgraph.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /********************************************************************** | ||
2 | ** MGraph | ||
3 | ** | ||
4 | ** A reusable graph widget | ||
5 | ** | ||
6 | ** Copyright (C) 2002, Michael Lauer | ||
7 | ** mickey@tm.informatik.uni-frankfurt.de | ||
8 | ** http://www.Vanille.de | ||
9 | ** | ||
10 | ** This file may be distributed and/or modified under the terms of the | ||
11 | ** GNU General Public License version 2 as published by the Free Software | ||
12 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
13 | ** packaging of this file. | ||
14 | ** | ||
15 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
16 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
17 | ** | ||
18 | **********************************************************************/ | ||
19 | |||
20 | #ifndef MGRAPH_H | ||
21 | #define MGRAPH_H | ||
22 | |||
23 | #include <qframe.h> | ||
24 | #include <qvaluelist.h> | ||
25 | |||
26 | typedef QValueList<int> ValueList; | ||
27 | |||
28 | class MGraph : public QFrame | ||
29 | { | ||
30 | Q_OBJECT | ||
31 | public: | ||
32 | MGraph( QWidget *parent = 0, const char *name = 0, WFlags f = 0); | ||
33 | ~MGraph(); | ||
34 | |||
35 | void addValue( int value, bool followMax = true ); | ||
36 | void setMax( int value ) { max = value; }; | ||
37 | void setMin( int value ) { min = value; }; | ||
38 | |||
39 | virtual void setFrameStyle( int style ); | ||
40 | |||
41 | protected: | ||
42 | virtual void drawContents( QPainter* ); | ||
43 | int min; | ||
44 | int max; | ||
45 | ValueList* values; | ||
46 | |||
47 | QPixmap* background; | ||
48 | |||
49 | private: | ||
50 | |||
51 | }; | ||
52 | |||
53 | #endif | ||