2
* tool_button.h - declaration of class toolButton
4
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6
* This file is part of iTALC - http://italc.sourceforge.net
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public
19
* License along with this program (see COPYING); if not, write to the
20
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21
* Boston, MA 02111-1307, USA.
26
#ifndef _TOOL_BUTTON_H
27
#define _TOOL_BUTTON_H
29
#include <QtGui/QToolButton>
31
#include "fast_qimage.h"
37
class toolButton : public QToolButton
41
toolButton( const QPixmap & _pixmap, const QString & _label,
42
const QString & _alt_label,
43
const QString & _title,
44
const QString & _desc, QObject * _receiver,
45
const char * _slot, QWidget * _parent );
46
toolButton( QAction * _a, const QString & _label,
47
const QString & _alt_label,
48
const QString & _desc, QObject * _receiver,
49
const char * _slot, QWidget * _parent );
50
virtual ~toolButton();
53
static void setIconOnlyMode( bool _enabled );
55
static bool iconOnlyMode( void )
57
return( s_iconOnlyMode );
60
static void setToolTipsDisabled( bool _disabled )
62
s_toolTipsDisabled = _disabled;
65
static bool toolTipsDisabled( void )
67
return( s_toolTipsDisabled );
70
void addTo( QToolBar * );
74
virtual void enterEvent( QEvent * _e );
75
virtual void leaveEvent( QEvent * _e );
76
virtual void mousePressEvent( QMouseEvent * _me );
77
virtual void paintEvent( QPaintEvent * _pe );
81
void mouseLeftButton( void );
85
bool checkForLeaveEvent( void );
86
void updateColorLevel( void );
90
void updateSize( void );
93
static bool s_toolTipsDisabled;
94
static bool s_iconOnlyMode;
98
unsigned char m_colorizeLevel;
111
class toolButtonTip : public QWidget
115
toolButtonTip( const QPixmap & _pixmap, const QString & _title,
116
const QString & _description,
117
QWidget * _parent, QWidget * _tool_btn = 0 );
119
virtual QSize sizeHint( void ) const;
123
virtual void paintEvent( QPaintEvent * _pe );
124
virtual void resizeEvent( QResizeEvent * _re );
128
void updateMask( void );
134
QString m_description;
139
QWidget * m_toolButton;