YAPETUI::DialogBox Class Reference

Class for displaying a dialog box. More...

#include <dialogbox.h>

Inheritance diagram for YAPETUI::DialogBox:

YAPETUI::MessageBox YAPETUI::BaseWindow

List of all members.

Public Member Functions

 DialogBox (std::string t, std::string m) throw (UIException)
ANSWER getAnswer () const
 Returns the answer of the user.
virtual void refresh () throw (UIException)
virtual void resize () throw (UIException)
virtual int run () throw (UIException)
 Display and runs the dialog.
virtual ~DialogBox ()

Private Attributes

ANSWER answer
Buttoncancelbutton


Detailed Description

A dialog box presents the user a message and the buttons OK and Cancel.

It is displayed by calling run(). To find out which button was pressed, call getAnswer().

Definition at line 73 of file dialogbox.h.


Constructor & Destructor Documentation

DialogBox::DialogBox ( std::string  t,
std::string  m 
) throw (UIException)

Definition at line 24 of file dialogbox.cc.

DialogBox::~DialogBox (  )  [virtual]

Definition at line 33 of file dialogbox.cc.

References cancelbutton.


Member Function Documentation

ANSWER YAPETUI::DialogBox::getAnswer (  )  const [inline]

Returns the answer of the user.

Returns:
ANSWER_OK if the user pressed to OK button or ANSWER_CANCEL if the user pressed the Cancel button.

Definition at line 103 of file dialogbox.h.

References answer.

Referenced by MainWindow::changePassword(), MainWindow::deleteSelectedRecord(), MainWindow::openFile(), and MainWindow::quit().

void DialogBox::refresh (  )  throw (UIException) [virtual]

Reimplemented from YAPETUI::MessageBox.

Definition at line 74 of file dialogbox.cc.

References cancelbutton, YAPETUI::Button::refresh(), and refresh().

Referenced by run().

void DialogBox::resize (  )  throw (UIException) [virtual]

int DialogBox::run (  )  throw (UIException) [virtual]

Display and runs the dialog. To find out which button was pressed by the user, call getAnswer().

Returns:
the key the user pressed. In the current implementation this is always \n.

Reimplemented from YAPETUI::MessageBox.

Definition at line 38 of file dialogbox.cc.

References answer, YAPETUI::ANSWER_CANCEL, YAPETUI::ANSWER_OK, cancelbutton, YAPETUI::Button::focus(), refresh(), YAPETUI::BaseWindow::resizeAll(), and YAPETUI::MessageBox::run().

Referenced by MainWindow::changePassword(), MainWindow::deleteSelectedRecord(), MainWindow::openFile(), and MainWindow::quit().


Member Data Documentation

Definition at line 76 of file dialogbox.h.

Referenced by getAnswer(), and run().

Definition at line 75 of file dialogbox.h.

Referenced by refresh(), resize(), run(), and ~DialogBox().


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

Generated on Sun Jul 20 13:01:45 2008 for YAPET by  doxygen 1.5.6