JUCE  v5.1.1-3-g1a0b28c73
JUCE API
DialogWindow::LaunchOptions Struct Reference

This class defines a collection of settings to be used to open a DialogWindow. More...

#include <juce_DialogWindow.h>

Collaboration diagram for DialogWindow::LaunchOptions:

Public Member Functions

 LaunchOptions () noexcept
 
DialogWindowcreate ()
 Creates a new DialogWindow instance with these settings. More...
 
DialogWindowlaunchAsync ()
 Launches a new modal dialog window. More...
 
int runModal ()
 Launches and runs the dialog modally, returning the status code that was used to terminate the modal loop. More...
 

Public Attributes

ComponentcomponentToCentreAround
 If this is not a nullptr, it indicates a component that you'd like to position this dialog box in front of. More...
 
OptionalScopedPointer< Componentcontent
 The content component to show in the window. More...
 
Colour dialogBackgroundColour
 The background colour for the window. More...
 
String dialogTitle
 The title to give the window. More...
 
bool escapeKeyTriggersCloseButton
 If true, then the escape key will trigger the dialog's close button. More...
 
bool resizable
 If true, the window will be resizable. More...
 
bool useBottomRightCornerResizer
 Indicates whether to use a border or corner resizer component. More...
 
bool useNativeTitleBar
 If true, the dialog will use a native title bar. More...
 

Detailed Description

This class defines a collection of settings to be used to open a DialogWindow.

The easiest way to open a DialogWindow is to create yourself a LaunchOptions structure, initialise its fields with the appropriate details, and then call its launchAsync() method to launch the dialog.

Constructor & Destructor Documentation

◆ LaunchOptions()

DialogWindow::LaunchOptions::LaunchOptions ( )
noexcept

Member Function Documentation

◆ create()

DialogWindow* DialogWindow::LaunchOptions::create ( )

Creates a new DialogWindow instance with these settings.

This method simply creates the window, it doesn't run it modally. In most cases you'll want to use launchAsync() or runModal() instead.

◆ launchAsync()

DialogWindow* DialogWindow::LaunchOptions::launchAsync ( )

Launches a new modal dialog window.

This will create a dialog based on the settings in this structure, launch it modally, and return immediately. The window that is returned will be automatically deleted when the modal state is terminated.

When the dialog's close button is clicked, it'll automatically terminate its modal state, but you can also do this programmatically by calling exitModalState (returnValue) on the DialogWindow.

If your content component needs to find the dialog window that it is contained in, a quick trick is to do this:

dw->exitModalState (1234);

Referenced by StandalonePluginHolder::showAudioSettingsDialog().

◆ runModal()

int DialogWindow::LaunchOptions::runModal ( )

Launches and runs the dialog modally, returning the status code that was used to terminate the modal loop.

Note that running modal loops inline is a BAD technique. If possible, always use launchAsync() instead of this method.

Member Data Documentation

◆ componentToCentreAround

Component* DialogWindow::LaunchOptions::componentToCentreAround

If this is not a nullptr, it indicates a component that you'd like to position this dialog box in front of.

See the DocumentWindow::centreAroundComponent() method for more info about this parameter.

◆ content

OptionalScopedPointer<Component> DialogWindow::LaunchOptions::content

The content component to show in the window.

This must not be null! Using an OptionalScopedPointer to hold this pointer lets you indicate whether you'd like the dialog to automatically delete the component when the dialog has terminated.

Referenced by StandalonePluginHolder::showAudioSettingsDialog().

◆ dialogBackgroundColour

Colour DialogWindow::LaunchOptions::dialogBackgroundColour

The background colour for the window.

Referenced by StandalonePluginHolder::showAudioSettingsDialog().

◆ dialogTitle

String DialogWindow::LaunchOptions::dialogTitle

The title to give the window.

Referenced by StandalonePluginHolder::showAudioSettingsDialog().

◆ escapeKeyTriggersCloseButton

bool DialogWindow::LaunchOptions::escapeKeyTriggersCloseButton

If true, then the escape key will trigger the dialog's close button.

Referenced by StandalonePluginHolder::showAudioSettingsDialog().

◆ resizable

bool DialogWindow::LaunchOptions::resizable

If true, the window will be resizable.

See ResizableWindow::setResizable()

Referenced by StandalonePluginHolder::showAudioSettingsDialog().

◆ useBottomRightCornerResizer

bool DialogWindow::LaunchOptions::useBottomRightCornerResizer

Indicates whether to use a border or corner resizer component.

See ResizableWindow::setResizable()

◆ useNativeTitleBar

bool DialogWindow::LaunchOptions::useNativeTitleBar

If true, the dialog will use a native title bar.

See TopLevelWindow::setUsingNativeTitleBar()

Referenced by StandalonePluginHolder::showAudioSettingsDialog().


The documentation for this struct was generated from the following file: