LMMS
Loading...
Searching...
No Matches
include
NStateButton.h
Go to the documentation of this file.
1
/*
2
* NStateButton.h - declaration of class nStateButton
3
*
4
* Copyright (c) 2005 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_NSTATE_BUTTON_H
26
#define LMMS_GUI_NSTATE_BUTTON_H
27
28
#include <QPixmap>
29
#include <QVector>
30
#include <QPair>
31
32
#include "
ToolButton.h
"
33
34
namespace
lmms::gui
35
{
36
37
38
class
NStateButton
:
public
ToolButton
39
{
40
Q_OBJECT
41
public
:
42
NStateButton
( QWidget * _parent );
43
~NStateButton
()
override
;
44
void
addState
(
const
QPixmap & _pixmap,
const
QString & _tooltip =
""
);
45
46
inline
void
setGeneralToolTip
(
const
QString & _tooltip )
47
{
48
m_generalToolTip
= _tooltip;
49
}
50
51
inline
int
state
()
const
52
{
53
return
(
m_curState
);
54
}
55
56
57
public
slots:
58
void
changeState
(
int
state
);
59
60
signals:
61
void
changedState
(
int
state
);
62
63
protected
:
64
void
mousePressEvent
(QMouseEvent* me)
override
;
65
66
private
:
67
QVector<QPair<QPixmap, QString>>
m_states
;
68
QString
m_generalToolTip
;
69
70
int
m_curState
;
71
};
72
73
}
// namespace lmms::gui
74
75
#endif
// LMMS_GUI_NSTATE_BUTTON_H
ToolButton.h
lmms::gui::NStateButton::changeState
void changeState(int state)
Definition
NStateButton.cpp:70
lmms::gui::NStateButton::m_states
QVector< QPair< QPixmap, QString > > m_states
Definition
NStateButton.h:67
lmms::gui::NStateButton::NStateButton
NStateButton(QWidget *_parent)
Definition
NStateButton.cpp:35
lmms::gui::NStateButton::changedState
void changedState(int state)
lmms::gui::NStateButton::addState
void addState(const QPixmap &_pixmap, const QString &_tooltip="")
Definition
NStateButton.cpp:56
lmms::gui::NStateButton::m_curState
int m_curState
Definition
NStateButton.h:70
lmms::gui::NStateButton::state
int state() const
Definition
NStateButton.h:51
lmms::gui::NStateButton::setGeneralToolTip
void setGeneralToolTip(const QString &_tooltip)
Definition
NStateButton.h:46
lmms::gui::NStateButton::~NStateButton
~NStateButton() override
Definition
NStateButton.cpp:45
lmms::gui::NStateButton::mousePressEvent
void mousePressEvent(QMouseEvent *me) override
Definition
NStateButton.cpp:84
lmms::gui::NStateButton::m_generalToolTip
QString m_generalToolTip
Definition
NStateButton.h:68
lmms::gui::ToolButton::ToolButton
ToolButton(const QPixmap &_pixmap, const QString &_tooltip, QObject *_receiver=nullptr, const char *_slot=nullptr, QWidget *_parent=nullptr)
Definition
ToolButton.cpp:32
lmms::gui
Definition
AudioPortAudio.cpp:223
Generated on
for LMMS by
1.16.1