Back to index

kdeartwork  4.3.2
Public Member Functions | Protected Member Functions | Private Attributes
CDE::CdeButton Class Reference

#include <cdeclient.h>

Collaboration diagram for CDE::CdeButton:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CdeButton (CdeClient *parent=0, const char *name=0, int btnType=0, const QString &tip=NULL, int realize_btns=Qt::LeftButton)
void reset ()
Qt::ButtonState lastButton ()

Protected Member Functions

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

Private Attributes

CdeClientm_parent
int m_btnType
int m_realize_buttons
ButtonState last_button

Detailed Description

Definition at line 48 of file cdeclient.h.


Constructor & Destructor Documentation

CDE::CdeButton::CdeButton ( CdeClient parent = 0,
const char *  name = 0,
int  btnType = 0,
const QString &  tip = NULL,
int  realize_btns = Qt::LeftButton 
)

Definition at line 784 of file cdeclient.cpp.

    : Q3Button(parent->widget(), name), m_btnType(btnType), last_button(Qt::NoButton)
{
    setBackgroundMode( QWidget::NoBackground );
    setFixedSize( s_buttonSize, s_buttonSize );
    resize( s_buttonSize, s_buttonSize );
    m_parent = parent;

    setCursor(ArrowCursor);
    this->setToolTip( tip);

    m_realize_buttons = realize_btns;
}

Member Function Documentation

void CDE::CdeButton::drawButton ( QPainter *  p) [protected, virtual]

Definition at line 804 of file cdeclient.cpp.

{
    p->setBrush( options()->color( KDecoration::ColorTitleBar, m_parent->isActive() ) );
    p->drawRect( 0, 0, s_buttonSize, s_buttonSize );

    QColorGroup colorGroup =
      options()->colorGroup( KDecoration::ColorTitleBar, m_parent->isActive() );

    fixColorGroup(colorGroup);

    qDrawShadePanel( p, 0, 0, s_buttonSize, s_buttonSize,
                  colorGroup, isDown() );

    switch ( m_btnType )
    {
        case (BtnMenu):
            qDrawShadePanel( p, s_o1, s_o2, s_w1, s_w2, colorGroup );
       break;
       case (BtnHelp):
           p->setPen( colorGroup.light() );
           p->drawLineSegments( Q3PointArray(16, helpLLines) );
           p->setPen( colorGroup.dark() );
           p->drawLineSegments( Q3PointArray(14, helpDLines) );
       break;
       case (BtnIconify):
           qDrawShadePanel( p, s_o2, s_o2, s_w2, s_w2, colorGroup );
       break;
       case (BtnMax):
           qDrawShadePanel( p, s_o1, s_o1, s_w1, s_w1, colorGroup,
                  m_parent->maximizeMode() == KDecoration::MaximizeFull );
       break;
       case (BtnClose):
           p->setPen( colorGroup.dark() );
           p->drawLineSegments( Q3PointArray(18, closeDLines) );
           p->setPen( colorGroup.light() );
           p->drawLineSegments( Q3PointArray(15, closeLLines) );
       break;
    }
}

Here is the call graph for this function:

Qt::ButtonState CDE::CdeButton::lastButton ( ) [inline]

Definition at line 54 of file cdeclient.h.

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

Definition at line 844 of file cdeclient.cpp.

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

Definition at line 852 of file cdeclient.cpp.

{
    last_button = e->button();
    QMouseEvent me(e->type(), e->pos(),
           e->globalPos(), (e->button()&m_realize_buttons)?Qt::LeftButton:Qt::NoButton, e->state());
    Q3Button::mouseReleaseEvent(&me);
}

Definition at line 799 of file cdeclient.cpp.

{
    repaint( false );
}

Here is the caller graph for this function:


Member Data Documentation

ButtonState CDE::CdeButton::last_button [private]

Definition at line 65 of file cdeclient.h.

Definition at line 63 of file cdeclient.h.

Definition at line 62 of file cdeclient.h.

Definition at line 64 of file cdeclient.h.


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