|
Ultralight C++ API 2.0.0
|
Native modal message boxes for alerts and confirmations.
#include <AppCore/Dialogs.h>
This header provides ShowMessageBox() to display modal dialogs from the host OS. The call blocks until the user responds and returns the selected button result.
You can prompt the user for confirmation before discarding unsaved edits:
You must call ShowMessageBox() on the main thread.
On Linux, the library logs the message and returns the declining button (or ButtonResult::OK when it's the only button) whenever it can't display a dialog:
To style dialogs with HTML and CSS instead of native OS chrome, create a floating panel through Foreground. Setting FocusPolicy::Grab on the panel ensures it takes keyboard focus whenever it's shown.
Functions | |
| ButtonResult | ShowMessageBox (const String &title, const String &message, DialogIcon icon=DialogIcon::Info, ButtonType buttons=ButtonType::OK) |
| Show a modal message box with the specified title, message, icon, and buttons. | |
Namespaces | |
| namespace | ultralight |
| Root namespace for every public Ultralight type, function, and enumeration. | |
Enumerations | |
| enum class | DialogIcon { Info , Warning , Error , Question } |
| Enum representing the icon to be displayed in a dialog. More... | |
| enum class | ButtonType { OK , OKCancel , YesNo } |
| Enum representing the button types in a dialog. More... | |
| enum class | ButtonResult { OK , Cancel , Yes , No } |
| Enum representing the result of a dialog button press. More... | |