Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

YAPET::UI::MessageBox Class Reference

Displays a message in a window on the screen. More...

#include <messagebox.h>

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

List of all members.

Public Member Functions

 MessageBox (std::string t, std::string m) throw (UIException)
virtual void refresh () throw (UIException)
virtual void resize () throw (UIException)
virtual int run () throw (UIException)
virtual ~MessageBox ()

Protected Member Functions

int getBaseHeight () const
int getOkButtonLength () const
int getStartX () const
int getStartY () const
int getWidth () const

Private Types

enum  { BASE_HEIGHT = 6, BASE_WIDTH = 4 }

Private Member Functions

void createWindow () throw (UIException)

Private Attributes

std::string message
Buttonokbutton
std::string title
WINDOW * window

Detailed Description

Displays a message in a separate window on the screen. A button will be available to quit the message.

Line breaks in the message string are not handled at all. So try to avoid them.

Definition at line 60 of file messagebox.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
BASE_HEIGHT 
BASE_WIDTH 

Definition at line 62 of file messagebox.h.


Constructor & Destructor Documentation

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

Definition at line 46 of file messagebox.cc.

MessageBox::~MessageBox (  )  [virtual]

Definition at line 53 of file messagebox.cc.

References okbutton, and window.


Member Function Documentation

void MessageBox::createWindow (  )  throw (UIException) [private]

Definition at line 28 of file messagebox.cc.

References BASE_HEIGHT, getStartX(), getStartY(), getWidth(), okbutton, and window.

Referenced by resize().

Here is the call graph for this function:

Here is the caller graph for this function:

int YAPET::UI::MessageBox::getBaseHeight (  )  const [inline, protected]

Definition at line 75 of file messagebox.h.

Referenced by YAPET::UI::DialogBox::resize().

Here is the caller graph for this function:

int YAPET::UI::MessageBox::getOkButtonLength (  )  const [inline, protected]

Definition at line 91 of file messagebox.h.

References YAPET::UI::Button::getLength(), and okbutton.

Referenced by YAPET::UI::DialogBox::resize().

Here is the call graph for this function:

Here is the caller graph for this function:

int YAPET::UI::MessageBox::getStartX (  )  const [inline, protected]

Definition at line 83 of file messagebox.h.

References getWidth(), and YAPET::UI::BaseWindow::maxX().

Referenced by createWindow(), and YAPET::UI::DialogBox::resize().

Here is the call graph for this function:

Here is the caller graph for this function:

int YAPET::UI::MessageBox::getStartY (  )  const [inline, protected]

Definition at line 87 of file messagebox.h.

References BASE_HEIGHT, and YAPET::UI::BaseWindow::maxY().

Referenced by createWindow(), and YAPET::UI::DialogBox::resize().

Here is the call graph for this function:

Here is the caller graph for this function:

int YAPET::UI::MessageBox::getWidth (  )  const [inline, protected]

Definition at line 79 of file messagebox.h.

References BASE_WIDTH, and message.

Referenced by createWindow(), and getStartX().

Here is the caller graph for this function:

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

Implements YAPET::UI::BaseWindow.

Reimplemented in YAPET::UI::DialogBox.

Definition at line 84 of file messagebox.cc.

References box(), message, YAPET::UI::MESSAGEBOX, YAPET::UI::MESSAGEBOX_TITLE, okbutton, YAPET::UI::Button::refresh(), YAPET::UI::Colors::setcolor(), title, and window.

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements YAPET::UI::BaseWindow.

Reimplemented in YAPET::UI::DialogBox.

Definition at line 71 of file messagebox.cc.

References createWindow(), okbutton, and window.

Here is the call graph for this function:

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

Member Data Documentation

std::string YAPET::UI::MessageBox::message [private]

Definition at line 70 of file messagebox.h.

Referenced by getWidth(), and refresh().

Definition at line 67 of file messagebox.h.

Referenced by createWindow(), getOkButtonLength(), refresh(), resize(), run(), and ~MessageBox().

std::string YAPET::UI::MessageBox::title [private]

Definition at line 69 of file messagebox.h.

Referenced by refresh().

WINDOW* YAPET::UI::MessageBox::window [private]

Definition at line 66 of file messagebox.h.

Referenced by createWindow(), refresh(), resize(), and ~MessageBox().


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