bar.h
00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Hans Karlsson * 00003 * karlsson.h@home.se * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 ***************************************************************************/ 00010 #ifndef BAR_H 00011 #define BAR_H 00012 00013 #include "meter.h" 00014 #include <tqpixmap.h> 00015 #include <tqstring.h> 00016 #include <tqpainter.h> 00017 00018 class Bar : public Meter 00019 { 00020 Q_OBJECT 00021 00022 public: 00023 Bar(karamba* k,int ix,int iy,int iw,int ih ); 00024 ~Bar(); 00025 00026 void mUpdate( TQPainter * ); 00027 00028 virtual void setMax( long m ); 00029 virtual void setMin( long m ); 00030 00031 public slots: 00032 bool setImage( TQString imagePath ); 00033 TQString getImage() { return imagePath; }; 00034 00035 void setValue( long ); 00036 long getValue() { return barValue; }; 00037 void setValue( TQString ); 00038 void recalculateValue() {setValue(barValue); }; 00039 00040 void setVertical( bool ); 00041 int getVertical() { return vertical; }; 00042 00043 private: 00044 long barValue; 00045 long value; 00046 00047 int pixmapWidth; 00048 int pixmapHeight; 00049 00050 bool vertical; // vertical bar? 00051 00052 TQString imagePath; 00053 TQPixmap pixmap; 00054 } 00055 ; 00056 #endif // BAR_H