MessageDialog Class Reference

#include <messagedialog.h>

Inheritance diagram for MessageDialog:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MessageDialog (PG_Widget *parent, const PG_Rect &r, const std::string &windowtitle, const std::string &windowtext, const std::string &btn1text, const std::string &btn2text, PG_Label::TextAlign textalign=PG_Label::CENTER, const std::string &style="MessageBox", bool rememberCheckbox=false)
 Creates a PopUp with 2 Buttons.
 MessageDialog (PG_Widget *parent, const PG_Rect &r, const std::string &windowtitle, const std::string &windowtext, const std::string &btn1text, PG_Label::TextAlign textalign=PG_Label::CENTER, const std::string &style="MessageBox")
 Creates a PopUp with 1 Button.
 MessageDialog (PG_Widget *parent, const PG_Rect &r, const std::string &windowtitle, const std::string &windowtext, PG_Label::TextAlign textalign=PG_Label::CENTER, const std::string &style="MessageBox")
 Creates a PopUp without Buttons.
 ~MessageDialog ()
void LoadThemeStyle (const std::string &widgettype)
PG_Widget * getTextBox ()
void EnableDefaultKeys (bool enable)
void SetText (const std::string &text)
bool remberChoice ()

Protected Member Functions

virtual bool handleButton (PG_Button *button)
 Checks if button is pressed.
bool eventKeyDown (const SDL_KeyboardEvent *key)

Protected Attributes

PG_Button * my_btnok
PG_Button * my_btncancel
PG_CheckButton * checkbox

Detailed Description

Definition at line 33 of file messagedialog.h.


Constructor & Destructor Documentation

MessageDialog::MessageDialog ( PG_Widget *  parent,
const PG_Rect &  r,
const std::string &  windowtitle,
const std::string &  windowtext,
const std::string &  btn1text,
const std::string &  btn2text,
PG_Label::TextAlign  textalign = PG_Label::CENTER,
const std::string &  style = "MessageBox",
bool  rememberCheckbox = false 
)

Creates a PopUp with 2 Buttons.

Parameters:
parent Parent widget
r rectangle of PopUp
windowtitle Title of window
windowtext Text to appear in window
btn1text Text to appear in Button 1
btn2text Text to appear in Button 2
textalign Alignment for windowtext
style widgetstyle to use (default "MessageBox")
rememberCheckbox true if a "remember choice" checkbox shall be shown

Definition at line 33 of file messagedialog.cpp.

References checkbox, handleButton(), min(), my_btncancel, and my_btnok.

MessageDialog::MessageDialog ( PG_Widget *  parent,
const PG_Rect &  r,
const std::string &  windowtitle,
const std::string &  windowtext,
const std::string &  btn1text,
PG_Label::TextAlign  textalign = PG_Label::CENTER,
const std::string &  style = "MessageBox" 
)

Creates a PopUp with 1 Button.

Parameters:
parent Parent widget
r rectangle of PopUp
windowtitle Title of window
windowtext Text to appear in window
btn1text Text to appear in Button 1
textalign Alignment for windowtext
style widgetstyle to use (default "MessageBox")

Definition at line 76 of file messagedialog.cpp.

References handleButton(), min(), and my_btnok.

MessageDialog::MessageDialog ( PG_Widget *  parent,
const PG_Rect &  r,
const std::string &  windowtitle,
const std::string &  windowtext,
PG_Label::TextAlign  textalign = PG_Label::CENTER,
const std::string &  style = "MessageBox" 
)

Creates a PopUp without Buttons.

Parameters:
parent Parent widget
r rectangle of PopUp
windowtitle Title of window
windowtext Text to appear in window
textalign Alignment for windowtext
style widgetstyle to use (default "MessageBox")

Definition at line 91 of file messagedialog.cpp.

MessageDialog::~MessageDialog (  ) 

Definition at line 139 of file messagedialog.cpp.


Member Function Documentation

void MessageDialog::LoadThemeStyle ( const std::string &  widgettype  ) 

Definition at line 168 of file messagedialog.cpp.

References my_btncancel, and my_btnok.

PG_Widget * MessageDialog::getTextBox (  ) 

Definition at line 134 of file messagedialog.cpp.

Referenced by new_choice_dlg().

void MessageDialog::EnableDefaultKeys ( bool  enable  ) 

Definition at line 129 of file messagedialog.cpp.

Referenced by new_choice_dlg().

void MessageDialog::SetText ( const std::string &  text  ) 

Definition at line 162 of file messagedialog.cpp.

References TextRenderer::GetText(), and TextRenderer::SetText().

Referenced by PG_StatusWindowData::SetText().

bool MessageDialog::remberChoice (  ) 

Definition at line 99 of file messagedialog.cpp.

References checkbox.

Referenced by new_choice_dlg().

bool MessageDialog::handleButton ( PG_Button *  button  )  [protected, virtual]

Checks if button is pressed.

Parameters:
button pointer to PG_BUtton

Definition at line 179 of file messagedialog.cpp.

References ASC_PG_Dialog::quitModalLoop().

Referenced by MessageDialog().

bool MessageDialog::eventKeyDown ( const SDL_KeyboardEvent *  key  )  [protected, virtual]

Reimplemented from ASC_PG_Dialog.

Definition at line 108 of file messagedialog.cpp.

References ASC_PG_Dialog::quitModalLoop().


Member Data Documentation

PG_Button* MessageDialog::my_btnok [protected]

Definition at line 99 of file messagedialog.h.

Referenced by LoadThemeStyle(), and MessageDialog().

PG_Button* MessageDialog::my_btncancel [protected]

Definition at line 100 of file messagedialog.h.

Referenced by LoadThemeStyle(), and MessageDialog().

PG_CheckButton* MessageDialog::checkbox [protected]

Definition at line 102 of file messagedialog.h.

Referenced by MessageDialog(), and remberChoice().


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:47:03 2012 for Advanced Strategic Command by  doxygen 1.5.1