LMMS
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:
60 MultiChoicePropertyComponent (const Value& valueToControl,
61 const String& propertyName,
62 const StringArray& choices,
63 const Array<var>& correspondingValues,
64 int maxChoices = -1);
65
79 const String& propertyName,
80 const StringArray& choices,
81 const Array<var>& correspondingValues,
82 int maxChoices = -1);
83
84 //==============================================================================
86 bool isExpanded() const noexcept { return expanded; }
87
90
99 void setExpanded (bool expanded) noexcept;
100
106 std::function<void()> onHeightChange;
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
136
137 //==============================================================================
139};
140
141} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Array.h:56
Definition juce_GraphicsContext.h:45
Definition juce_MultiChoicePropertyComponent.h:42
static constexpr int buttonHeight
Definition juce_MultiChoicePropertyComponent.h:127
int numHidden
Definition juce_MultiChoicePropertyComponent.h:130
void resized() override
Definition juce_MultiChoicePropertyComponent.cpp:296
void refresh() override
Definition juce_MultiChoicePropertyComponent.h:114
int maxHeight
Definition juce_MultiChoicePropertyComponent.h:130
bool expanded
Definition juce_MultiChoicePropertyComponent.h:131
bool expandable
Definition juce_MultiChoicePropertyComponent.h:131
void paint(Graphics &g) override
Definition juce_MultiChoicePropertyComponent.cpp:280
ValueTreePropertyWithDefault value
Definition juce_MultiChoicePropertyComponent.h:133
ShapeButton expandButton
Definition juce_MultiChoicePropertyComponent.h:135
bool isExpandable() const noexcept
Definition juce_MultiChoicePropertyComponent.h:89
static constexpr int expandAreaHeight
Definition juce_MultiChoicePropertyComponent.h:128
bool isExpanded() const noexcept
Definition juce_MultiChoicePropertyComponent.h:86
MultiChoicePropertyComponent(const String &, const StringArray &, const Array< var > &)
Definition juce_MultiChoicePropertyComponent.cpp:210
OwnedArray< ToggleButton > choiceButtons
Definition juce_MultiChoicePropertyComponent.h:134
std::function< void()> onHeightChange
Definition juce_MultiChoicePropertyComponent.h:106
static constexpr int collapsedHeight
Definition juce_MultiChoicePropertyComponent.h:126
Definition juce_OwnedArray.h:51
PropertyComponent(const String &propertyName, int preferredHeight=25)
Definition juce_PropertyComponent.cpp:29
Definition juce_ShapeButton.h:38
Definition juce_StringArray.h:35
Definition juce_String.h:53
Definition juce_Value.h:51
Definition juce_ValueTreePropertyWithDefault.h:39
int g
Definition inflate.c:1573
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
const Colour transparentBlack
Definition juce_Colours.h:40
Definition carla_juce.cpp:31
#define void
Definition unzip.h:396
#define const
Definition zconf.h:137