zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_messagebox.h File Reference
#include "SDL_stdinc.h"
#include "SDL_video.h"
#include "begin_code.h"
#include "close_code.h"

Go to the source code of this file.

Classes

struct  SDL_MessageBoxButtonData
 Individual button data. More...
 
struct  SDL_MessageBoxColor
 RGB value used in a message box color scheme. More...
 
struct  SDL_MessageBoxColorScheme
 A set of colors to use for message box dialogs. More...
 
struct  SDL_MessageBoxData
 MessageBox structure containing title, text, window, etc. More...
 

Enumerations

enum  SDL_MessageBoxButtonFlags { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 }
 Flags for SDL_MessageBoxButtonData. More...
 
enum  SDL_MessageBoxColorType {
  SDL_MESSAGEBOX_COLOR_BACKGROUND, SDL_MESSAGEBOX_COLOR_TEXT, SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
  SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, SDL_MESSAGEBOX_COLOR_MAX
}
 
enum  SDL_MessageBoxFlags { SDL_MESSAGEBOX_ERROR = 0x00000010, SDL_MESSAGEBOX_WARNING = 0x00000020, SDL_MESSAGEBOX_INFORMATION = 0x00000040 }
 SDL_MessageBox flags. If supported will display warning icon, etc. More...
 

Functions

DECLSPEC int SDLCALL SDL_ShowMessageBox (const SDL_MessageBoxData *messageboxdata, int *buttonid)
 Create a modal message box. More...
 
DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox (Uint32 flags, const char *title, const char *message, SDL_Window *window)
 Create a simple modal message box. More...
 

Enumeration Type Documentation

Flags for SDL_MessageBoxButtonData.

Enumerator
SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT 

Marks the default button when return is hit

SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT 

Marks the default button when escape is hit

Definition at line 47 of file SDL_messagebox.h.

Enumerator
SDL_MESSAGEBOX_COLOR_BACKGROUND 
SDL_MESSAGEBOX_COLOR_TEXT 
SDL_MESSAGEBOX_COLOR_BUTTON_BORDER 
SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND 
SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED 
SDL_MESSAGEBOX_COLOR_MAX 

Definition at line 71 of file SDL_messagebox.h.

SDL_MessageBox flags. If supported will display warning icon, etc.

Enumerator
SDL_MESSAGEBOX_ERROR 

error dialog

SDL_MESSAGEBOX_WARNING 

warning dialog

SDL_MESSAGEBOX_INFORMATION 

informational dialog

Definition at line 37 of file SDL_messagebox.h.

Function Documentation

DECLSPEC int SDLCALL SDL_ShowMessageBox ( const SDL_MessageBoxData messageboxdata,
int buttonid 
)

Create a modal message box.

Parameters
messageboxdataThe SDL_MessageBoxData structure with title, text, etc.
buttonidThe pointer to which user id of hit button should be copied.
Returns
-1 on error, otherwise 0 and buttonid contains user id of button hit or -1 if dialog was closed.
Note
This function should be called on the thread that created the parent window, or on the main thread if the messagebox has no parent. It will block execution of that thread until the user clicks a button or closes the messagebox.

Definition at line 3122 of file SDL_video.c.

References SDL_FALSE, SDL_GetRelativeMouseMode(), SDL_InvalidParamError, SDL_MessageboxValidForDriver(), SDL_SetError(), SDL_SetRelativeMouseMode(), SDL_ShowCursor(), SDL_SYSWM_COCOA, SDL_SYSWM_UIKIT, SDL_SYSWM_WINDOWS, SDL_SYSWM_X11, and SDL_VideoDevice::ShowMessageBox.

Referenced by SDL_PromptAssertion(), and SDL_ShowSimpleMessageBox().

DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox ( Uint32  flags,
const char *  title,
const char *  message,
SDL_Window window 
)

Create a simple modal message box.

Parameters
flagsSDL_MessageBoxFlags
titleUTF-8 title text
messageUTF-8 message text
windowThe parent window, or NULL for no parent
Returns
0 on success, -1 on error
See Also
SDL_ShowMessageBox

Definition at line 3185 of file SDL_video.c.

References SDL_MessageBoxData::buttons, SDL_MessageBoxButtonData::flags, SDL_MessageBoxData::flags, SDL_MessageBoxData::message, NULL, SDL_MessageBoxData::numbuttons, SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, SDL_ShowMessageBox(), SDL_zero, SDL_MessageBoxButtonData::text, SDL_MessageBoxData::title, and SDL_MessageBoxData::window.

Referenced by SDLTest_CommonEvent().