LMMS
Loading...
Searching...
No Matches
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
34namespace lmms::gui
35{
36
37
39{
40 Q_OBJECT
41public:
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
57public slots:
58 void changeState(int state);
59
60signals:
62
63protected:
64 void mousePressEvent(QMouseEvent* me) override;
65
66private:
67 QVector<QPair<QPixmap, QString>> m_states;
69
71};
72
73} // namespace lmms::gui
74
75#endif // LMMS_GUI_NSTATE_BUTTON_H
void changeState(int state)
Definition NStateButton.cpp:70
QVector< QPair< QPixmap, QString > > m_states
Definition NStateButton.h:67
NStateButton(QWidget *_parent)
Definition NStateButton.cpp:35
void changedState(int state)
void addState(const QPixmap &_pixmap, const QString &_tooltip="")
Definition NStateButton.cpp:56
int m_curState
Definition NStateButton.h:70
int state() const
Definition NStateButton.h:51
void setGeneralToolTip(const QString &_tooltip)
Definition NStateButton.h:46
~NStateButton() override
Definition NStateButton.cpp:45
void mousePressEvent(QMouseEvent *me) override
Definition NStateButton.cpp:84
QString m_generalToolTip
Definition NStateButton.h:68
ToolButton(const QPixmap &_pixmap, const QString &_tooltip, QObject *_receiver=nullptr, const char *_slot=nullptr, QWidget *_parent=nullptr)
Definition ToolButton.cpp:32
Definition AudioPortAudio.cpp:223