lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
TabBar.h
Go to the documentation of this file.
1
/*
2
* TabBar.h - class tabBar
3
*
4
* Copyright (c) 2004-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_TAB_BAR_H
26
#define LMMS_GUI_TAB_BAR_H
27
28
#include <QBoxLayout>
29
#include <QMap>
30
#include <QWidget>
31
32
#include "lmms_export.h"
33
34
35
namespace
lmms::gui
36
{
37
38
39
class
TabButton
;
40
41
42
class
LMMS_EXPORT
TabBar
:
public
QWidget
43
{
44
Q_OBJECT
45
public
:
46
TabBar
( QWidget * _parent,
47
QBoxLayout::Direction _dir = QBoxLayout::LeftToRight );
48
~TabBar
()
override
=
default
;
49
50
TabButton
*
addTab
( QWidget * _w,
const
QString & _text,
51
int
_id,
bool
_add_stretch =
false
,
52
bool
_text_is_tooltip =
false
,
53
// TODO Remove fixWidgetToParentSize once it is used
54
// with false everywhere.
55
// At the time of writing it is only used in
56
// LadspaBrowser with default parameters.
57
bool
fixWidgetToParentSize =
true
);
58
void
removeTab
(
int
_id );
59
60
inline
void
setExclusive
(
bool
_on )
61
{
62
m_exclusive
= _on;
63
}
64
65
int
activeTab();
66
67
68
public
slots:
69
void
setActiveTab(
int
_id );
70
71
72
protected
:
73
bool
tabState(
int
_id );
74
void
setTabState(
int
_id,
bool
_checked );
75
bool
allHidden();
76
77
78
protected
slots:
79
void
hideAll(
int
_exception = -1 );
80
void
tabClicked(
int
_id );
81
82
83
private
:
84
QMap<int, QPair<TabButton *, QWidget *> >
m_tabs
;
85
QBoxLayout *
m_layout
;
86
bool
m_exclusive
;
87
88
89
signals:
90
void
allWidgetsHidden
();
91
void
widgetShown
();
92
93
} ;
94
95
96
}
// namespace lmms::gui
97
98
#endif
// LMMS_GUI_TAB_BAR_H
lmms::gui::TabBar::m_layout
QBoxLayout * m_layout
Definition
TabBar.h:85
lmms::gui::TabBar::allWidgetsHidden
void allWidgetsHidden()
lmms::gui::TabBar::m_tabs
QMap< int, QPair< TabButton *, QWidget * > > m_tabs
Definition
TabBar.h:84
lmms::gui::TabBar::setExclusive
void setExclusive(bool _on)
Definition
TabBar.h:60
lmms::gui::TabBar::addTab
TabButton * addTab(QWidget *_w, const QString &_text, int _id, bool _add_stretch=false, bool _text_is_tooltip=false, bool fixWidgetToParentSize=true)
Definition
TabBar.cpp:45
lmms::gui::TabBar::removeTab
void removeTab(int _id)
Definition
TabBar.cpp:98
lmms::gui::TabBar::m_exclusive
bool m_exclusive
Definition
TabBar.h:86
lmms::gui::TabBar::TabBar
TabBar(QWidget *_parent, QBoxLayout::Direction _dir=QBoxLayout::LeftToRight)
Definition
TabBar.cpp:34
lmms::gui::TabBar::~TabBar
~TabBar() override=default
lmms::gui::TabBar::widgetShown
void widgetShown()
lmms::gui::TabButton
Definition
TabButton.h:35
lmms::gui
Definition
AudioPortAudio.cpp:209
Generated on
for lmms by
1.18.0