1
/***************************************************************************
2
* Copyright (C) 2004 by Alexander Dymo *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU Library General Public License as *
7
* published by the Free Software Foundation; either version 2 of the *
8
* License, or (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU Library General Public *
16
* License along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
***************************************************************************/
23
#include <qpushbutton.h>
35
@short A button to place onto the ButtonBar
37
A QPushButton derivative with a size of a QToolBar. Button can be rotated
38
(placed onto different places in ideal mode).
40
class Button : public QPushButton {
43
Button(ButtonBar *parent, const QString text, const QIconSet &icon = QIconSet(),
44
const QString &description = QString::null);
46
/**Sets the description used as a tooltip.*/
47
void setDescription(const QString &description);
48
/**Returns the description.*/
49
QString description() const;
51
/**Sets the place of a button.*/
52
void setPlace(Ideal::Place place);
53
/**Sets the mode of a button.*/
54
void setMode(Ideal::ButtonMode mode);
56
QSize sizeHint() const;
57
QSize sizeHint(const QString &text) const;
59
/**Updates size of a widget. Used after squeezing button's text.*/
62
/**Returns the real (i.e. not squeezed) text of a button.*/
63
QString realText() const;
64
QString realTextWithoutAccel() const;
65
void setRealText(const QString &text);
70
virtual void drawButton(QPainter *p);
71
virtual void drawButtonLabel(QPainter *p);
73
virtual void contextMenuEvent(QContextMenuEvent *e);
80
void contextMenu(QPopupMenu*);
85
void fixDimensions(Place oldPlace);
88
void disableIconSet();
92
ButtonBar *m_buttonBar;
94
QString m_description;
98
QIconSet m_realIconSet;
100
KAction *m_assignAccelAction;
101
KAction *m_clearAccelAction;
103
friend class ButtonBar;