JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_MultiChoicePropertyComponent.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
26
27namespace juce
28{
29
30//==============================================================================
42{
43private:
46
47public:
61 const String& propertyName,
62 const StringArray& choices,
64 int maxChoices = -1);
65
79 const String& propertyName,
80 const StringArray& choices,
82 int maxChoices = -1);
83
84 //==============================================================================
86 bool isExpanded() const noexcept { return expanded; }
87
89 bool isExpandable() const noexcept { return expandable; }
90
99 void setExpanded (bool expanded) noexcept;
100
107
108 //==============================================================================
110 void paint (Graphics& g) override;
112 void resized() override;
114 void refresh() override {}
115
116private:
117 //==============================================================================
118 class MultiChoiceRemapperSource;
119 class MultiChoiceRemapperSourceWithDefault;
120
121 //==============================================================================
122 static int getTotalButtonsHeight (int);
123 void lookAndFeelChanged() override;
124
125 //==============================================================================
126 static constexpr int collapsedHeight = 125;
127 static constexpr int buttonHeight = 25;
128 static constexpr int expandAreaHeight = 20;
129
130 int maxHeight = 0, numHidden = 0;
131 bool expandable = false, expanded = false;
132
134 OwnedArray<ToggleButton> choiceButtons;
135 ShapeButton expandButton { "Expand", Colours::transparentBlack, Colours::transparentBlack, Colours::transparentBlack };
136
137 //==============================================================================
138 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MultiChoicePropertyComponent)
139};
140
141} // namespace juce
Holds a resizable array of primitive or copy-by-value objects.
Definition juce_Array.h:56
A graphics context, used for drawing a component or image.
A PropertyComponent that shows its value as an expandable list of ToggleButtons.
void resized() override
Called when this component's size has been changed.
void refresh() override
Updates the property component if the item it refers to has changed.
void paint(Graphics &g) override
Components can override this method to draw their content.
bool isExpandable() const noexcept
Returns true if the list of options has been truncated and can be expanded.
bool isExpanded() const noexcept
Returns true if the list of options is expanded.
void setExpanded(bool expanded) noexcept
Expands or shrinks the list of options if they are not all visible.
std::function< void()> onHeightChange
You can assign a lambda to this callback object to have it called when the height of this component c...
An array designed for holding objects.
A base class for a component that goes in a PropertyPanel and displays one of an item's properties.
A button that contains a filled shape.
A special array for holding a list of strings.
The JUCE String class!
Definition juce_String.h:53
This class acts as a wrapper around a property inside a ValueTree.
Represents a shared variant value.
Definition juce_Value.h:51
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
JUCE Namespace.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88