Back to index

kdeartwork  4.3.2
Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes
IceWM::IceWMButton Class Reference

#include <icewm.h>

Collaboration diagram for IceWM::IceWMButton:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IceWMButton (IceWMClient *parent=0, const char *name=0, QPixmap *(*p)[2]=0L, bool isToggle=false, const QString &tip=NULL, const int realizeBtns=Qt::LeftButton)
void setTipText (const QString &tip)
void usePixmap (QPixmap *(*p)[2])
QSize sizeHint () const
void turnOn (bool isOn)

Public Attributes

ButtonState last_button

Protected Member Functions

void mousePressEvent (QMouseEvent *e)
void mouseReleaseEvent (QMouseEvent *e)
void drawButton (QPainter *p)
void drawButtonLabel (QPainter *)

Private Attributes

int m_realizeButtons
IceWMClientclient
QPixmap *(* pix )[2]

Detailed Description

Definition at line 110 of file icewm.h.


Constructor & Destructor Documentation

IceWM::IceWMButton::IceWMButton ( IceWMClient parent = 0,
const char *  name = 0,
QPixmap *(*)  p[2] = 0L,
bool  isToggle = false,
const QString &  tip = NULL,
const int  realizeBtns = Qt::LeftButton 
)

Definition at line 773 of file icewm.cpp.

    : Q3Button(parent->widget(), name)
{
       m_realizeButtons = realizeBtns;
       setTipText(tip);
       setCursor(ArrowCursor);
       // Eliminate any possible background flicker
       setBackgroundMode( QWidget::NoBackground );
       client = parent;
       usePixmap( p );
       setFixedSize( sizeHint() );
       setToggleButton( isToggle );
}

Here is the call graph for this function:


Member Function Documentation

void IceWM::IceWMButton::drawButton ( QPainter *  p) [protected]

Definition at line 820 of file icewm.cpp.

{
       if ( pix && validPixmaps(*pix) )
       {
              QPixmap* p = (*pix)[ client->isActive() ? Active : InActive ];

              if( p && (!p->isNull()) )
              {
                     int width = p->width();

                     // Only draw the lower pixmap 1/2 for down, and upper 1/2 for up state
                     if( isDown() || isOn() )
                            pnt->drawPixmap(0, 0, *p, 0, titleBarHeight, width, titleBarHeight);
                     else
                            pnt->drawPixmap(0, 0, *p, 0, 0, width, titleBarHeight);
              }
       } else
              qWarning("kwin-icewm: Can't paint a null pixmap button");
}

Here is the call graph for this function:

void IceWM::IceWMButton::drawButtonLabel ( QPainter *  ) [inline, protected]

Definition at line 127 of file icewm.h.

{;}
void IceWM::IceWMButton::mousePressEvent ( QMouseEvent *  e) [protected]

Definition at line 848 of file icewm.cpp.

{
       last_button = e->button();
       QMouseEvent me ( e->type(), e->pos(), e->globalPos(),
                                    (e->button()&m_realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state() );
       Q3Button::mousePressEvent( &me );
}
void IceWM::IceWMButton::mouseReleaseEvent ( QMouseEvent *  e) [protected]

Definition at line 857 of file icewm.cpp.

{
       last_button = e->button();
       QMouseEvent me ( e->type(), e->pos(), e->globalPos(),
                                    (e->button()&m_realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state() );
       Q3Button::mouseReleaseEvent( &me );
}
void IceWM::IceWMButton::setTipText ( const QString &  tip)

Definition at line 789 of file icewm.cpp.

                                               {
       if(KDecoration::options()->showTooltips()) {
              QToolTip::remove(this );
              this->setToolTip( tip );
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 797 of file icewm.cpp.

{
       // Check for invalid data
       if ( validPixmaps( (QPixmap**) (*pix) ) )  // Cast to avoid dumb warning
       {
              QPixmap* p = (*pix)[ client->isActive() ? Active : InActive ];
              return( QSize(p->width(), titleBarHeight) );
       } else
              return( QSize(0, 0) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void IceWM::IceWMButton::turnOn ( bool  isOn)

Definition at line 841 of file icewm.cpp.

{
       if ( isToggleButton() )
              setOn( isOn );
}

Here is the caller graph for this function:

void IceWM::IceWMButton::usePixmap ( QPixmap *(*)  p[2])

Definition at line 809 of file icewm.cpp.

{
       if (validPixmaps( *p )) {
              pix = p;
              setFixedSize( (*pix)[Active]->width(), titleBarHeight );
              repaint( false );
       } else
              pix = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 131 of file icewm.h.

Definition at line 120 of file icewm.h.

Definition at line 130 of file icewm.h.

QPixmap*(* IceWM::IceWMButton::pix)[2] [private]

Definition at line 132 of file icewm.h.


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