|
|
Enhanced MessageBox Dialog.
Provides a message box with icons and up to four configurable buttons and internationalized button text.
Several static functions that perform common message box functions are also provided for convenience.
enum IconStyle {INFORMATION = 1, EXCLAMATION = 2, STOP = 4, QUESTION = 8 } |
Icon styles for message box customization. One of these should be passed in the type parameter of the message box constructor and static functions.
See also: KMsgBox
enum DefaultButton {DB_FIRST = 16, DB_SECOND = 32, DB_THIRD = 64, DB_FOURTH = 128} |
Possible options for the default button. The first button is set to the default if no button is explicitly selected.
See also: KMsgBox
KMsgBox ( QWidget *parent = 0, const char *caption = 0, const char *message = 0, int type = INFORMATION, const char *b1text = 0, const char *b2text = 0, const char *b3text = 0, const char *b4text = 0) |
The generic constructor for a KMsgBox widget.
Parameters:
parent | Parent widget |
caption | Message box title |
message | Message string, center aligned by default. May contain newlines. |
type | Selects message box options. This value is a constant from ::DefaultButton and/or a constant from ::IconStyle or-ed together. |
b1text | .. Button captions. Up to four may be specified, only specified buttons will be displayed. |
See also: DefaultButton, IconStyle
~KMsgBox () |
Destructor.
int yesNo ( QWidget *parent = 0, const char *caption = 0, const char *message = 0, int type = 0, const char *yes = 0, const char *no = 0) |
Displays a modal yes/no message box. The icon is set to a question mark.
Parameters:
parent | the parent widget |
caption | the message box title |
message | the message in the dialog (eg the question the user is to be asked) |
type | Selects message box options. This value is a constant from ::DefaultButton and/or a constant from ::IconStyle or-ed together. |
yes | the text for the "Yes" button. defaults to "Yes", or its translation in the current user's locale if available. |
no | the text for the "No" button. defaults to "No", or its translation in the current user's locale if available. |
Returns: 1 if yes is clicked, 2 otherwise.
int yesNoCancel ( QWidget *parent = 0, const char *caption = 0, const char *message = 0, int type = 0, const char *yes = 0, const char *no = 0, const char *cancel = 0) |
Displays a modal yes/no/cancel message box. The icon is set to a question mark.
Parameters:
parent | the parent widget |
caption | the message box title |
message | the message in the dialog (eg the question the user is to be asked) |
type | Selects message box options. This value is a constant from ::DefaultButton and/or a constant from ::IconStyle or-ed together. |
yes | the text for the "Yes" button. defaults to "Yes", or its translation in the current user's locale if available. |
no | the text for the "No" button. defaults to "No", or its translation in the current user's locale if available. |
cancel | the text for the "Cancel" button. defaults to "Cancel", or its translation in the current user's locale if available. |
Returns: 1, 2 or 3 if yes, no or cancel are clicked respectively.
int message ( QWidget *parent = 0, const char *caption = 0, const char *message = 0, int type = 0, const char *btext = 0) |
Displays a modal message box with one button. An "Information" icon is displayed.
Parameters:
parent | the parent widget |
caption | the message box title |
message | the message in the dialog (eg the question the user is to be asked) |
type | Selects message box options. This value is a constant from ::DefaultButton and/or a constant from ::IconStyle or-ed together. |
btext | the text for the "OK" button. defaults to "Ok", or its translation in the current user's locale if available. |
Returns: 1 if the Ok button is clicked