~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to kmid/kmidbutton.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <qpushbutton.h>
 
2
#include <qpainter.h>
 
3
 
 
4
class KMidButton : public QPushButton
 
5
{
 
6
protected:
 
7
    
 
8
    QPixmap pixmap1,pixmap2;
 
9
 
 
10
    virtual void drawButton(QPainter *paint)
 
11
    {
 
12
        if ((isOn())&&(!pixmap1.isNull())) paint->drawPixmap(0,0,pixmap1);
 
13
        else if ((!isOn())&&(!pixmap2.isNull())) paint->drawPixmap(0,0,pixmap2);
 
14
    };
 
15
    
 
16
public:
 
17
    
 
18
    KMidButton (QWidget *parent,const char *name) : QPushButton (parent,name)
 
19
    {
 
20
    };
 
21
    
 
22
    ~KMidButton()
 
23
    {
 
24
    };
 
25
    
 
26
    void setPixmaps(const QPixmap& p1, const QPixmap& p2)
 
27
    {
 
28
        pixmap1=p1;
 
29
        pixmap2=p2;
 
30
    };
 
31
    
 
32
};