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_DialogWindow.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//==============================================================================
51class JUCE_API DialogWindow : public DocumentWindow
52{
53public:
54 //==============================================================================
71 DialogWindow (const String& name,
72 Colour backgroundColour,
73 bool escapeKeyTriggersCloseButton,
74 bool addToDesktop = true,
75 float desktopScale = 1.0f);
76
80 ~DialogWindow() override;
81
82 //==============================================================================
89 struct JUCE_API LaunchOptions
90 {
91 LaunchOptions() noexcept;
92
95
97 Colour dialogBackgroundColour = Colours::lightgrey;
98
105
110 Component* componentToCentreAround = nullptr;
111
113 bool escapeKeyTriggersCloseButton = true;
115 bool useNativeTitleBar = true;
117 bool resizable = true;
119 bool useBottomRightCornerResizer = false;
120
137 DialogWindow* launchAsync();
138
143 DialogWindow* create();
144
145 #if JUCE_MODAL_LOOPS_PERMITTED
152 int runModal();
153 #endif
154
156 };
157
158 //==============================================================================
196 static void showDialog (const String& dialogTitle,
197 Component* contentComponent,
198 Component* componentToCentreAround,
199 Colour backgroundColour,
200 bool escapeKeyTriggersCloseButton,
201 bool shouldBeResizable = false,
202 bool useBottomRightCornerResizer = false);
203
204 #if JUCE_MODAL_LOOPS_PERMITTED
242 static int showModalDialog (const String& dialogTitle,
243 Component* contentComponent,
244 Component* componentToCentreAround,
245 Colour backgroundColour,
246 bool escapeKeyTriggersCloseButton,
247 bool shouldBeResizable = false,
248 bool useBottomRightCornerResizer = false);
249 #endif
250
251
256 virtual bool escapeKeyPressed();
257
259 std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override;
260
261protected:
262 //==============================================================================
264 void resized() override;
266 bool keyPressed (const KeyPress&) override;
268 float getDesktopScaleFactor() const override { return desktopScale * Desktop::getInstance().getGlobalScaleFactor(); }
269
270private:
271 float desktopScale = 1.0f;
272 bool escapeKeyTriggersCloseButton;
273
275};
276
277} // namespace juce
Represents a colour, also including a transparency value.
Definition juce_Colour.h:38
The base class for all JUCE user-interface objects.
A dialog-box style window.
~DialogWindow() override
Destructor.
float getDesktopScaleFactor() const override
Returns the default scale factor to use for this component when it is placed on the desktop.
A resizable window with a title bar and maximise, minimise and close buttons.
Represents a key press, including any modifier keys that are needed.
Holds a pointer to an object which can optionally be deleted when this pointer goes out of scope.
The JUCE String class!
Definition juce_String.h:53
#define JUCE_DECLARE_NON_COPYABLE(className)
This is a shorthand macro for deleting a class's copy constructor and copy assignment operator.
#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 class defines a collection of settings to be used to open a DialogWindow.
OptionalScopedPointer< Component > content
The content component to show in the window.
String dialogTitle
The title to give the window.