Enigma
3.2.2
A Simple, Reliable and Efficient Encryption Tool
Loading...
Searching...
No Matches
MessageBox.hpp
Go to the documentation of this file.
1
#pragma once
2
#ifndef ENIGMA_MESSAGE_BOX_H
3
#define ENIGMA_MESSAGE_BOX_H
4
5
#include <
Core/Core.hpp
>
6
8
#if defined(ENIGMA_PLATFORM_WINDOWS)
9
#undef MessageBox
10
#undef ERROR
11
#undef IGNORE
12
#endif
13
14
NS_ENIGMA_BEGIN
15
16
class
MessageBox
{
17
public
:
/* Enums */
21
enum class
Icon
: std::uint8_t {
22
Info
= 0,
23
Warning
,
24
Error
,
25
Question
,
26
};
27
static
constexpr
std::string_view
Icon2Str
[4] = {
28
"info"
,
29
"warning"
,
30
"error"
,
31
"question"
};
35
enum class
Choice
: std::uint8_t {
36
Ok
= 0,
37
Ok_Cancel
,
38
Yes_No
,
39
Yes_No_Cancel
40
};
41
static
constexpr
std::string_view
Choice2Str
[4] = {
42
"ok"
,
43
"okcancel"
,
44
"yesno"
,
45
"yesnocancel"
};
46
50
enum class
Action
: std::int8_t {
51
Cancel
= 0,
52
No
=
Cancel
,
53
Ok
= 1,
54
Yes
=
Ok
55
};
56
57
public
:
/* Constructors / Destructor */
65
MessageBox
(
const
std::string& title,
const
std::string& message,
66
Icon
icon =
Icon::Info
,
67
Choice
choice =
Choice::Ok_Cancel
);
68
~MessageBox
() noexcept = default;
69
70
public:
/* Accessors */
74
[[nodiscard]]
MessageBox
::
Action
Show
() const;
75
76
private:
77
std::
string
m_title;
/*< MessageBox title */
78
std::
string
m_message;
/*< MessageBox message */
79
Icon
m_icon;
/*< MessageBox icon */
80
Choice
m_choice;
/*< MessageBox choice/button template */
81
};
82
83
NS_ENIGMA_END
84
85
#endif
// !ENIGMA_MESSAGE_BOX_H
Core.hpp
NS_ENIGMA_BEGIN
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition
Macros.hpp:13
NS_ENIGMA_END
#define NS_ENIGMA_END
Definition
Macros.hpp:14
MessageBox
Definition
MessageBox.hpp:16
MessageBox::Choice
Choice
Definition
MessageBox.hpp:35
MessageBox::Choice::Ok_Cancel
@ Ok_Cancel
MessageBox::Choice::Yes_No_Cancel
@ Yes_No_Cancel
MessageBox::Choice::Ok
@ Ok
MessageBox::Choice::Yes_No
@ Yes_No
MessageBox::Action
Action
Definition
MessageBox.hpp:50
MessageBox::Action::Yes
@ Yes
MessageBox::Action::No
@ No
MessageBox::Action::Cancel
@ Cancel
MessageBox::Choice2Str
static constexpr std::string_view Choice2Str[4]
Definition
MessageBox.hpp:41
MessageBox::Icon2Str
static constexpr std::string_view Icon2Str[4]
Definition
MessageBox.hpp:27
MessageBox::Icon
Icon
Definition
MessageBox.hpp:21
MessageBox::Icon::Warning
@ Warning
MessageBox::Icon::Info
@ Info
MessageBox::Icon::Error
@ Error
MessageBox::Icon::Question
@ Question
MessageBox::~MessageBox
~MessageBox() noexcept=default
MessageBox::Show
MessageBox::Action Show() const
MessageBox::MessageBox
MessageBox(const std::string &title, const std::string &message, Icon icon=Icon::Info, Choice choice=Choice::Ok_Cancel)
src
System
Dialogs
MessageBox.hpp
Generated on Sat Apr 12 2025 16:55:01 for Enigma by
1.9.8