LMMS
Loading...
Searching...
No Matches
juce_TabbedComponent.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
42{
43public:
44 //==============================================================================
48 explicit TabbedComponent (TabbedButtonBar::Orientation orientation);
49
51 ~TabbedComponent() override;
52
53 //==============================================================================
62
67
74 void setTabBarDepth (int newDepth);
75
80
88 void setOutline (int newThickness);
89
93 void setIndent (int indentThickness);
94
95 //==============================================================================
99 void clearTabs();
100
109 void addTab (const String& tabName,
110 Colour tabBackgroundColour,
111 Component* contentComponent,
112 bool deleteComponentWhenNotNeeded,
113 int insertIndex = -1);
114
116 void setTabName (int tabIndex, const String& newName);
117
119 void removeTab (int tabIndex);
120
124 void moveTab (int currentIndex, int newIndex, bool animate = false);
125
127 int getNumTabs() const;
128
130 StringArray getTabNames() const;
131
136 Component* getTabContentComponent (int tabIndex) const noexcept;
137
139 Colour getTabBackgroundColour (int tabIndex) const noexcept;
140
142 void setTabBackgroundColour (int tabIndex, Colour newColour);
143
144 //==============================================================================
149 void setCurrentTabIndex (int newTabIndex, bool sendChangeMessage = true);
150
154 int getCurrentTabIndex() const;
155
159 String getCurrentTabName() const;
160
165
166 //==============================================================================
170 virtual void currentTabChanged (int newCurrentTabIndex, const String& newCurrentTabName);
171
173 virtual void popupMenuClickOnTab (int tabIndex, const String& tabName);
174
177
178 //==============================================================================
187 {
188 backgroundColourId = 0x1005800,
189 outlineColourId = 0x1005801,
191 };
192
193 //==============================================================================
195 void paint (Graphics&) override;
197 void resized() override;
199 void lookAndFeelChanged() override;
200
201protected:
202 //==============================================================================
208 virtual TabBarButton* createTabButton (const String& tabName, int tabIndex);
209
211 std::unique_ptr<TabbedButtonBar> tabs;
212
213private:
214 //==============================================================================
218
219 struct ButtonBar;
220 std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override;
221 void changeCallback (int newCurrentTabIndex, const String& newTabName);
222
224};
225
226} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Array.h:56
Definition juce_Colour.h:38
Definition juce_Component.h:36
Component() noexcept
Definition juce_Component.cpp:517
Definition juce_GraphicsContext.h:45
Definition juce_StringArray.h:35
Definition juce_String.h:53
Definition juce_TabbedButtonBar.h:44
Definition juce_TabbedButtonBar.h:155
Orientation
Definition juce_TabbedButtonBar.h:162
Array< WeakReference< Component > > contentComponents
Definition juce_TabbedComponent.h:215
int getTabBarDepth() const noexcept
Definition juce_TabbedComponent.h:79
int outlineThickness
Definition juce_TabbedComponent.h:217
Component * getCurrentContentComponent() const noexcept
Definition juce_TabbedComponent.h:164
int tabDepth
Definition juce_TabbedComponent.h:217
void setTabBarDepth(int newDepth)
Definition juce_TabbedComponent.cpp:113
ColourIds
Definition juce_TabbedComponent.h:187
@ outlineColourId
Definition juce_TabbedComponent.h:189
@ backgroundColourId
Definition juce_TabbedComponent.h:188
std::unique_ptr< TabbedButtonBar > tabs
Definition juce_TabbedComponent.h:211
WeakReference< Component > panelComponent
Definition juce_TabbedComponent.h:216
void changeCallback(int newCurrentTabIndex, const String &newTabName)
Definition juce_TabbedComponent.cpp:279
TabbedComponent(TabbedButtonBar::Orientation orientation)
Definition juce_TabbedComponent.cpp:89
TabbedButtonBar & getTabbedButtonBar() const noexcept
Definition juce_TabbedComponent.h:176
int edgeIndent
Definition juce_TabbedComponent.h:217
void setOrientation(TabbedButtonBar::Orientation orientation)
Definition juce_TabbedComponent.cpp:102
TabbedButtonBar::Orientation getOrientation() const noexcept
Definition juce_TabbedComponent.cpp:108
std::unique_ptr< AccessibilityHandler > createAccessibilityHandler() override
Definition juce_TabbedComponent.cpp:314
Definition juce_WeakReference.h:78
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
Definition juce_TabbedComponent.cpp:57
#define const
Definition zconf.h:137