Relacs  0.9.8
Public Types | Public Member Functions | Static Public Member Functions | List of all members
MessageBox Class Reference

#include <messagebox.h>

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

Public Types

enum  MessageType { Information, Warning, Error }
 

Public Member Functions

 MessageBox (const string &caption, const string &message, MessageType type=Warning, bool blocking=false, QWidget *parent=0)
 
 ~MessageBox (void)
 
void exec (double timeout)
 

Static Public Member Functions

static MessageBoxinformation (const string &caption, const string &message, bool blocking=false, double timeout=0.0, QWidget *parent=0)
 
static MessageBoxinformation (const string &caption, const string &message, double timeout, QWidget *parent=0)
 
static MessageBoxinformation (const string &caption, const string &message, QWidget *parent=0)
 
static MessageBoxwarning (const string &caption, const string &message, bool blocking=false, double timeout=0.0, QWidget *parent=0)
 
static MessageBoxwarning (const string &caption, const string &message, double timeout, QWidget *parent=0)
 
static MessageBoxwarning (const string &caption, const string &message, QWidget *parent=0)
 
static MessageBoxerror (const string &caption, const string &message, bool blocking=false, double timeout=0.0, QWidget *parent=0)
 
static MessageBoxerror (const string &caption, const string &message, double timeout, QWidget *parent=0)
 
static MessageBoxerror (const string &caption, const string &message, QWidget *parent=0)
 

Detailed Description

Displays a message in a separate window.

Author
Jan Benda
Version
1.2 A MessageBox is a separate window which displays a message text, an icon specifying the type of the message (see MessageType), and a button labeled 'Ok'. Pressing the button closes the message window. The message window can be blocking or non-blocking. If it is blocking, executing the widget waits until the user pressed the 'Ok' button before it returns. In non-blocking mode it returns immediately.

The static functions information(), warning(), and error() create and execute a message window. They also allow to specify a time after which the message window is closed automatically.

Member Enumeration Documentation

The type of message to be displayed.

Enumerator
Information 

The message is just an information.

Warning 

The message is a warning, reporting some sort of non-fatal error.

Error 

The message reports a fatal error. Usually the program is terminated after closing the message box.

Constructor & Destructor Documentation

MessageBox ( const string &  caption,
const string &  message,
MessageType  type = Warning,
bool  blocking = false,
QWidget *  parent = 0 
)

Creates a new window with caption in the title bar displaying the message message and an icon specifying the type of the message type. The window can be blocking or non-blocking according to blocking.

See Also
information(), warning(), error()

References MessageBox::Error, MessageBox::Information, and MessageBox::Warning.

Referenced by MessageBox::error(), MessageBox::information(), and MessageBox::warning().

~MessageBox ( void  )

Destroys a message box.

Member Function Documentation

void exec ( double  timeout)

Opens the message box window. If the message box is blocking, exec() blocks until the dialog is finished. Otherwise exec() returns immediately.

Parameters
[in]timeoutthe dialog is automatically closed after timeout seconds

Referenced by MessageBox::error(), MessageBox::information(), and MessageBox::warning().

MessageBox * information ( const string &  caption,
const string &  message,
bool  blocking = false,
double  timeout = 0.0,
QWidget *  parent = 0 
)
static

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type information. Calling this function can be blocking or non-blocking according to blocking. In blocking mode the function returns after the user pressed the 'Ok' button. A time timeout seconds can be specified after which the window is closed automatically. This feature works only with a non-blocking message.

Note
This function must not be called from a non GUI thread!
See Also
warning(), error()

References MessageBox::exec(), MessageBox::Information, and MessageBox::MessageBox().

Referenced by RELACSWidget::about(), RELACSPlugin::customEvent(), and MacroCommand::execute().

static MessageBox* information ( const string &  caption,
const string &  message,
double  timeout,
QWidget *  parent = 0 
)
inlinestatic

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type information. After time timeout seconds the window is closed automatically. This function is non-blocking, i.e. it returns immediately.

Note
This function must not be called from a non GUI thread!
See Also
warning(), error()
static MessageBox* information ( const string &  caption,
const string &  message,
QWidget *  parent = 0 
)
inlinestatic

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type information. This function is blocking, i.e. it returns after the user pressed the 'Ok' button.

Note
This function must not be called from a non GUI thread!
See Also
warning(), error()
MessageBox * warning ( const string &  caption,
const string &  message,
bool  blocking = false,
double  timeout = 0.0,
QWidget *  parent = 0 
)
static

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type warning, which is an error which does not prevent the program from continuing. Calling this function can be blocking or non-blocking according to blocking. In blocking mode the function returns after the user pressed the 'Ok' button. A time timeout seconds can be specified after which the window is closed automatically. This feature works only with a non-blocking message.

Note
This function must not be called from a non GUI thread!
See Also
information(), error()

References MessageBox::exec(), MessageBox::MessageBox(), and MessageBox::Warning.

Referenced by ControlTabs::createControls(), RELACSWidget::customEvent(), RELACSPlugin::customEvent(), RELACSWidget::RELACSWidget(), ReProData::reload(), RePros::RePros(), RELACSWidget::startFirstAcquisition(), and Macros::warning().

static MessageBox* warning ( const string &  caption,
const string &  message,
double  timeout,
QWidget *  parent = 0 
)
inlinestatic

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type warning, which is an error which does not prevent the program from continuing. After time timeout seconds the window is closed automatically. This function is non-blocking, i.e. it returns immediately.

Note
This function must not be called from a non GUI thread!
See Also
information(), error()
static MessageBox* warning ( const string &  caption,
const string &  message,
QWidget *  parent = 0 
)
inlinestatic

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type warning, which is an error which does not prevent the program from continuing. This function is blocking, i.e. it returns after the user pressed the 'Ok' button.

Note
This function must not be called from a non GUI thread!
See Also
information(), error()
MessageBox * error ( const string &  caption,
const string &  message,
bool  blocking = false,
double  timeout = 0.0,
QWidget *  parent = 0 
)
static

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type error. Usually the program or action has to be terminated after displaying this message. Calling this function can be blocking or non-blocking according to blocking. In blocking mode the function returns after the user pressed the 'Ok' button. A time timeout seconds can be specified after which the window is closed automatically. This feature works only with a non-blocking message.

Note
This function must not be called from a non GUI thread!
See Also
information(), warning()

References MessageBox::Error, MessageBox::exec(), and MessageBox::MessageBox().

Referenced by RELACSWidget::RELACSWidget(), and RELACSWidget::startFirstAcquisition().

static MessageBox* error ( const string &  caption,
const string &  message,
double  timeout,
QWidget *  parent = 0 
)
inlinestatic

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type error. Usually the program or action has to be terminated after displaying this message. After time timeout seconds the window is closed automatically. This function is non-blocking, i.e. it returns immediately.

Note
This function must not be called from a non GUI thread!
See Also
information(), warning()
static MessageBox* error ( const string &  caption,
const string &  message,
QWidget *  parent = 0 
)
inlinestatic

Creates and executes a message window with caption in the title bar displaying the message message. The message is of type error. Usually the program or action has to be terminated after displaying this message. This function is blocking, i.e. it returns after the user pressed the 'Ok' button.

Note
This function must not be called from a non GUI thread!
See Also
information(), warning()

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