lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
LedCheckBox.h
Go to the documentation of this file.
1
/*
2
* LedCheckBox.h - class LedCheckBox, an improved QCheckBox
3
*
4
* Copyright (c) 2005-2008 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_LED_CHECKBOX_H
26
#define LMMS_GUI_LED_CHECKBOX_H
27
28
#include "
AutomatableButton.h
"
29
30
31
32
33
namespace
lmms::gui
34
{
35
36
class
LMMS_EXPORT
LedCheckBox
:
public
AutomatableButton
37
{
38
Q_OBJECT
39
public
:
40
enum class
LedColor
41
{
42
Yellow,
43
Green,
44
Red
45
} ;
46
47
LedCheckBox
(
const
QString & _txt, QWidget * _parent,
48
const
QString & _name = QString(),
49
LedColor _color = LedColor::Yellow,
50
bool
legacyMode =
true
);
51
LedCheckBox
( QWidget * _parent,
52
const
QString & _name = QString(),
53
LedColor _color = LedColor::Yellow,
54
bool
legacyMode =
true
);
55
56
inline
const
QString &
text
()
57
{
58
return
(
m_text
);
59
}
60
61
void
setText(
const
QString& s );
62
void
setLedColor(LedColor color);
63
64
Q_PROPERTY( QString
text
READ
text
WRITE
setText
)
65
66
protected
:
67
void
paintEvent
( QPaintEvent * _pe )
override
;
68
69
70
private
:
71
QPixmap
m_ledOnPixmap
;
72
QPixmap
m_ledOffPixmap
;
73
74
QString
m_text
;
75
76
bool
m_legacyMode
;
77
78
79
void
onTextUpdated
();
80
void
paintLegacy
(QPaintEvent * p);
81
void
paintNonLegacy
(QPaintEvent * p);
82
83
} ;
84
85
86
}
// namespace lmms::gui
87
88
#endif
// LMMS_GUI_LED_CHECKBOX_H
AutomatableButton.h
lmms::gui::AutomatableButton::AutomatableButton
AutomatableButton(QWidget *_parent, const QString &_name=QString())
Definition
AutomatableButton.cpp:38
lmms::gui::LedCheckBox
Definition
LedCheckBox.h:37
lmms::gui::LedCheckBox::paintEvent
void paintEvent(QPaintEvent *_pe) override
Definition
LedCheckBox.cpp:74
lmms::gui::LedCheckBox::LedCheckBox
LedCheckBox(const QString &_txt, QWidget *_parent, const QString &_name=QString(), LedColor _color=LedColor::Yellow, bool legacyMode=true)
Definition
LedCheckBox.cpp:47
lmms::gui::LedCheckBox::m_ledOffPixmap
QPixmap m_ledOffPixmap
Definition
LedCheckBox.h:72
lmms::gui::LedCheckBox::LedColor
LedColor
Definition
LedCheckBox.h:41
lmms::gui::LedCheckBox::paintNonLegacy
void paintNonLegacy(QPaintEvent *p)
Definition
LedCheckBox.cpp:127
lmms::gui::LedCheckBox::text
QString text
Definition
LedCheckBox.h:64
lmms::gui::LedCheckBox::m_text
QString m_text
Definition
LedCheckBox.h:74
lmms::gui::LedCheckBox::onTextUpdated
void onTextUpdated()
to be called when you updated m_text
Definition
LedCheckBox.cpp:104
lmms::gui::LedCheckBox::setText
void setText(const QString &s)
Definition
LedCheckBox.cpp:65
lmms::gui::LedCheckBox::paintLegacy
void paintLegacy(QPaintEvent *p)
Definition
LedCheckBox.cpp:114
lmms::gui::LedCheckBox::m_legacyMode
bool m_legacyMode
Definition
LedCheckBox.h:76
lmms::gui::LedCheckBox::text
const QString & text()
Definition
LedCheckBox.h:56
lmms::gui::LedCheckBox::m_ledOnPixmap
QPixmap m_ledOnPixmap
Definition
LedCheckBox.h:71
lmms::gui
Definition
AudioPortAudio.cpp:209
Generated on
for lmms by
1.18.0