Public Member Functions | Private Attributes

YAPET::UI::DialogBox Class Reference

Class for displaying a dialog box. More...

#include <dialogbox.h>

Inheritance diagram for YAPET::UI::DialogBox:
Inheritance graph
[legend]
Collaboration diagram for YAPET::UI::DialogBox:
Collaboration graph
[legend]

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 75 of file dialogbox.h.


Constructor & Destructor Documentation

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

Definition at line 26 of file dialogbox.cc.

DialogBox::~DialogBox (  )  [virtual]

Definition at line 35 of file dialogbox.cc.

References cancelbutton.


Member Function Documentation

ANSWER YAPET::UI::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 105 of file dialogbox.h.

References answer.

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

Here is the caller graph for this function:

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

Reimplemented from YAPET::UI::MessageBox.

Definition at line 87 of file dialogbox.cc.

References cancelbutton, and YAPET::UI::Button::refresh().

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:

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 YAPET::UI::MessageBox.

Definition at line 40 of file dialogbox.cc.

References answer, cancelbutton, YAPET::UI::Button::focus(), KEY_ESC, refresh(), YAPET::UI::BaseWindow::resizeAll(), and YAPET::UI::MessageBox::run().

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

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 78 of file dialogbox.h.

Referenced by getAnswer(), and run().

Definition at line 77 of file dialogbox.h.

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


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