System dialog box class. More...
#include <ilviews/util/dialogs.h>
Public Member Functions | |
IlvInformationDialog (IlvSystemView parent, const char *message, IlvDialogStyle style=IlvDialogStyleInformation, IlvDialogCallback ok=0, IlvDialogCallback cancel=0, IlAny userArg=0) | |
Initializes a new IlvInformationDialog instance. More... | |
~IlvInformationDialog () | |
Destructor. More... | |
void | hide () |
Hides the dialog from the screen. More... | |
void | setTitle (const char *title) |
Sets the dialog's title. More... | |
void | show (IlBoolean blocking=IlTrue) |
Displays the dialog. More... | |
void | show (IlvPos x, IlvPos y, IlBoolean blocking=IlTrue) |
Displays the dialog at a given position. More... | |
System dialog box class.
Library: xviews or winviews or mviews (mutually exclusive)
This class encapsulates a system dialog box to display questions, information, or warnings.
This class is dependent on the standard toolkit used in conjunction with Rogue Wave Views. It can be used only if you link your final application with the system toolkit supported by Rogue Wave Views (on Unix platforms, you must use the library libmviews
instead of libxviews
and link with the Motif library). If you do not want to use these libraries, you can use one of the dialog box classes (IlvIMessageDialog
, IlvIQuestionDialog
, IlvIInformationDialog
, IlvIErrorDialog
or IlvIWarner
); these classes are based on Rogue Wave Views gadgets only and do not depend on the system toolkit.
IlvPromptDialog
. IlvInformationDialog::IlvInformationDialog | ( | IlvSystemView | parent, |
const char * | message, | ||
IlvDialogStyle | style = IlvDialogStyleInformation , |
||
IlvDialogCallback | ok = 0 , |
||
IlvDialogCallback | cancel = 0 , |
||
IlAny | userArg = 0 |
||
) |
Initializes a new IlvInformationDialog
instance.
Two callbacks can be set to react to the answer of the user.
parent | The system view (that you usually get by calling the method IlvAbstractView::getSystemView of an existing view) for which this dialog is created. |
The dialog, when displayed, is transient for this view.
message | The message that is displayed next to the icon. |
style | The type of dialog that is created (see the different available styles in the documentation of the type IlvDialogStyle ). |
ok | The function that is called when the user chooses the OK button. This can be left unspecified or set to 0 if you do not need any specific callback. |
cancel | The function that is called when the user chooses the Cancel button. This can be left unspecified or set to 0 if you do not need any specific callback. |
userArg | A user-defined parameter that is sent to the ok and cancel callbacks. |
IlvInformationDialog::~IlvInformationDialog | ( | ) |
Destructor.
The encapsulated widget is destroyed.
void IlvInformationDialog::hide | ( | ) |
Hides the dialog from the screen.
The encapsulated system dialog box is not destroyed.
void IlvInformationDialog::setTitle | ( | const char * | title | ) |
Sets the dialog's title.
The default title is "IlogViews"
. Use this method to change it.
title | The new title of this dialog. The string is copied. |
Displays the dialog.
Pops the dialog box on the screen and waits until the user has pressed the OK or the Cancel button.
blocking | Can be set to IlFalse if you do not want this dialog to be blocking (that is, the call to show() returns immediately, without waiting for the user response). |
IlTrue
no matter what you specify. Displays the dialog at a given position.
This member function is similar to show()
, but you can specify the location of the dialog box.
x | The x coordinate, relative to the upper-left corner of the screen, where the dialogs appears. |
y | The y coordinate, relative to the upper-left corner of the screen, where the dialogs appears. |
blocking | Can be set to IlFalse if you do not want this dialog to be blocking (that is, the call to show() returns immediately, without waiting for the user response). |
IlTrue
no matter what you specify.