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
Public Member Functions | Static Public Member Functions | List of all members
juce::MessageBoxOptions Class Reference

Class used to create a set of options to pass to the AlertWindow and NativeMessageBox methods for showing dialog boxes. More...

#include "juce_MessageBoxOptions.h"

Public Member Functions

 MessageBoxOptions (const MessageBoxOptions &)=default
 
MessageBoxOptionsoperator= (const MessageBoxOptions &)=default
 
MessageBoxOptions withIconType (MessageBoxIconType type) const
 Sets the type of icon that should be used for the dialog box.
 
MessageBoxOptions withTitle (const String &boxTitle) const
 Sets the title of the dialog box.
 
MessageBoxOptions withMessage (const String &boxMessage) const
 Sets the message that should be displayed in the dialog box.
 
MessageBoxOptions withButton (const String &text) const
 If the string passed in is not empty, this will add a button to the dialog box with the specified text.
 
MessageBoxOptions withAssociatedComponent (Component *component) const
 The component that the dialog box should be associated with.
 
MessageBoxOptions withParentComponent (Component *component) const
 The component that will contain the message box (e.g.
 
MessageBoxIconType getIconType () const noexcept
 Returns the icon type of the dialog box.
 
String getTitle () const
 Returns the title of the dialog box.
 
String getMessage () const
 Returns the message of the dialog box.
 
int getNumButtons () const noexcept
 Returns the number of buttons that have been added to the dialog box.
 
String getButtonText (int buttonIndex) const
 Returns the text that has been set for one of the buttons of the dialog box.
 
ComponentgetAssociatedComponent () const noexcept
 Returns the component that the dialog box is associated with.
 
ComponentgetParentComponent () const noexcept
 Returns the component that will be used as the parent of the dialog box.
 

Static Public Member Functions

static MessageBoxOptions makeOptionsOk (MessageBoxIconType iconType, const String &title, const String &message, const String &buttonText=String(), Component *associatedComponent=nullptr)
 Creates options suitable for a message box with a single button.
 
static MessageBoxOptions makeOptionsOkCancel (MessageBoxIconType iconType, const String &title, const String &message, const String &button1Text=String(), const String &button2Text=String(), Component *associatedComponent=nullptr)
 Creates options suitable for a message box with two buttons.
 
static MessageBoxOptions makeOptionsYesNo (MessageBoxIconType iconType, const String &title, const String &message, const String &button1Text=String(), const String &button2Text=String(), Component *associatedComponent=nullptr)
 Creates options suitable for a message box with two buttons.
 
static MessageBoxOptions makeOptionsYesNoCancel (MessageBoxIconType iconType, const String &title, const String &message, const String &button1Text=String(), const String &button2Text=String(), const String &button3Text=String(), Component *associatedComponent=nullptr)
 Creates options suitable for a message box with three buttons.
 

Detailed Description

Class used to create a set of options to pass to the AlertWindow and NativeMessageBox methods for showing dialog boxes.

You can chain together a series of calls to this class's methods to create a set of whatever options you want to specify.

E.g.

.withTitle ("A Title")
.withMessage ("A message.")
.withButton ("OK")
.withButton ("Cancel")
static void JUCE_CALLTYPE showAsync(const MessageBoxOptions &options, ModalComponentManager::Callback *callback)
Shows a dialog box using the specified options.
Class used to create a set of options to pass to the AlertWindow and NativeMessageBox methods for sho...
MessageBoxOptions withMessage(const String &boxMessage) const
Sets the message that should be displayed in the dialog box.
MessageBoxOptions withTitle(const String &boxTitle) const
Sets the title of the dialog box.
MessageBoxOptions withButton(const String &text) const
If the string passed in is not empty, this will add a button to the dialog box with the specified tex...
MessageBoxOptions withIconType(MessageBoxIconType type) const
Sets the type of icon that should be used for the dialog box.
MessageBoxOptions withAssociatedComponent(Component *component) const
The component that the dialog box should be associated with.
@ InfoIcon
An icon that indicates that the dialog box is just giving the user some information,...
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88

@tags{GUI}

Definition at line 62 of file juce_MessageBoxOptions.h.

Member Function Documentation

◆ getAssociatedComponent()

Component * juce::MessageBoxOptions::getAssociatedComponent ( ) const
noexcept

Returns the component that the dialog box is associated with.

See also
withAssociatedComponent

Definition at line 132 of file juce_MessageBoxOptions.h.

◆ getButtonText()

String juce::MessageBoxOptions::getButtonText ( int  buttonIndex) const

Returns the text that has been set for one of the buttons of the dialog box.

See also
withButtonText, getNumButtons

Definition at line 126 of file juce_MessageBoxOptions.h.

◆ getIconType()

MessageBoxIconType juce::MessageBoxOptions::getIconType ( ) const
noexcept

Returns the icon type of the dialog box.

See also
withIconType

Definition at line 102 of file juce_MessageBoxOptions.h.

◆ getMessage()

String juce::MessageBoxOptions::getMessage ( ) const

Returns the message of the dialog box.

See also
withMessage

Definition at line 114 of file juce_MessageBoxOptions.h.

◆ getNumButtons()

int juce::MessageBoxOptions::getNumButtons ( ) const
noexcept

Returns the number of buttons that have been added to the dialog box.

See also
withButtonText

Definition at line 120 of file juce_MessageBoxOptions.h.

◆ getParentComponent()

Component * juce::MessageBoxOptions::getParentComponent ( ) const
noexcept

Returns the component that will be used as the parent of the dialog box.

See also
withParentComponent

Definition at line 138 of file juce_MessageBoxOptions.h.

◆ getTitle()

String juce::MessageBoxOptions::getTitle ( ) const

Returns the title of the dialog box.

See also
withTitle

Definition at line 108 of file juce_MessageBoxOptions.h.

◆ makeOptionsOk()

MessageBoxOptions juce::MessageBoxOptions::makeOptionsOk ( MessageBoxIconType  iconType,
const String title,
const String message,
const String buttonText = String(),
Component associatedComponent = nullptr 
)
static

Creates options suitable for a message box with a single button.

If no button text is supplied, "OK" will be used.

Definition at line 29 of file juce_MessageBoxOptions.cpp.

◆ makeOptionsOkCancel()

MessageBoxOptions juce::MessageBoxOptions::makeOptionsOkCancel ( MessageBoxIconType  iconType,
const String title,
const String message,
const String button1Text = String(),
const String button2Text = String(),
Component associatedComponent = nullptr 
)
static

Creates options suitable for a message box with two buttons.

If no button text is supplied, "OK" and "Cancel" will be used.

Definition at line 43 of file juce_MessageBoxOptions.cpp.

◆ makeOptionsYesNo()

MessageBoxOptions juce::MessageBoxOptions::makeOptionsYesNo ( MessageBoxIconType  iconType,
const String title,
const String message,
const String button1Text = String(),
const String button2Text = String(),
Component associatedComponent = nullptr 
)
static

Creates options suitable for a message box with two buttons.

If no button text is supplied, "Yes" and "No" will be used.

Definition at line 59 of file juce_MessageBoxOptions.cpp.

◆ makeOptionsYesNoCancel()

MessageBoxOptions juce::MessageBoxOptions::makeOptionsYesNoCancel ( MessageBoxIconType  iconType,
const String title,
const String message,
const String button1Text = String(),
const String button2Text = String(),
const String button3Text = String(),
Component associatedComponent = nullptr 
)
static

Creates options suitable for a message box with three buttons.

If no button text is supplied, "Yes", "No", and "Cancel" will be used.

Definition at line 75 of file juce_MessageBoxOptions.cpp.

◆ withAssociatedComponent()

MessageBoxOptions juce::MessageBoxOptions::withAssociatedComponent ( Component component) const

The component that the dialog box should be associated with.

Definition at line 88 of file juce_MessageBoxOptions.h.

◆ withButton()

MessageBoxOptions juce::MessageBoxOptions::withButton ( const String text) const

If the string passed in is not empty, this will add a button to the dialog box with the specified text.

Generally up to 3 buttons are supported for dialog boxes, so adding any more than this may have no effect.

Definition at line 85 of file juce_MessageBoxOptions.h.

◆ withIconType()

MessageBoxOptions juce::MessageBoxOptions::withIconType ( MessageBoxIconType  type) const

Sets the type of icon that should be used for the dialog box.

Definition at line 71 of file juce_MessageBoxOptions.h.

◆ withMessage()

MessageBoxOptions juce::MessageBoxOptions::withMessage ( const String boxMessage) const

Sets the message that should be displayed in the dialog box.

Definition at line 77 of file juce_MessageBoxOptions.h.

◆ withParentComponent()

MessageBoxOptions juce::MessageBoxOptions::withParentComponent ( Component component) const

The component that will contain the message box (e.g.

the AudioProcessorEditor in a plugin).

This will only affect JUCE AlertWindows. It won't affect the drawing of native message boxes. This is mainly intended for use in AU plugins, where opening additional windows can be problematic.

Definition at line 95 of file juce_MessageBoxOptions.h.

◆ withTitle()

MessageBoxOptions juce::MessageBoxOptions::withTitle ( const String boxTitle) const

Sets the title of the dialog box.

Definition at line 74 of file juce_MessageBoxOptions.h.


The documentation for this class was generated from the following files: