summaryrefslogtreecommitdiffstats
path: root/kmid/kmidbutton.h
diff options
context:
space:
mode:
Diffstat (limited to 'kmid/kmidbutton.h')
-rw-r--r--kmid/kmidbutton.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/kmid/kmidbutton.h b/kmid/kmidbutton.h
new file mode 100644
index 00000000..cda01f59
--- /dev/null
+++ b/kmid/kmidbutton.h
@@ -0,0 +1,32 @@
+#include <qpushbutton.h>
+#include <qpainter.h>
+
+class KMidButton : public QPushButton
+{
+protected:
+
+ QPixmap pixmap1,pixmap2;
+
+ virtual void drawButton(QPainter *paint)
+ {
+ if ((isOn())&&(!pixmap1.isNull())) paint->drawPixmap(0,0,pixmap1);
+ else if ((!isOn())&&(!pixmap2.isNull())) paint->drawPixmap(0,0,pixmap2);
+ };
+
+public:
+
+ KMidButton (QWidget *parent,const char *name) : QPushButton (parent,name)
+ {
+ };
+
+ ~KMidButton()
+ {
+ };
+
+ void setPixmaps(const QPixmap& p1, const QPixmap& p2)
+ {
+ pixmap1=p1;
+ pixmap2=p2;
+ };
+
+};