You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#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 *parent,const char *name) : TQPushButton (parent,name)
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
~KMidButton()
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
void setPixmaps(const TQPixmap& p1, const TQPixmap& p2)
|
|
|
|
{
|
|
|
|
pixmap1=p1;
|
|
|
|
pixmap2=p2;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|