A class to display message boxes. More...
Public Types | |
enum | Button { NoButton = 0 , Ok = 0x00000400 , Save = 0x00002000 , SaveAll = 0x00001000 , Open = 0x00002000 , Yes = 0x00004000 , YesToAll = 0x00008000 , No = 0x00010000 , NoToAll = 0x00020000 , Abort = 0x00040000 , Retry = 0x00080000 , Ignore = 0x00100000 , Close = 0x00200000 , Cancel = 0x00400000 , Discard = 0x00800000 , Help = 0x01000000 , Apply = 0x02000000 , Reset = 0x04000000 , RestoreDefaults = 0x08000000 } |
Buttom identifiers. More... | |
enum | Icon { NoIcon = 0 , Information = 1 , Warning = 2 , Critical = 3 , Question = 4 } |
Icon identifiers. More... | |
enum | Result { Rejected = 0 , Accepted = 1 } |
Result codes. More... | |
Signals | |
void | accepted () |
This signal is emitted when the dialog has been accepted either by the user or by calling accept() or done() with the Accepted argument. | |
void | finished (Result aResult) |
This signal is emitted when the dialog's result code has been set, either by the user or by calling done(), accept(), or reject(). More... | |
void | rejected () |
This signal is emitted when the dialog has been rejected either by the user or by calling reject() or done() with the Rejected argument. | |
Public Member Functions | |
void | accept () |
Hides the modal dialog and sets the result code to Accepted. | |
void | done (Result aResult) |
Closes the dialog and sets its result code to aRetcode. More... | |
Result | exec () |
Shows the dialog as a modal dialog, blocking until the user closes it. More... | |
MessageBox (Widget aParent=0) | |
Constructor. More... | |
void | reject () |
Hides the modal dialog and sets the result code to Rejected. | |
void | show () |
Shows the dialog non-modal. | |
Static Public Member Functions | |
static Button | critical (Widget aParent, String aTitle, String aText, Buttons aButtons=Ok, Button aDefaultButton=Ok) |
Display a message box with error icon and sound. More... | |
static Button | information (Widget aParent, String aTitle, String aText, Buttons aButtons=Ok, Button aDefaultButton=Ok) |
Display a message box with information icon and sound. More... | |
static Button | question (Widget aParent, String aTitle, String aQuestion, Buttons aButtons=(Yes+No), Button aDefaultButton=No) |
Display a message box with question icon and sound. More... | |
static Button | warning (Widget aParent, String aTitle, String aText, Buttons aButtons=Ok, Button aDefaultButton=Ok) |
Display a message box with warning icon and sound. More... | |
Properties | |
String | detailedText |
This property holds the text to be displayed in the details area. More... | |
Icon | icon |
This property holds the message box's icon. More... | |
String | informativeText |
This property holds the informative text that provides a fuller description for the message. More... | |
Buttons | standardButtons |
This property holds collection of standard buttons in the message box. More... | |
String | text |
This property holds the message box text to be displayed. More... | |
A class to display message boxes.
The static functions information, warning, critical and question are available for convenient usage without creating an object.
Buttom identifiers.
Enumerator | |
---|---|
NoButton | No button at all. Used as default button parameter in the static methods to let the MessageBox decide itself which shall be the default button. |
Ok | OK button. |
Save | Save button. |
SaveAll | Save All button. |
Open | Open button. |
Yes | Yes button. |
YesToAll | Yes to All button. |
No | No button. |
NoToAll | No to all button. |
Abort | Abort button. |
Retry | Retry button. |
Ignore | Ignore button. |
Close | Close button. |
Cancel | Cancel button. |
Discard | Discard button. |
Help | Help button. |
Apply | Apply button. |
Reset | Reset button. |
RestoreDefaults | Restore Defaults button. |
bps::gui::MessageBox::MessageBox | ( | Widget | aParent = 0 | ) |
Constructor.
aParent | Parent widget, or 0 if no parent. |
|
static |
Display a message box with error icon and sound.
aParent | Parent widget, or 0 if there is no parent. |
aTitle | The text to display in the window title bar. |
aText | The message displayed within the message box. May be formatted with HTML. |
aButtons | Added codes of the buttons to display. |
aDefaultButton | What button is the default one. |
void bps::gui::MessageBox::done | ( | Result | aResult | ) |
Closes the dialog and sets its result code to aRetcode.
If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return aRetcode. If the dialog is the application's main widget, the application terminates.
aResult | Result code (Accepted, Rejected or Button) |
Result bps::gui::MessageBox::exec | ( | ) |
Shows the dialog as a modal dialog, blocking until the user closes it.
|
signal |
|
static |
Display a message box with information icon and sound.
aParent | Parent widget, or 0 if there is no parent. |
aTitle | The text to display in the window title bar. |
aText | The message displayed within the message box. May be formatted with HTML. |
aButtons | Added codes of the buttons to display. |
aDefaultButton | What button is the default one. |
|
static |
Display a message box with question icon and sound.
aParent | Parent widget, or 0 if there is no parent. |
aTitle | The text to display in the window title bar. |
aQuestion | The question displayed within the message box. May be formatted with HTML. |
aButtons | Added codes of the buttons to display. |
aDefaultButton | What button is the default one. |
|
static |
Display a message box with warning icon and sound.
aParent | Parent widget, or 0 if there is no parent. |
aTitle | The text to display in the window title bar. |
aText | The message displayed within the message box. May be formatted with HTML. |
aButtons | Added codes of the buttons to display. |
aDefaultButton | What button is the default one. |
|
readwrite |
This property holds the text to be displayed in the details area.
The text will be interpreted as a plain text. The default value of this property is an empty string.
|
readwrite |
This property holds the message box's icon.
|
readwrite |
This property holds the informative text that provides a fuller description for the message.
Infromative text can be used to expand upon the text() to give more information to the user. On the Mac, this text appears in small system font below the text(). On other platforms, it is simply appended to the existing text.
|
readwrite |
This property holds collection of standard buttons in the message box.
It controls which buttons are used by the message box.
|
readwrite |
This property holds the message box text to be displayed.
The text will be interpreted either as a plain text or as rich text.