Advanced Strategic Command
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MessageDialog Class Reference

#include <messagedialog.h>

Inheritance diagram for MessageDialog:
Inheritance graph
[legend]

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. More...
 
 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. More...
 
 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. More...
 
 ~MessageDialog ()
 
void LoadThemeStyle (const std::string &widgettype)
 
PG_Widget * getTextBox ()
 
void EnableDefaultKeys (bool enable)
 
void SetText (const std::string &text)
 
bool remberChoice ()
 
- Public Member Functions inherited from ASC_PG_Dialog
 ASC_PG_Dialog (PG_Widget *parent, const PG_Rect &r, const ASCString &windowtext, WindowFlags flags=DEFAULT, const ASCString &style="Window", int heightTitlebar=25)
 
PG_Button * AddStandardButton (const ASCString &name)
 
void StandardButtonDirection (StandardButtonDirectonType dir)
 
int RunModal ()
 

Protected Member Functions

virtual bool handleButton (PG_Button *button)
 Checks if button is pressed. More...
 
bool eventKeyDown (const SDL_KeyboardEvent *key)
 
- Protected Member Functions inherited from ASC_PG_Dialog
virtual bool closeWindow ()
 
bool quitModalLoopW (PG_Button *button, int value)
 
bool quitModalLoop (int value)
 

Protected Attributes

PG_Button * my_btnok
 
PG_Button * my_btncancel
 
PG_CheckButton * checkbox
 
- Protected Attributes inherited from ASC_PG_Dialog
PG_MessageObject * caller
 

Additional Inherited Members

- Public Types inherited from ASC_PG_Dialog
enum  StandardButtonDirectonType { Vertical, Horizontal }
 
- Static Public Member Functions inherited from ASC_PG_Dialog
static PG_Rect centerRectangle (const PG_Rect &rect)
 

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
parentParent widget
rrectangle of PopUp
windowtitleTitle of window
windowtextText to appear in window
btn1textText to appear in Button 1
btn2textText to appear in Button 2
textalignAlignment for windowtext
stylewidgetstyle to use (default "MessageBox")
rememberCheckboxtrue 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
parentParent widget
rrectangle of PopUp
windowtitleTitle of window
windowtextText to appear in window
btn1textText to appear in Button 1
textalignAlignment for windowtext
stylewidgetstyle 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
parentParent widget
rrectangle of PopUp
windowtitleTitle of window
windowtextText to appear in window
textalignAlignment for windowtext
stylewidgetstyle 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::EnableDefaultKeys ( bool  enable)

Definition at line 129 of file messagedialog.cpp.

Referenced by new_choice_dlg().

bool MessageDialog::eventKeyDown ( const SDL_KeyboardEvent *  key)
protectedvirtual

Reimplemented from ASC_PG_Dialog.

Definition at line 108 of file messagedialog.cpp.

References ASC_PG_Dialog::quitModalLoop().

PG_Widget * MessageDialog::getTextBox ( )

Definition at line 134 of file messagedialog.cpp.

Referenced by new_choice_dlg().

bool MessageDialog::handleButton ( PG_Button *  button)
protectedvirtual

Checks if button is pressed.

Parameters
buttonpointer to PG_BUtton

Definition at line 179 of file messagedialog.cpp.

References ASC_PG_Dialog::quitModalLoop().

Referenced by MessageDialog().

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

Definition at line 168 of file messagedialog.cpp.

References my_btncancel, and my_btnok.

bool MessageDialog::remberChoice ( )

Definition at line 99 of file messagedialog.cpp.

References checkbox.

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().

Member Data Documentation

PG_CheckButton* MessageDialog::checkbox
protected

Definition at line 102 of file messagedialog.h.

Referenced by MessageDialog(), and remberChoice().

PG_Button* MessageDialog::my_btncancel
protected

Definition at line 100 of file messagedialog.h.

Referenced by LoadThemeStyle(), and MessageDialog().

PG_Button* MessageDialog::my_btnok
protected

Definition at line 99 of file messagedialog.h.

Referenced by LoadThemeStyle(), and MessageDialog().


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