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_ComponentBoundsConstrainer.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//==============================================================================
44{
45public:
46 //==============================================================================
49
52
53 //==============================================================================
55 void setMinimumWidth (int minimumWidth) noexcept;
56
58 int getMinimumWidth() const noexcept { return minW; }
59
61 void setMaximumWidth (int maximumWidth) noexcept;
62
64 int getMaximumWidth() const noexcept { return maxW; }
65
67 void setMinimumHeight (int minimumHeight) noexcept;
68
70 int getMinimumHeight() const noexcept { return minH; }
71
73 void setMaximumHeight (int maximumHeight) noexcept;
74
76 int getMaximumHeight() const noexcept { return maxH; }
77
79 void setMinimumSize (int minimumWidth,
80 int minimumHeight) noexcept;
81
83 void setMaximumSize (int maximumWidth,
84 int maximumHeight) noexcept;
85
87 void setSizeLimits (int minimumWidth,
88 int minimumHeight,
89 int maximumWidth,
90 int maximumHeight) noexcept;
91
92 //==============================================================================
109 void setMinimumOnscreenAmounts (int minimumWhenOffTheTop,
110 int minimumWhenOffTheLeft,
111 int minimumWhenOffTheBottom,
112 int minimumWhenOffTheRight) noexcept;
113
114
116 int getMinimumWhenOffTheTop() const noexcept { return minOffTop; }
118 int getMinimumWhenOffTheLeft() const noexcept { return minOffLeft; }
120 int getMinimumWhenOffTheBottom() const noexcept { return minOffBottom; }
122 int getMinimumWhenOffTheRight() const noexcept { return minOffRight; }
123
124 //==============================================================================
132 void setFixedAspectRatio (double widthOverHeight) noexcept;
133
138 double getFixedAspectRatio() const noexcept;
139
140
141 //==============================================================================
153 virtual void checkBounds (Rectangle<int>& bounds,
154 const Rectangle<int>& previousBounds,
155 const Rectangle<int>& limits,
156 bool isStretchingTop,
157 bool isStretchingLeft,
158 bool isStretchingBottom,
159 bool isStretchingRight);
160
162 virtual void resizeStart();
163
165 virtual void resizeEnd();
166
168 void setBoundsForComponent (Component* component,
169 Rectangle<int> bounds,
170 bool isStretchingTop,
171 bool isStretchingLeft,
172 bool isStretchingBottom,
173 bool isStretchingRight);
174
178 void checkComponentBounds (Component* component);
179
186 virtual void applyBoundsToComponent (Component&, Rectangle<int> bounds);
187
188private:
189 //==============================================================================
190 int minW = 0, maxW = 0x3fffffff, minH = 0, maxH = 0x3fffffff;
191 int minOffTop = 0, minOffLeft = 0, minOffBottom = 0, minOffRight = 0;
192 double aspectRatio = 0;
193
195};
196
197} // namespace juce
A class that imposes restrictions on a Component's size or position.
int getMinimumWhenOffTheRight() const noexcept
Returns the minimum distance the bounds can be off-screen.
int getMaximumWidth() const noexcept
Returns the current maximum width.
int getMinimumWidth() const noexcept
Returns the current minimum width.
int getMinimumWhenOffTheBottom() const noexcept
Returns the minimum distance the bounds can be off-screen.
int getMinimumHeight() const noexcept
Returns the current minimum height.
int getMaximumHeight() const noexcept
Returns the current maximum height.
int getMinimumWhenOffTheLeft() const noexcept
Returns the minimum distance the bounds can be off-screen.
int getMinimumWhenOffTheTop() const noexcept
Returns the minimum distance the bounds can be off-screen.
The base class for all JUCE user-interface objects.
Manages a rectangle and allows geometric operations to be performed on it.
#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.