2 * lcd_spinbox.h - class lcdSpinBox, an improved QLCDNumber
4 * Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 * Copyright (c) 2008-2009 Paul Giblock <pgib/at/users.sourceforge.net>
7 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this program (see COPYING); if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA.
27 #ifndef _LCD_SPINBOX_H
28 #define _LCD_SPINBOX_H
30 #include <QtCore/QMap>
31 #include <QtGui/QWidget>
33 #include "AutomatableModelView.h"
36 class EXPORT lcdSpinBox
: public QWidget
, public IntModelView
40 lcdSpinBox( int _num_digits
, QWidget
* _parent
, const QString
& _name
=
43 lcdSpinBox( int _num_digits
, const QString
& _lcd_style
,
44 QWidget
* _parent
, const QString
& _name
= QString::null
);
46 virtual ~lcdSpinBox();
48 void setLabel( const QString
& _txt
);
50 inline void addTextForValue( int _val
, const QString
& _text
)
52 m_textForValue
[_val
] = _text
;
56 virtual void modelChanged()
58 ModelView::modelChanged();
64 virtual void setEnabled( bool _on
);
65 virtual void setMarginWidth( int _width
);
66 virtual void update();
70 virtual void contextMenuEvent( QContextMenuEvent
* _me
);
71 virtual void mousePressEvent( QMouseEvent
* _me
);
72 virtual void mouseMoveEvent( QMouseEvent
* _me
);
73 virtual void mouseReleaseEvent( QMouseEvent
* _me
);
74 virtual void wheelEvent( QWheelEvent
* _we
);
75 virtual void paintEvent( QPaintEvent
* _me
);
77 virtual void updateSize();
81 static const int charsPerPixmap
= 12;
83 QMap
<int, QString
> m_textForValue
;
88 QPixmap
* m_lcdPixmap
;
95 QPoint m_origMousePos
;
103 typedef IntModel lcdSpinBoxModel
;