Enigma 3.2.2
A Simple, Reliable and Efficient Encryption Tool
Loading...
Searching...
No Matches
MessageBox Class Reference

#include <MessageBox.hpp>

Public Types

enum class  Icon : std::uint8_t { Info = 0 , Warning , Error , Question }
 
enum class  Choice : std::uint8_t { Ok = 0 , Ok_Cancel , Yes_No , Yes_No_Cancel }
 
enum class  Action : std::int8_t { Cancel = 0 , No = Cancel , Ok = 1 , Yes = Ok }
 

Public Member Functions

 MessageBox (const std::string &title, const std::string &message, Icon icon=Icon::Info, Choice choice=Choice::Ok_Cancel)
 
 ~MessageBox () noexcept=default
 
MessageBox::Action Show () const
 

Static Public Attributes

static constexpr std::string_view Icon2Str [4]
 
static constexpr std::string_view Choice2Str [4]
 

Detailed Description

Avoid mismatch with windows's MessageBox macro

Definition at line 16 of file MessageBox.hpp.

Member Enumeration Documentation

◆ Action

enum class MessageBox::Action : std::int8_t
strong

User Performed Action Result

Enumerator
Cancel 
No 
Ok 
Yes 

Definition at line 50 of file MessageBox.hpp.

◆ Choice

enum class MessageBox::Choice : std::uint8_t
strong

Message box button layout choices

Enumerator
Ok 
Ok_Cancel 
Yes_No 
Yes_No_Cancel 

Definition at line 35 of file MessageBox.hpp.

◆ Icon

enum class MessageBox::Icon : std::uint8_t
strong

Message box Icon type

Enumerator
Info 
Warning 
Error 
Question 

Definition at line 21 of file MessageBox.hpp.

Constructor & Destructor Documentation

◆ MessageBox()

MessageBox::MessageBox ( const std::string &  title,
const std::string &  message,
Icon  icon = Icon::Info,
Choice  choice = Choice::Ok_Cancel 
)

Constructor

Parameters
titletitle of the message box
messagedescription of the message box
iconIcon type of the message box Info, Warning, Error or Question
choicebuttons layout of the message box

◆ ~MessageBox()

MessageBox::~MessageBox ( )
defaultnoexcept

Member Function Documentation

◆ Show()

MessageBox::Action MessageBox::Show ( ) const

Spawns MessageBox and returns user Action

Member Data Documentation

◆ Choice2Str

constexpr std::string_view MessageBox::Choice2Str[4]
staticconstexpr
Initial value:
= {
"ok",
"okcancel",
"yesno",
"yesnocancel"}

Definition at line 41 of file MessageBox.hpp.

◆ Icon2Str

constexpr std::string_view MessageBox::Icon2Str[4]
staticconstexpr
Initial value:
= {
"info",
"warning",
"error",
"question"}

Definition at line 27 of file MessageBox.hpp.


The documentation for this class was generated from the following file: