Loading...
Searching...
No Matches
juce::DialogWindow::LaunchOptions Struct Reference

## 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.

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

- juce_gui_basics/windows/juce_DialogWindow.h

## Public Member Functions

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

## Public Attributes

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

## Constructors and Destructors

## LaunchOptions()

juce::DialogWindow::LaunchOptions::LaunchOptions | ( |  | ) |

noexcept

Referenced by runModal().

## Member Functions

## launchAsync()

DialogWindow * juce::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:

if (DialogWindow* dw = contentComponent->findParentComponentOfClass<DialogWindow>())
dw->exitModalState (1234);
juce::DialogWindow::DialogWindow
DialogWindow(const String &name, Colour backgroundColour, bool escapeKeyTriggersCloseButton, bool addToDesktop=true, float desktopScale=1.0f)
Creates a DialogWindow.

References juce::DialogWindow::DialogWindow(), and launchAsync().

Referenced by launchAsync(), and juce::StandalonePluginHolder::showAudioSettingsDialog().

## create()

DialogWindow * juce::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.

References create(), and juce::DialogWindow::DialogWindow().

Referenced by create().

## runModal()

int juce::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.

References LaunchOptions().

## Member Data Documentation

## dialogTitle

String juce::DialogWindow::LaunchOptions::dialogTitle

The title to give the window.

Referenced by juce::StandalonePluginHolder::showAudioSettingsDialog().

## dialogBackgroundColour

Colour juce::DialogWindow::LaunchOptions::dialogBackgroundColour = Colours::lightgrey

The background colour for the window.

Referenced by juce::StandalonePluginHolder::showAudioSettingsDialog().

## content

OptionalScopedPointer<Component> juce::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 juce::StandalonePluginHolder::showAudioSettingsDialog().

## componentToCentreAround

Component* juce::DialogWindow::LaunchOptions::componentToCentreAround = nullptr

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.

## escapeKeyTriggersCloseButton

bool juce::DialogWindow::LaunchOptions::escapeKeyTriggersCloseButton = true

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

Referenced by juce::StandalonePluginHolder::showAudioSettingsDialog().

## useNativeTitleBar

bool juce::DialogWindow::LaunchOptions::useNativeTitleBar = true

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

See TopLevelWindow::setUsingNativeTitleBar()

Referenced by juce::StandalonePluginHolder::showAudioSettingsDialog().

## resizable

bool juce::DialogWindow::LaunchOptions::resizable = true

If true, the window will be resizable.

See ResizableWindow::setResizable()

Referenced by juce::StandalonePluginHolder::showAudioSettingsDialog().

## useBottomRightCornerResizer

bool juce::DialogWindow::LaunchOptions::useBottomRightCornerResizer = false

Indicates whether to use a border or corner resizer component.

See ResizableWindow::setResizable()

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited