Public Member Functions | List of all members
MessageBoxOptions Class Reference

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

Public Member Functions

 MessageBoxOptions ()=default
 
 MessageBoxOptions (const MessageBoxOptions &)=default
 
MessageBoxOptionsoperator= (const MessageBoxOptions &)=default
 
JUCE_NODISCARD MessageBoxOptions withIconType (MessageBoxIconType type) const
 Sets the type of icon that should be used for the dialog box. More...
 
JUCE_NODISCARD MessageBoxOptions withTitle (const String &boxTitle) const
 Sets the title of the dialog box. More...
 
JUCE_NODISCARD MessageBoxOptions withMessage (const String &boxMessage) const
 Sets the message that should be displayed in the dialog box. More...
 
JUCE_NODISCARD 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. More...
 
JUCE_NODISCARD MessageBoxOptions withAssociatedComponent (Component *component) const
 The component that the dialog box should be associated with. More...
 
MessageBoxIconType getIconType () const noexcept
 Returns the icon type of the dialog box. More...
 
String getTitle () const
 Returns the title of the dialog box. More...
 
String getMessage () const
 Returns the message of the dialog box. More...
 
int getNumButtons () const noexcept
 Returns the number of buttons that have been added to the dialog box. More...
 
String getButtonText (int buttonIndex) const
 Returns the text that has been set for one of the buttons of the dialog box. More...
 
ComponentgetAssociatedComponent () const noexcept
 Returns the component that the dialog box is associated with. More...
 

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.

Constructor & Destructor Documentation

◆ MessageBoxOptions() [1/2]

MessageBoxOptions::MessageBoxOptions ( )
default

◆ MessageBoxOptions() [2/2]

MessageBoxOptions::MessageBoxOptions ( const MessageBoxOptions )
default

Member Function Documentation

◆ operator=()

MessageBoxOptions& MessageBoxOptions::operator= ( const MessageBoxOptions )
default

◆ withIconType()

JUCE_NODISCARD MessageBoxOptions MessageBoxOptions::withIconType ( MessageBoxIconType  type) const

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

References gl::type.

◆ withTitle()

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

Sets the title of the dialog box.

◆ withMessage()

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

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

◆ withButton()

JUCE_NODISCARD MessageBoxOptions 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.

◆ withAssociatedComponent()

JUCE_NODISCARD MessageBoxOptions MessageBoxOptions::withAssociatedComponent ( Component component) const

The component that the dialog box should be associated with.

◆ getIconType()

MessageBoxIconType MessageBoxOptions::getIconType ( ) const
noexcept

Returns the icon type of the dialog box.

See also
withIconType

◆ getTitle()

String MessageBoxOptions::getTitle ( ) const

Returns the title of the dialog box.

See also
withTitle

◆ getMessage()

String MessageBoxOptions::getMessage ( ) const

Returns the message of the dialog box.

See also
withMessage

References gl::message.

◆ getNumButtons()

int MessageBoxOptions::getNumButtons ( ) const
noexcept

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

See also
withButtonText

◆ getButtonText()

String 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

◆ getAssociatedComponent()

Component* MessageBoxOptions::getAssociatedComponent ( ) const
noexcept

Returns the component that the dialog box is associated with.

See also
withAssociatedComponent

The documentation for this class was generated from the following file:
MessageBoxOptions::withTitle
JUCE_NODISCARD MessageBoxOptions withTitle(const String &boxTitle) const
Sets the title of the dialog box.
Definition: juce_MessageBoxOptions.h:77
MessageBoxOptions::withButton
JUCE_NODISCARD 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...
Definition: juce_MessageBoxOptions.h:88
MessageBoxOptions::withAssociatedComponent
JUCE_NODISCARD MessageBoxOptions withAssociatedComponent(Component *component) const
The component that the dialog box should be associated with.
Definition: juce_MessageBoxOptions.h:91
AlertWindow::showAsync
static void JUCE_CALLTYPE showAsync(const MessageBoxOptions &options, ModalComponentManager::Callback *callback)
Shows a dialog box using the specified options.
MessageBoxOptions::withMessage
JUCE_NODISCARD MessageBoxOptions withMessage(const String &boxMessage) const
Sets the message that should be displayed in the dialog box.
Definition: juce_MessageBoxOptions.h:80
MessageBoxIconType::InfoIcon
An icon that indicates that the dialog box is just giving the user some information,...
MessageBoxOptions::withIconType
JUCE_NODISCARD MessageBoxOptions withIconType(MessageBoxIconType type) const
Sets the type of icon that should be used for the dialog box.
Definition: juce_MessageBoxOptions.h:74
MessageBoxOptions::MessageBoxOptions
MessageBoxOptions()=default