1999-08-19 23:26:42 +00:00
|
|
|
#ifndef STDCLIENT_H
|
|
|
|
#define STDCLIENT_H
|
|
|
|
#include "client.h"
|
1999-11-22 01:57:51 +00:00
|
|
|
#include <qtoolbutton.h>
|
1999-08-19 23:26:42 +00:00
|
|
|
class QLabel;
|
|
|
|
class QSpacerItem;
|
|
|
|
|
|
|
|
class StdClient : public Client
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
StdClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
|
|
|
|
~StdClient();
|
|
|
|
protected:
|
|
|
|
void resizeEvent( QResizeEvent* );
|
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
|
|
|
|
void mouseDoubleClickEvent( QMouseEvent * );
|
|
|
|
void init();
|
|
|
|
void captionChange( const QString& name );
|
|
|
|
void iconChange();
|
|
|
|
void maximizeChange( bool );
|
|
|
|
void stickyChange( bool );
|
1999-11-10 16:07:19 +00:00
|
|
|
void activeChange( bool );
|
1999-08-19 23:26:42 +00:00
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
private slots:
|
|
|
|
void menuButtonPressed();
|
|
|
|
void maxButtonClicked( int );
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
private:
|
1999-12-01 22:09:32 +00:00
|
|
|
QToolButton* button[7];
|
1999-08-19 23:26:42 +00:00
|
|
|
QSpacerItem* titlebar;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
|
|
|
|
/*
|
1999-12-01 22:09:32 +00:00
|
|
|
Like QToolButton, but provides a clicked(int) signals that
|
1999-11-22 01:57:51 +00:00
|
|
|
has the last pressed mouse button as argument
|
|
|
|
*/
|
|
|
|
class ThreeButtonButton: public QToolButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
ThreeButtonButton ( QWidget *parent = 0, const char* name = 0)
|
|
|
|
: QToolButton( parent, name )
|
|
|
|
{
|
|
|
|
connect( this, SIGNAL( clicked() ), this, SLOT( handleClicked() ) );
|
|
|
|
}
|
1999-12-01 22:09:32 +00:00
|
|
|
~ThreeButtonButton ()
|
1999-11-22 01:57:51 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void clicked( int );
|
1999-12-01 22:09:32 +00:00
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
protected:
|
|
|
|
void mousePressEvent( QMouseEvent* e )
|
|
|
|
{
|
|
|
|
last_button = e->button();
|
|
|
|
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
|
|
|
|
QToolButton::mousePressEvent( &me );
|
|
|
|
}
|
1999-12-01 22:09:32 +00:00
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
void mouseReleaseEvent( QMouseEvent* e )
|
|
|
|
{
|
|
|
|
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
|
|
|
|
QToolButton::mouseReleaseEvent( &me );
|
|
|
|
}
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void handleClicked()
|
|
|
|
{
|
|
|
|
emit clicked( last_button );
|
|
|
|
}
|
1999-12-01 22:09:32 +00:00
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
private:
|
|
|
|
int last_button;
|
1999-12-01 22:09:32 +00:00
|
|
|
|
1999-11-22 01:57:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1999-08-19 23:26:42 +00:00
|
|
|
#endif
|