00001 /********************************************************************** 00002 ** MGraph 00003 ** 00004 ** A reusable graph widget 00005 ** 00006 ** Copyright (C) 2002, Michael Lauer 00007 ** mickey@tm.informatik.uni-frankfurt.de 00008 ** http://www.Vanille.de 00009 ** 00010 ** This file may be distributed and/or modified under the terms of the 00011 ** GNU General Public License version 2 as published by the Free Software 00012 ** Foundation and appearing in the file LICENSE.GPL included in the 00013 ** packaging of this file. 00014 ** 00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 ** 00018 **********************************************************************/ 00019 00020 #ifndef MGRAPH_H 00021 #define MGRAPH_H 00022 00023 #include <qframe.h> 00024 #include <qvaluelist.h> 00025 00026 typedef QValueList<int> ValueList; 00027 00028 class MGraph : public QFrame 00029 { 00030 Q_OBJECT 00031 public: 00032 MGraph( QWidget *parent = 0, const char *name = 0, WFlags f = 0); 00033 ~MGraph(); 00034 00035 void addValue( int value, bool followMax = true ); 00036 void setMax( int value ) { max = value; }; 00037 void setMin( int value ) { min = value; }; 00038 00039 virtual void setFrameStyle( int style ); 00040 00041 protected: 00042 virtual void drawContents( QPainter* ); 00043 int min; 00044 int max; 00045 ValueList* values; 00046 00047 QPixmap* background; 00048 00049 private: 00050 00051 }; 00052 00053 #endif
1.4.2