libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Types | Public Member Functions | Static Public Member Functions | List of all members
donut::events::MessageBox Class Reference

Utility class for simple message boxes to be delivered to the user through the host environment. More...

#include <donut/events/MessageBox.hpp>

Public Types

enum class  Type { ERROR_MESSAGE , WARNING_MESSAGE , INFO_MESSAGE }
 Type of message contained in a message box. More...
 

Public Member Functions

 MessageBox ()=delete
 Message box objects are not intended to be constructed directly. More...
 

Static Public Member Functions

static void show (Type type, const char *title, const char *message)
 Display a simple message box that blocks execution on the current thread until the user presses OK. More...
 

Detailed Description

Utility class for simple message boxes to be delivered to the user through the host environment.

Member Enumeration Documentation

◆ Type

Type of message contained in a message box.

Enumerator
ERROR_MESSAGE 

Indicates that an error occured.

WARNING_MESSAGE 

Warns the user about a potential error.

INFO_MESSAGE 

Provides general information.

Constructor & Destructor Documentation

◆ MessageBox()

donut::events::MessageBox::MessageBox ( )
delete

Message box objects are not intended to be constructed directly.

Member Function Documentation

◆ show()

static void donut::events::MessageBox::show ( Type  type,
const char *  title,
const char *  message 
)
static

Display a simple message box that blocks execution on the current thread until the user presses OK.

Parameters
typetype of message shown in the box. This may be reflected in the styling of the box.
titlenon-owning read-only pointer to a UTF-8 string containing the window title of the message box. Must not be nullptr.
messagenon-owning read-only pointer to a UTF-8 string containing the main message to show in the box. Must not be nullptr.
Exceptions
events::Erroron failure to show the message box.
std::bad_allocon allocation failure.
Examples
example_game.cpp.

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