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_CallOutBox.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//==============================================================================
59class JUCE_API CallOutBox : public Component,
60 private Timer
61{
62public:
63 //==============================================================================
77 CallOutBox (Component& contentComponent,
78 Rectangle<int> areaToPointTo,
79 Component* parentComponent);
80
81 //==============================================================================
83 void setArrowSize (float newSize);
84
93 void updatePosition (const Rectangle<int>& newAreaToPointTo,
94 const Rectangle<int>& newAreaToFitIn);
95
96
116 static CallOutBox& launchAsynchronously (std::unique_ptr<Component> contentComponent,
117 Rectangle<int> areaToPointTo,
118 Component* parentComponent);
119
123 void dismiss();
124
133 void setDismissalMouseClicksAreAlwaysConsumed (bool shouldAlwaysBeConsumed) noexcept;
134
135 //==============================================================================
137 struct JUCE_API LookAndFeelMethods
138 {
139 virtual ~LookAndFeelMethods() = default;
140
141 virtual void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) = 0;
142 virtual int getCallOutBoxBorderSize (const CallOutBox&) = 0;
143 virtual float getCallOutBoxCornerSize (const CallOutBox&) = 0;
144 };
145
146 //==============================================================================
148 void paint (Graphics&) override;
150 void resized() override;
152 void moved() override;
154 void childBoundsChanged (Component*) override;
156 bool hitTest (int x, int y) override;
158 void inputAttemptWhenModal() override;
160 bool keyPressed (const KeyPress&) override;
162 void handleCommandMessage (int) override;
164 int getBorderSize() const noexcept;
166 void lookAndFeelChanged() override;
168 std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override;
169
170private:
171 //==============================================================================
172 Component& content;
173 Path outline;
174 Point<float> targetPoint;
175 Rectangle<int> availableArea, targetArea;
176 Image background;
177 float arrowSize = 16.0f;
178 bool dismissalMouseClicksAreAlwaysConsumed = false;
179
180 Time creationTime;
181
182 void refreshPath();
183 void timerCallback() override;
184
186};
187
188} // namespace juce
Base class for accessible Components.
A box with a small arrow that can be used as a temporary pop-up window to show extra controls when a ...
The base class for all JUCE user-interface objects.
A graphics context, used for drawing a component or image.
Holds a fixed-size bitmap.
Definition juce_Image.h:58
Represents a key press, including any modifier keys that are needed.
A path is a sequence of lines and curves that may either form a closed shape or be open-ended.
Definition juce_Path.h:65
A pair of (x, y) coordinates.
Definition juce_Point.h:42
Manages a rectangle and allows geometric operations to be performed on it.
Holds an absolute date and time.
Definition juce_Time.h:37
Makes repeated callbacks to a virtual method at a specified time interval.
Definition juce_Timer.h:52
#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.
This abstract base class is implemented by LookAndFeel classes.