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_FlexItem.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
36class JUCE_API FlexItem final
37{
38public:
39 //==============================================================================
41 FlexItem() noexcept;
42
44 FlexItem (float width, float height) noexcept;
45
47 FlexItem (float width, float height, Component& targetComponent) noexcept;
48
50 FlexItem (float width, float height, FlexBox& flexBoxToControl) noexcept;
51
53 FlexItem (Component& componentToControl) noexcept;
54
58 FlexItem (FlexBox& flexBoxToControl) noexcept;
59
60 //==============================================================================
63
65 Component* associatedComponent = nullptr;
66
68 FlexBox* associatedFlexBox = nullptr;
69
74 int order = 0;
75
79 float flexGrow = 0.0f;
80
85 float flexShrink = 1.0f;
86
91 float flexBasis = 0.0f;
92
94 enum class AlignSelf
95 {
96 autoAlign,
97 flexStart,
98 flexEnd,
99 center,
100 stretch
101 };
102
107 AlignSelf alignSelf = AlignSelf::autoAlign;
108
109 //==============================================================================
111 static const int autoValue = -2;
113 static const int notAssigned = -1;
114
115 float width = (float) notAssigned;
116 float minWidth = 0.0f;
117 float maxWidth = (float) notAssigned;
119 float height = (float) notAssigned;
120 float minHeight = 0.0f;
121 float maxHeight = (float) notAssigned;
124 struct Margin final
125 {
126 Margin() noexcept;
127 Margin (float size) noexcept;
128 Margin (float top, float right, float bottom, float left) noexcept;
130 float left;
131 float right;
132 float top;
133 float bottom;
134 };
135
138
139 //==============================================================================
141 FlexItem withFlex (float newFlexGrow) const noexcept;
142
144 FlexItem withFlex (float newFlexGrow, float newFlexShrink) const noexcept;
145
147 FlexItem withFlex (float newFlexGrow, float newFlexShrink, float newFlexBasis) const noexcept;
148
150 FlexItem withWidth (float newWidth) const noexcept;
151
153 FlexItem withMinWidth (float newMinWidth) const noexcept;
154
156 FlexItem withMaxWidth (float newMaxWidth) const noexcept;
157
159 FlexItem withHeight (float newHeight) const noexcept;
160
162 FlexItem withMinHeight (float newMinHeight) const noexcept;
163
165 FlexItem withMaxHeight (float newMaxHeight) const noexcept;
166
168 FlexItem withMargin (Margin) const noexcept;
169
171 FlexItem withOrder (int newOrder) const noexcept;
172
174 FlexItem withAlignSelf (AlignSelf newAlignSelf) const noexcept;
175};
176
177} // namespace juce
The base class for all JUCE user-interface objects.
Represents a FlexBox container, which contains and manages the layout of a set of FlexItem objects.
Describes the properties of an item inside a FlexBox container.
AlignSelf
Possible value for the alignSelf property.
Rectangle< float > currentBounds
The item's current bounds.
Margin margin
The margin to leave around this item.
Manages a rectangle and allows geometric operations to be performed on it.
typedef float
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
Represents a margin.
float right
Right margin size.
float left
Left margin size.
float bottom
Bottom margin size.
float top
Top margin size.