topiechart.h

Ir a la documentación de este archivo.
00001 //***************************************************************************
00002 /*
00003  * TOra - An Oracle Toolkit for DBA's and developers
00004  * Copyright (C) 2000-2001,2001 Underscore AB
00005  * 
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation;  only version 2 of
00009  * the License is valid for this program.
00010  * 
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019  *
00020  *      As a special exception, you have permission to link this program
00021  *      with the Oracle Client libraries and distribute executables, as long
00022  *      as you follow the requirements of the GNU GPL in regard to all of the
00023  *      software in the executable aside from Oracle client libraries.
00024  *
00025  *      Specifically you are not permitted to link this program with the
00026  *      Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
00027  *      And you are not permitted to distribute binaries compiled against
00028  *      these libraries without written consent from Underscore AB. Observe
00029  *      that this does not disallow linking to the Qt Free Edition.
00030  *
00031  * All trademarks belong to their respective owners.
00032  *
00033  ****************************************************************************/
00034 
00035 #ifndef __TOPIECHART_H
00036 #define __TOPIECHART_H
00037 
00038 #include <list>
00039 #include <qwidget.h>
00040 
00041 class QPopupMenu;
00042 
00045 class toPieChart : public QWidget {
00046   Q_OBJECT
00047 
00048   std::list<double> Values;
00049   std::list<QString> Labels;
00050   QString Postfix;
00051   bool Legend;
00052   bool DisplayPercent;
00053   QString Title;
00054   QPopupMenu *Menu;
00055 
00056 protected:
00057   virtual void mouseDoubleClickEvent(QMouseEvent *e);
00058   virtual void mousePressEvent(QMouseEvent *e);
00059 public:
00065   toPieChart(QWidget *parent=NULL,const char *name=NULL,WFlags f=0);
00066 
00073   toPieChart(toPieChart *pie,QWidget *parent=NULL,const char *name=NULL,WFlags f=0);
00074 
00080   void setPostfix(const QString &post)
00081   { Postfix=post; update(); }
00085   const QString &postfix(void) const
00086   { return Postfix; }
00087 
00091   void setTitle(const QString &title=QString::null)
00092   { Title=title; update(); }
00096   const QString &title(void)
00097   { return Title; }
00098 
00102   void setDisplayPercent(bool pct)
00103   { DisplayPercent=pct; update(); }
00107   bool displayPercent(void) const
00108   { return DisplayPercent; }
00109 
00113   void showLegend(bool on)
00114   { Legend=on; update(); }
00118   bool legend(void) const
00119   { return Legend; }
00120 
00125   void setValues(std::list<double> &values,std::list<QString> &labels)
00126   { Values=values; Labels=labels; update(); }
00131   void addValue(double value,const QString &label)
00132   { Values.insert(Values.end(),value); Labels.insert(Labels.end(),label); update(); }
00136   std::list<double> &values(void)
00137   { return Values; }
00141   std::list<QString> &labels(void)
00142   { return Labels; }
00143 
00144 public slots:
00147   void editPrint(void);
00150   void openCopy(void);
00151 protected:
00154   virtual void paintChart(QPainter *p,QRect rect);
00157   virtual void paintEvent(QPaintEvent *e);
00158 };
00159 
00160 #endif

Generado el Sat May 21 00:04:45 2005 para BulmaGes por  doxygen 1.4.2