Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ModalDialog Class Reference

#include <modaldialog.h>

Inheritance diagram for ModalDialog:
WindowController QuestionDialog AlertDialog ListQuestionDialog YesNoDialog UpgradeOperationMountDialog

Public Member Functions

virtual void setCallback (ModalDialogCallback *cb, const std::string &id)
 
virtual void init (void)
 
virtual void run (void)
 
virtual bool processWindowCommand (const EventCommandId &command, Control *control)
 
void modalFinished (void)
 
 ModalDialog ()
 
virtual ~ModalDialog (void)
 
- Public Member Functions inherited from WindowController
virtual void draw (void)
 
virtual Windowwindow (void)
 
virtual void setWindow (Window *w)
 
 WindowController ()
 
virtual ~WindowController (void)
 

Protected Attributes

std::string m_callbackId
 
ModalDialogCallbackm_callback
 
int m_result
 
- Protected Attributes inherited from WindowController
Windowm_window
 
bool m_deleteOnWindowClose
 

Detailed Description

Definition at line 53 of file modaldialog.h.

Constructor & Destructor Documentation

ModalDialog::ModalDialog ( )

Definition at line 66 of file modaldialog.cpp.

66  : m_callbackId()
67  , m_callback( NULL )
68  , m_result( 0 )
69 {}
virtual ModalDialog::~ModalDialog ( void  )
inlinevirtual

Definition at line 72 of file modaldialog.h.

72 {}

Member Function Documentation

virtual void ModalDialog::init ( void  )
inlinevirtual

Implements WindowController.

Definition at line 60 of file modaldialog.h.

Referenced by QuestionDialog::init().

60 {}
void ModalDialog::modalFinished ( void  )

Definition at line 48 of file modaldialog.cpp.

References Window::close(), globalEventManager(), m_callback, m_callbackId, WindowController::m_deleteOnWindowClose, m_result, ModalDialogCallback::modalDialogResult(), EventManager::removeResponder(), and WindowController::window().

Referenced by ListQuestionDialog::processWindowCommand().

49 {
51  //One of our buttons was clicked. We're done.
52  m_deleteOnWindowClose = false; //Prevent deleting until we are done.
53  window()->close();
54  if (m_callback)
56  delete this;
57 }
bool ModalDialog::processWindowCommand ( const EventCommandId command,
Control control 
)
virtual

Reimplemented from WindowController.

Reimplemented in UpgradeOperationMountDialog, and ListQuestionDialog.

Definition at line 60 of file modaldialog.cpp.

References WindowController::processWindowCommand().

Referenced by ListQuestionDialog::processWindowCommand().

61 {
62  return WindowController::processWindowCommand( command, control );
63 }
void ModalDialog::run ( void  )
virtual

Reimplemented from WindowController.

Reimplemented in QuestionDialog.

Definition at line 41 of file modaldialog.cpp.

References WindowController::run(), EventResponder::setModal(), and WindowController::window().

Referenced by QuestionDialog::run().

42 {
43  if ( window() )
44  window()->setModal( true );
46 }
void ModalDialog::setCallback ( ModalDialogCallback cb,
const std::string &  id 
)
virtual

Member Data Documentation

ModalDialogCallback* ModalDialog::m_callback
protected

Definition at line 78 of file modaldialog.h.

Referenced by modalFinished(), and setCallback().

std::string ModalDialog::m_callbackId
protected

Definition at line 77 of file modaldialog.h.

Referenced by modalFinished(), and setCallback().

int ModalDialog::m_result
protected

Definition at line 79 of file modaldialog.h.

Referenced by modalFinished(), and ListQuestionDialog::processWindowCommand().


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