Back to index

kdeartwork  4.3.2
Public Member Functions | Protected Member Functions | Protected Attributes
KStep::NextButton Class Reference

#include <nextclient.h>

Collaboration diagram for KStep::NextButton:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NextButton (NextClient *parent=0, const unsigned char *bitmap=NULL, int bw=0, int bh=0, const QString &tip=NULL, const int realizeBtns=Qt::LeftButton)
void setBitmap (const unsigned char *bitmap, int bw, int bh)
void reset ()
Qt::MouseButton lastButton ()

Protected Member Functions

void mousePressEvent (QMouseEvent *e)
void mouseReleaseEvent (QMouseEvent *e)
virtual void paintEvent (QPaintEvent *e)

Protected Attributes

QPixmap aBackground
QPixmap iBackground
QBitmap deco
NextClientclient
Qt::MouseButton last_button
int realizeButtons

Detailed Description

Definition at line 46 of file nextclient.h.


Constructor & Destructor Documentation

KStep::NextButton::NextButton ( NextClient parent = 0,
const unsigned char *  bitmap = NULL,
int  bw = 0,
int  bh = 0,
const QString &  tip = NULL,
const int  realizeBtns = Qt::LeftButton 
)

Definition at line 360 of file nextclient.cpp.

    : QAbstractButton(parent->widget()),
      client(parent), last_button(Qt::NoButton)
{
    realizeButtons = realizeBtns;

    setAttribute(Qt::WA_NoSystemBackground);
    resize(titleHeight, titleHeight);
    setFixedSize(titleHeight, titleHeight);

    if(bitmap)
        setBitmap(bitmap, bw, bh);

       this->setToolTip( tip);
}

Here is the call graph for this function:


Member Function Documentation

Qt::MouseButton KStep::NextButton::lastButton ( ) [inline]

Definition at line 54 of file nextclient.h.

{ return last_button; }
void KStep::NextButton::mousePressEvent ( QMouseEvent *  e) [protected]

Definition at line 415 of file nextclient.cpp.

{
    last_button = e->button();
    QMouseEvent me(e->type(), e->pos(), e->globalPos(),
           (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
           (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
           e->modifiers());
    QAbstractButton::mousePressEvent(&me);
}
void KStep::NextButton::mouseReleaseEvent ( QMouseEvent *  e) [protected]

Definition at line 425 of file nextclient.cpp.

{
    last_button = e->button();
    QMouseEvent me(e->type(), e->pos(), e->globalPos(),
           (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
           (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton,
           e->modifiers());
    QAbstractButton::mouseReleaseEvent(&me);
}
void KStep::NextButton::paintEvent ( QPaintEvent *  e) [protected, virtual]

Definition at line 391 of file nextclient.cpp.

{
    QPainter p(this);
    if (client->isActive())
        p.drawPixmap(0, 0, isDown() ? *aBtnDown : *aBtn);
    else
        p.drawPixmap(0, 0, isDown() ? *iBtnDown : *iBtn);

    // If we have a decoration, draw it; otherwise, we have the menu
    // button (remember, we set the bitmap to NULL).
    int offset;
    if (!deco.isNull()) {
        offset = (titleHeight - 10) / 2 + (isDown() ? 1 : 0);
        p.setPen(*btnForeground);
        p.drawPixmap(offset, offset, deco);
    } else {
        offset = (titleHeight - 16) / 2;
       QPixmap btnpix = client->icon().pixmap(
              style()->pixelMetric(QStyle::PM_SmallIconSize),
              client->isActive() ? QIcon::Normal : QIcon::Disabled);
        p.drawPixmap(offset, offset, btnpix);
    }
}

Definition at line 378 of file nextclient.cpp.

{
    repaint();
}

Here is the caller graph for this function:

void KStep::NextButton::setBitmap ( const unsigned char *  bitmap,
int  bw,
int  bh 
)

Definition at line 383 of file nextclient.cpp.

{
    QSize s(w, h);
    deco = QBitmap::fromData(s, bitmap, QImage::Format_MonoLSB);
    deco.setMask(deco);
    repaint();
}

Here is the caller graph for this function:


Member Data Documentation

QPixmap KStep::NextButton::aBackground [protected]

Definition at line 61 of file nextclient.h.

Definition at line 63 of file nextclient.h.

QBitmap KStep::NextButton::deco [protected]

Definition at line 62 of file nextclient.h.

QPixmap KStep::NextButton::iBackground [protected]

Definition at line 61 of file nextclient.h.

Qt::MouseButton KStep::NextButton::last_button [protected]

Definition at line 64 of file nextclient.h.

Definition at line 65 of file nextclient.h.


The documentation for this class was generated from the following files: