LMMS
Loading...
Searching...
No Matches
juce::MessageBoxOptions Class Reference

#include <juce_MessageBoxOptions.h>

Public Member Functions

 MessageBoxOptions ()=default
 MessageBoxOptions (const MessageBoxOptions &)=default
MessageBoxOptions & operator= (const MessageBoxOptions &)=default
JUCE_NODISCARD MessageBoxOptions withIconType (MessageBoxIconType type) const
JUCE_NODISCARD MessageBoxOptions withTitle (const String &boxTitle) const
JUCE_NODISCARD MessageBoxOptions withMessage (const String &boxMessage) const
JUCE_NODISCARD MessageBoxOptions withButton (const String &text) const
JUCE_NODISCARD MessageBoxOptions withAssociatedComponent (Component *component) const
MessageBoxIconType getIconType () const noexcept
String getTitle () const
String getMessage () const
int getNumButtons () const noexcept
String getButtonText (int buttonIndex) const
Component * getAssociatedComponent () const noexcept

Static Private Member Functions

template<typename Member, typename Item>
static MessageBoxOptions with (MessageBoxOptions options, Member &&member, Item &&item)

Private Attributes

MessageBoxIconType iconType = MessageBoxIconType::InfoIcon
String title
String message
StringArray buttons
WeakReference< Component > associatedComponent

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")
myCallback);
static void JUCE_CALLTYPE showAsync(const MessageBoxOptions &options, ModalComponentManager::Callback *callback)
Definition juce_AlertWindow.cpp:694
JUCE_NODISCARD MessageBoxOptions withTitle(const String &boxTitle) const
Definition juce_MessageBoxOptions.h:74
JUCE_NODISCARD MessageBoxOptions withAssociatedComponent(Component *component) const
Definition juce_MessageBoxOptions.h:88
JUCE_NODISCARD MessageBoxOptions withIconType(MessageBoxIconType type) const
Definition juce_MessageBoxOptions.h:71
JUCE_NODISCARD MessageBoxOptions withMessage(const String &boxMessage) const
Definition juce_MessageBoxOptions.h:77
JUCE_NODISCARD MessageBoxOptions withButton(const String &text) const
Definition juce_MessageBoxOptions.h:85
@ InfoIcon
Definition juce_MessageBoxOptions.h:37

@tags{GUI}

Constructor & Destructor Documentation

◆ MessageBoxOptions() [1/2]

juce::MessageBoxOptions::MessageBoxOptions ( )
default

◆ MessageBoxOptions() [2/2]

juce::MessageBoxOptions::MessageBoxOptions ( const MessageBoxOptions & )
default

Member Function Documentation

◆ getAssociatedComponent()

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

Returns the component that the dialog box is associated with.

See also
withAssociatedComponent

◆ getButtonText()

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

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

See also
withButtonText, getNumButtons

◆ getIconType()

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

Returns the icon type of the dialog box.

See also
withIconType

◆ getMessage()

String juce::MessageBoxOptions::getMessage ( ) const
inline

Returns the message of the dialog box.

See also
withMessage

◆ getNumButtons()

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

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

See also
withButtonText

◆ getTitle()

String juce::MessageBoxOptions::getTitle ( ) const
inline

Returns the title of the dialog box.

See also
withTitle

◆ operator=()

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

◆ with()

template<typename Member, typename Item>
MessageBoxOptions juce::MessageBoxOptions::with ( MessageBoxOptions options,
Member && member,
Item && item )
inlinestaticprivate

◆ withAssociatedComponent()

JUCE_NODISCARD MessageBoxOptions juce::MessageBoxOptions::withAssociatedComponent ( Component * component) const
inline

The component that the dialog box should be associated with.

◆ withButton()

JUCE_NODISCARD MessageBoxOptions juce::MessageBoxOptions::withButton ( const String & text) const
inline

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.

◆ withIconType()

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

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

◆ withMessage()

JUCE_NODISCARD MessageBoxOptions juce::MessageBoxOptions::withMessage ( const String & boxMessage) const
inline

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

◆ withTitle()

JUCE_NODISCARD MessageBoxOptions juce::MessageBoxOptions::withTitle ( const String & boxTitle) const
inline

Sets the title of the dialog box.

Member Data Documentation

◆ associatedComponent

WeakReference<Component> juce::MessageBoxOptions::associatedComponent
private

◆ buttons

StringArray juce::MessageBoxOptions::buttons
private

◆ iconType

MessageBoxIconType juce::MessageBoxOptions::iconType = MessageBoxIconType::InfoIcon
private

◆ message

String juce::MessageBoxOptions::message
private

◆ title

String juce::MessageBoxOptions::title
private

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