LMMS
Loading...
Searching...
No Matches
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
33namespace lmms::gui
34{
35
36class LMMS_EXPORT LedCheckBox : public AutomatableButton
37{
38 Q_OBJECT
39public:
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
63 Q_PROPERTY( QString text READ text WRITE setText )
64
65protected:
66 void paintEvent( QPaintEvent * _pe ) override;
67
68
69private:
72
73 QString m_text;
74
76
77 void initUi( LedColor _color );
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
#define READ(addr)
Definition Ay_Cpu.cpp:92
#define WRITE(addr, data)
Definition Ay_Cpu.cpp:93
AutomatableButton(QWidget *_parent, const QString &_name=QString())
Definition AutomatableButton.cpp:38
Definition LedCheckBox.h:37
void paintEvent(QPaintEvent *_pe) override
Definition LedCheckBox.cpp:74
LedCheckBox(const QString &_txt, QWidget *_parent, const QString &_name=QString(), LedColor _color=LedColor::Yellow, bool legacyMode=true)
Definition LedCheckBox.cpp:47
QPixmap m_ledOffPixmap
Definition LedCheckBox.h:71
void initUi(LedColor _color)
to be called by ctors
Definition LedCheckBox.cpp:89
LedColor
Definition LedCheckBox.h:41
void paintNonLegacy(QPaintEvent *p)
Definition LedCheckBox.cpp:127
QString text
Definition LedCheckBox.h:63
QString m_text
Definition LedCheckBox.h:73
void onTextUpdated()
to be called when you updated m_text
Definition LedCheckBox.cpp:104
void setText(const QString &s)
Definition LedCheckBox.cpp:65
void paintLegacy(QPaintEvent *p)
Definition LedCheckBox.cpp:114
bool m_legacyMode
Definition LedCheckBox.h:75
const QString & text()
Definition LedCheckBox.h:56
QPixmap m_ledOnPixmap
Definition LedCheckBox.h:70
unsigned s
Definition inflate.c:1555
Definition AudioPortAudio.cpp:223
uch * p
Definition crypt.c:594