1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Adapted from https://github.com/aaronmjacobs/Boxer/blob/master/include/boxer/boxer.h
#pragma once
namespace Dialog {
/// Options for styles to apply to a message box.
enum class Style {
Info,
Warning,
Error,
Question,
};
/// Options for buttons to provide on a message box.
enum class Buttons {
OK,
OKCancel,
YesNo,
Quit,
};
/// Possible responses from a message box. 'None' signifies that no option was chosen, and 'Error' signifies that an
/// error was encountered while creating the message box.
enum class Selection {
OK,
Cancel,
Yes,
No,
Quit,
None,
Error,
};
/// The default style to apply to a message box.
constexpr Style kDefaultStyle = Style::Info;
/// The default buttons to provide on a message box.
constexpr Buttons kDefaultButtons = Buttons::OK;
/// Blocking call to create a modal message box with the given message, title, style, and buttons.
Selection Show(const char* message, const char* title, Style style, Buttons buttons);
/// Convenience function to call show() with the default buttons.
Selection Show(const char* message, const char* title, Style style);
/// Convenience function to call show() with the default style.
Selection Show(const char* message, const char* title, Buttons buttons);
/// Convenience function to call show() with the default style and buttons.
Selection Show(const char* message, const char* title);
} // namespace Dialog
|