UTILITY::GUI::GUIMessageBox Class Reference

#include <GUIMessageBox.h>

Collaboration diagram for UTILITY::GUI::GUIMessageBox:

Collaboration graph
[legend]

List of all members.


Detailed Description

A class for displaying multiple lines of text in a message box to the user with the Allegro GUI.

Definition at line 30 of file GUIMessageBox.h.


Public Member Functions

 GUIMessageBox ()
 constructor
 GUIMessageBox (const char *message, const char *windowCaption="Message - ged101 GUI", const char *buttonCaption="OK")
 alternate constructor
 ~GUIMessageBox ()
 destructor
void Show (bool centered=true, int left=0, int top=0)
 displays the message box
void SetMessage (const char *message)
 sets the message text
void SetWindowCaption (const char *windowCaption="Message - ged101 GUI")
 sets the caption text of the message box window
void SetButtonCaption (const char *buttoncaption="OK")
 sets the caption text of the OK button on the message box

Private Member Functions

 GUIMessageBox (const GUIMessageBox &rhs)
 hidden copy constructor
const GUIMessageBoxoperator= (const GUIMessageBox &rhs)
 hidden assignment operator
void SplitMessage (const char *message)
 splits the into lines by the newline character and fills the vector
void InitDialog (bool centered, int left, int top)
 initializes the allegro structure

Private Attributes

std::vector< std::string > message_
 each line of the message box is held within this vector
std::string windowCaption_
 the caption text of the message box window
std::string buttonCaption_
 the caption text of the message box OK button
unsigned int buttonIndex_
 the message box button index -- this lets us focus the button on display
DIALOG * dialog_
 the allegro dialog structure that holds all the gui info
bool init_
 is the dialog initialized? we recreate the dialog if we make a change to it.

Constructor & Destructor Documentation

UTILITY::GUI::GUIMessageBox::GUIMessageBox (  ) 

constructor

Definition at line 33 of file GUIMessageBox.cpp.

UTILITY::GUI::GUIMessageBox::GUIMessageBox ( const char *  message,
const char *  windowCaption = "Message - ged101 GUI",
const char *  buttonCaption = "OK" 
)

alternate constructor

Definition at line 42 of file GUIMessageBox.cpp.

References buttonCaption_, SplitMessage(), and windowCaption_.

Here is the call graph for this function:

UTILITY::GUI::GUIMessageBox::~GUIMessageBox (  ) 

destructor

Definition at line 54 of file GUIMessageBox.cpp.

References dialog_, and message_.

UTILITY::GUI::GUIMessageBox::GUIMessageBox ( const GUIMessageBox rhs  )  [private]

hidden copy constructor


Member Function Documentation

void UTILITY::GUI::GUIMessageBox::Show ( bool  centered = true,
int  left = 0,
int  top = 0 
)

displays the message box

Definition at line 187 of file GUIMessageBox.cpp.

References buttonIndex_, dialog_, init_, and InitDialog().

Here is the call graph for this function:

void UTILITY::GUI::GUIMessageBox::SetMessage ( const char *  message  ) 

sets the message text

Definition at line 201 of file GUIMessageBox.cpp.

References init_, and SplitMessage().

Here is the call graph for this function:

void UTILITY::GUI::GUIMessageBox::SetWindowCaption ( const char *  windowCaption = "Message - ged101 GUI"  ) 

sets the caption text of the message box window

Definition at line 209 of file GUIMessageBox.cpp.

References init_, and windowCaption_.

void UTILITY::GUI::GUIMessageBox::SetButtonCaption ( const char *  buttoncaption = "OK"  ) 

sets the caption text of the OK button on the message box

Definition at line 217 of file GUIMessageBox.cpp.

References buttonCaption_, and init_.

const GUIMessageBox& UTILITY::GUI::GUIMessageBox::operator= ( const GUIMessageBox rhs  )  [private]

hidden assignment operator

void UTILITY::GUI::GUIMessageBox::SplitMessage ( const char *  message  )  [private]

splits the into lines by the newline character and fills the vector

Definition at line 225 of file GUIMessageBox.cpp.

References message_.

Referenced by GUIMessageBox(), and SetMessage().

Here is the caller graph for this function:

void UTILITY::GUI::GUIMessageBox::InitDialog ( bool  centered,
int  left,
int  top 
) [private]

initializes the allegro structure

Definition at line 65 of file GUIMessageBox.cpp.

References buttonCaption_, buttonIndex_, dialog_, init_, message_, and windowCaption_.

Referenced by Show().

Here is the caller graph for this function:


Member Data Documentation

std::vector<std::string> UTILITY::GUI::GUIMessageBox::message_ [private]

each line of the message box is held within this vector

Definition at line 69 of file GUIMessageBox.h.

Referenced by InitDialog(), SplitMessage(), and ~GUIMessageBox().

the caption text of the message box window

Definition at line 72 of file GUIMessageBox.h.

Referenced by GUIMessageBox(), InitDialog(), and SetWindowCaption().

the caption text of the message box OK button

Definition at line 75 of file GUIMessageBox.h.

Referenced by GUIMessageBox(), InitDialog(), and SetButtonCaption().

the message box button index -- this lets us focus the button on display

Definition at line 78 of file GUIMessageBox.h.

Referenced by InitDialog(), and Show().

the allegro dialog structure that holds all the gui info

Definition at line 81 of file GUIMessageBox.h.

Referenced by InitDialog(), Show(), and ~GUIMessageBox().

is the dialog initialized? we recreate the dialog if we make a change to it.

Definition at line 84 of file GUIMessageBox.h.

Referenced by InitDialog(), SetButtonCaption(), SetMessage(), SetWindowCaption(), and Show().


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

Generated on Tue Mar 3 20:11:41 2009 for ged101minimal by  doxygen 1.5.5