Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Classes | Macros | Enumerations
Message Box

Description

Message box widget and functions.

Collaboration diagram for Message Box:

Classes

class  CMessageBox
 Message box widget. More...
 

Macros

#define MSGBOX_DEFAULT_FONT   FontGet (fntNormal, 24)
 Default font for message box contents.
 
#define MSGBOX_TITLE_FONT   FontGet (fntBold, 32)
 Title font for message boxes.
 
#define MSGBOX_COLOR   DARK_GREY
 Default color for message boxes.
 
#define MSGBOX_SPACE_X   32
 Horizontal space around message box contents.
 
#define MSGBOX_SPACE_Y   32
 Vertical space around message box contents and between the title and contents.
 
#define MSGBOX_BUTTON_MINWIDTH   160
 Minimum width of message box buttons.
 
#define mbmCancel   ((int) (1 << mbiCancel))
 Bit mask to select a "Cancel" button.
 
#define mbmOk   ((int) (1 << mbiOk))
 Bit mask to select an "OK" button.
 
#define mbmNo   ((int) (1 << mbiNo))
 Bit mask to select an "No" button.
 
#define mbmYes   ((int) (1 << mbiYes))
 Bit mask to select an "Yes" button.
 
#define mbmOkCancel   (mbmOk | mbmCancel)
 Bit mask for the "OK / Cancel" combination.
 
#define mbmYesNoCancel   (mbmYes | mbmNo | mbmCancel)
 Bit mask for the "Yes / No / Cancel" combination.
 
#define mbmNone   ((int) 0)
 Bit mask for no button.
 

Enumerations

enum  EMessageButtonId
 IDs for standard buttons.
 

Running a message box with a single function call ...

int RunMessageBox (const char *title, const char *text, int buttonMask=mbmOk, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an arbitray message box.
 
int RunInfoBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunInfoBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an info box with an "OK" button.
 
int RunWarnBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunWarnBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an warning box with an "OK" button.
 
int RunErrorBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunErrorBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an error box with an "OK" button.
 
int RunSureBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunSureBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run an "Are you sure?" box. Returns 1 if sure and <= 0 otherwise.
 
int RunQueryBox (const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 
int RunQueryBox (const char *title, const char *text, SDL_Surface *icon=NULL, int hAlign=0, TTF_Font *font=NULL)
 Run a "Yes/No/Cancel" query box. Returns 2 on "yes", 1 on "no" and 0 otherwise.
 

Manually operated message boxes ...

(e.g. for "please wait..." popups)

CMessageBoxStartMessageBox (const char *title, const char *text, SDL_Surface *icon=NULL, int buttonMask=mbmOk, int hAlign=0, TTF_Font *font=NULL)
 
static void IterateMessageBox ()
 
static int GetMessageBoxStatus (CMessageBox *msgBox)
 
void StopMessageBox (CMessageBox *msgBox)