blob: ceba94a51c04a3ad4adda46bff86fc12589a0ad5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <tqpushbutton.h>
#include <tqpainter.h>
class KMidButton : public TQPushButton
{
protected:
TQPixmap pixmap1,pixmap2;
virtual void drawButton(TQPainter *paint)
{
if ((isOn())&&(!pixmap1.isNull())) paint->drawPixmap(0,0,pixmap1);
else if ((!isOn())&&(!pixmap2.isNull())) paint->drawPixmap(0,0,pixmap2);
};
public:
KMidButton (TQWidget *tqparent,const char *name) : TQPushButton (tqparent,name)
{
};
~KMidButton()
{
};
void setPixmaps(const TQPixmap& p1, const TQPixmap& p2)
{
pixmap1=p1;
pixmap2=p2;
};
};
|