Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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")
 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)
 Load a specific themestyle.
PG_WidgetgetTextBox ()
void EnableDefaultKeys (bool enable)

Protected Member Functions

virtual bool handleButton (PG_Button *button)
 Checks if button is pressed.
bool eventKeyDown (const SDL_KeyboardEvent *key)
 Overridable Eventhandler for a SDL_KeyboardEvent message.

Protected Attributes

PG_Buttonmy_btnok
PG_Buttonmy_btncancel

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"
 

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")

Definition at line 32 of file messagedialog.cpp.

References PG_Widget::activateHotkey(), handleButton(), PG_Rect::Height(), min(), my_btncancel, my_btnok, PG_Rect::PG_Rect(), PG_Widget::SetID(), PG_Button::sigClick, and PG_Rect::Width().

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 56 of file messagedialog.cpp.

References PG_Widget::activateHotkey(), handleButton(), PG_Rect::Height(), min(), my_btnok, PG_Rect::PG_Rect(), PG_Widget::SetID(), PG_Button::sigClick, and PG_Rect::Width().

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 71 of file messagedialog.cpp.

MessageDialog::~MessageDialog  ) 
 

Definition at line 109 of file messagedialog.cpp.


Member Function Documentation

void MessageDialog::EnableDefaultKeys bool  enable  ) 
 

Definition at line 99 of file messagedialog.cpp.

Referenced by new_choice_dlg().

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

Overridable Eventhandler for a SDL_KeyboardEvent message.

This handler is called when a key changed it's state from unpressed to pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
key SDL_KeyboardEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from ASC_PG_Dialog.

Definition at line 78 of file messagedialog.cpp.

References ASC_PG_Dialog::quitModalLoop().

PG_Widget * MessageDialog::getTextBox  ) 
 

Definition at line 104 of file messagedialog.cpp.

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 139 of file messagedialog.cpp.

References PG_Widget::GetID(), and ASC_PG_Dialog::quitModalLoop().

Referenced by MessageDialog().

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

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_Window.

Definition at line 128 of file messagedialog.cpp.

References PG_Button::LoadThemeStyle(), PG_Window::LoadThemeStyle(), my_btncancel, and my_btnok.


Member Data Documentation

PG_Button* MessageDialog::my_btncancel [protected]
 

Definition at line 90 of file messagedialog.h.

Referenced by LoadThemeStyle(), and MessageDialog().

PG_Button* MessageDialog::my_btnok [protected]
 

Definition at line 89 of file messagedialog.h.

Referenced by LoadThemeStyle(), and MessageDialog().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:18:20 2008 for Advanced Strategic Command by  doxygen 1.4.2