Class that holds configuration information about the action buttons displayed in a message box.
Public Member Functions | |
| MessageBoxButtonOptions (String textIn, int codeIn) | |
| Sets the text and result code for this action. | |
| MessageBoxButtonOptions & | setRole (MessageBoxButtonRole roleIn) |
| Sets the role of this button. | |
| MessageBoxButtonOptions | withRole (MessageBoxButtonRole roleIn) const |
| Like setRole(), but returns a copy of this object with the new state applied. | |
| MessageBoxButtonOptions & | setPreferredAction (bool shouldBeDefault=true) |
| Sets whether this button is the default/primary action of the dialog, usually highlighted and selected with the 'return' key on the keyboard. | |
| MessageBoxButtonOptions | withPreferredAction (bool shouldBeDefault=true) const |
| Like setPreferredAction(), but returns a copy of this object with the new state applied. | |
| String | getText () const |
| Returns the text corresponding to this action. | |
| int | getCode () const |
| Returns the result code of this action. | |
| MessageBoxButtonRole | getRole () const |
| Returns the role of this action. | |
| bool | isPreferredAction () const |
| Returns true if this is the preferred action, or false otherwise. | |
|
inline |
Sets the text and result code for this action.
Result codes should be unique for each action within the same message box.
Referenced by setPreferredAction(), setRole(), withPreferredAction(), and withRole().
|
inline |
Sets the role of this button.
If unspecified, the button will have the 'normal' role. Within a given message box, a maximum of one button may have the 'destroy' role, and a maximum of one button may have the 'cancel' role.
The button with the 'cancel' role, if present, will be positioned as follows in a native message box:
You will get the best result across all platforms by setting both the preferred action and the cancel role.
References MessageBoxButtonOptions().
|
inlinenodiscard |
Like setRole(), but returns a copy of this object with the new state applied.
References MessageBoxButtonOptions().
|
inline |
Sets whether this button is the default/primary action of the dialog, usually highlighted and selected with the 'return' key on the keyboard.
If no action is specified as preferred, then the first button added to the dialog without the 'cancel' role will be treated as the preferred action.
The preferred action (either explicit or implicit) will be positioned as follows in a native message box:
You will get the best result across all platforms by setting both the preferred action and the cancel role.
References MessageBoxButtonOptions().
|
inlinenodiscard |
Like setPreferredAction(), but returns a copy of this object with the new state applied.
References MessageBoxButtonOptions().
|
inline |
Returns the text corresponding to this action.
|
inline |
Returns the result code of this action.
|
inline |
Returns the role of this action.
|
inline |
Returns true if this is the preferred action, or false otherwise.