Site Home
Docs
Go to C API
Ultralight C++ API
1.4.0
Loading...
Searching...
No Matches
Dialogs.h
Go to the documentation of this file.
1
/**************************************************************************************************
2
* This file is a part of Ultralight. *
3
* *
4
* See <https://ultralig.ht> for licensing and more. *
5
* *
6
* (C) 2024 Ultralight, Inc. *
7
**************************************************************************************************/
8
9
#pragma once
10
11
#include "
Defines.h
"
12
#include <
Ultralight/String.h
>
13
14
namespace
ultralight
{
15
16
///
17
/// Enum representing the icon to be displayed in a dialog.
18
///
19
enum class
DialogIcon
{
20
Info
,
///< Information icon
21
Warning
,
///< Warning icon
22
Error
,
///< Error icon
23
Question
///< Question icon
24
};
25
26
///
27
/// Enum representing the button types in a dialog.
28
///
29
enum class
ButtonType
{
30
OK
,
///< Single "OK" button
31
OKCancel
,
///< "OK" and "Cancel" buttons
32
YesNo
///< "Yes" and "No" buttons
33
};
34
35
///
36
/// Enum representing the result of a dialog button press.
37
///
38
enum class
ButtonResult
{
39
OK
,
///< "OK" button was pressed
40
Cancel
,
///< "Cancel" button was pressed
41
Yes
,
///< "Yes" button was pressed
42
No
///< "No" button was pressed
43
};
44
45
///
46
/// Shows a modal message box with the specified title, message, icon, and buttons.
47
///
48
/// @param title The title of the message box.
49
/// @param message The message to display in the message box.
50
/// @param icon The icon to display in the message box (default: DialogIcon::Info).
51
/// @param buttons The button type to display in the message box (default: ButtonType::OK).
52
///
53
/// @return The result of the button press.
54
///
55
AExport
ButtonResult
ShowMessageBox
(
const
String
& title,
const
String
& message,
56
DialogIcon
icon =
DialogIcon::Info
,
57
ButtonType
buttons =
ButtonType::OK
);
58
59
}
// namespace ultralight
Defines.h
AExport
#define AExport
Definition
Defines.h:42
String.h
ultralight::String
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition
String.h:34
ultralight
Definition
App.h:14
ultralight::DialogIcon
DialogIcon
Enum representing the icon to be displayed in a dialog.
Definition
Dialogs.h:19
ultralight::DialogIcon::Warning
@ Warning
Warning icon.
ultralight::DialogIcon::Info
@ Info
Information icon.
ultralight::DialogIcon::Error
@ Error
Error icon.
ultralight::DialogIcon::Question
@ Question
Question icon.
ultralight::ButtonResult
ButtonResult
Enum representing the result of a dialog button press.
Definition
Dialogs.h:38
ultralight::ButtonResult::Yes
@ Yes
"Yes" button was pressed
ultralight::ButtonResult::No
@ No
"No" button was pressed
ultralight::ButtonResult::Cancel
@ Cancel
"Cancel" button was pressed
ultralight::ShowMessageBox
ButtonResult ShowMessageBox(const String &title, const String &message, DialogIcon icon=DialogIcon::Info, ButtonType buttons=ButtonType::OK)
Shows a modal message box with the specified title, message, icon, and buttons.
ultralight::ButtonType
ButtonType
Enum representing the button types in a dialog.
Definition
Dialogs.h:29
ultralight::ButtonType::OKCancel
@ OKCancel
"OK" and "Cancel" buttons
ultralight::ButtonType::YesNo
@ YesNo
"Yes" and "No" buttons
ultralight::ButtonType::OK
@ OK
Single "OK" button.
AppCore
Dialogs.h