lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
LcdSpinBox.h
Go to the documentation of this file.
1
/*
2
* LcdSpinBox.h - class LcdSpinBox, an improved QLCDNumber
3
*
4
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
*
6
* This file is part of LMMS - https://lmms.io
7
*
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.
12
*
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.
17
*
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., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301 USA.
22
*
23
*/
24
25
#ifndef LMMS_GUI_LCD_SPINBOX_H
26
#define LMMS_GUI_LCD_SPINBOX_H
27
28
#include "
LcdWidget.h
"
29
#include "
AutomatableModelView.h
"
30
31
namespace
lmms::gui
32
{
33
34
class
LMMS_EXPORT
LcdSpinBox
:
public
LcdWidget
,
public
IntModelView
35
{
36
Q_OBJECT
37
public
:
38
LcdSpinBox
(
int
numDigits
, QWidget* parent,
const
QString& name = QString() );
39
40
LcdSpinBox
(
int
numDigits
,
const
QString& style, QWidget* parent,
const
QString& name = QString() );
41
42
~LcdSpinBox
()
override
=
default
;
43
44
void
modelChanged
()
override
45
{
46
ModelView::modelChanged
();
47
update
();
48
}
49
52
void
setDisplayOffset
(
int
offset )
53
{
54
m_displayOffset
= offset;
55
}
56
58
int
displayOffset
()
const
59
{
60
return
m_displayOffset
;
61
}
62
63
64
public
slots:
65
virtual
void
update();
66
67
68
protected
:
69
void
contextMenuEvent( QContextMenuEvent * _me )
override
;
70
void
mousePressEvent( QMouseEvent * _me )
override
;
71
void
mouseMoveEvent( QMouseEvent * _me )
override
;
72
void
mouseReleaseEvent( QMouseEvent * _me )
override
;
73
void
wheelEvent( QWheelEvent * _we )
override
;
74
void
mouseDoubleClickEvent( QMouseEvent * _me )
override
;
75
76
private
:
77
float
m_remainder
;
78
bool
m_mouseMoving
;
79
QPoint
m_lastMousePos
;
80
int
m_displayOffset
;
81
void
enterValue
();
82
83
signals:
84
void
manualChange
();
85
86
} ;
87
88
using
LcdSpinBoxModel
=
IntModel
;
89
90
}
// namespace lmms::gui
91
92
#endif
// LMMS_GUI_LCD_SPINBOX_H
AutomatableModelView.h
LcdWidget.h
lmms::IntModel
Definition
AutomatableModel.h:486
lmms::gui::LcdSpinBox::m_displayOffset
int m_displayOffset
Definition
LcdSpinBox.h:80
lmms::gui::LcdSpinBox::displayOffset
int displayOffset() const
Returns internal offset for displaying values.
Definition
LcdSpinBox.h:58
lmms::gui::LcdSpinBox::update
virtual void update()
Definition
LcdSpinBox.cpp:62
lmms::gui::LcdSpinBox::manualChange
void manualChange()
lmms::gui::LcdSpinBox::enterValue
void enterValue()
Definition
LcdSpinBox.cpp:160
lmms::gui::LcdSpinBox::modelChanged
void modelChanged() override
Definition
LcdSpinBox.h:44
lmms::gui::LcdSpinBox::m_lastMousePos
QPoint m_lastMousePos
mouse position in last mouseMoveEvent
Definition
LcdSpinBox.h:79
lmms::gui::LcdSpinBox::LcdSpinBox
LcdSpinBox(int numDigits, QWidget *parent, const QString &name=QString())
Definition
LcdSpinBox.cpp:39
lmms::gui::LcdSpinBox::m_mouseMoving
bool m_mouseMoving
Definition
LcdSpinBox.h:78
lmms::gui::LcdSpinBox::setDisplayOffset
void setDisplayOffset(int offset)
Definition
LcdSpinBox.h:52
lmms::gui::LcdSpinBox::m_remainder
float m_remainder
floating offset of spinbox in [-0.5, 0.5]
Definition
LcdSpinBox.h:77
lmms::gui::LcdSpinBox::~LcdSpinBox
~LcdSpinBox() override=default
lmms::gui::LcdWidget::LcdWidget
LcdWidget(QWidget *parent, const QString &name=QString(), bool leadingZero=false)
Definition
LcdWidget.cpp:40
lmms::gui::LcdWidget::numDigits
int numDigits
Definition
LcdWidget.h:60
lmms::gui::ModelView::modelChanged
virtual void modelChanged()
Definition
ModelView.h:68
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms::gui::IntModelView
TypedModelView< IntModel > IntModelView
Definition
AutomatableModelView.h:132
lmms::gui::LcdSpinBoxModel
IntModel LcdSpinBoxModel
Definition
LcdSpinBox.h:88
Generated on
for lmms by
1.18.0