Rogue Wave Views |
Rogue Wave Views Documentation Home |
String entry dialog. More...
#include <ilviews/util/dialogs.h>
Public Member Functions | |
IlvPromptDialog (IlvSystemView parent, const char *message, IlUInt count=0, const char **strings=0) | |
Constructor. More... | |
~IlvPromptDialog () | |
Destructor. More... | |
void | setString (const char *string) |
Sets the user choice to a string. More... | |
void | setStrings (IlUInt count, const char **strings) |
Sets the user choice to a list of strings. More... | |
void | setTitle (const char *title) |
Sets the dialog's title. More... | |
const char * | show () |
Displays the dialog. More... | |
const char * | show (IlvPos x, IlvPos y) |
Displays the dialog at a given location. More... | |
String entry dialog.
Library: xviews or winviews or mviews (mutually exclusive)
This class builds a dialog box that asks the user to specify a string by typing it in a field or choosing from a list of valid values.
- An IlvPromptDialog
on a Windows platform -
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 a dialog box class based on Rogue Wave Views gadgets (IlvIPromptString
) that does not need the system toolkit, but that depends on the gadgets library of Rogue Wave Views.
IlvIPromptString
, IlvInformationDialog
, IlvQuestionDialog
, IlvIQuestionDialog
. IlvPromptDialog::IlvPromptDialog | ( | IlvSystemView | parent, |
const char * | message, | ||
IlUInt | count = 0 , |
||
const char ** | strings = 0 |
||
) |
Constructor.
Initializes a new IlvPromptDialog
with a predefined message and optionally a list of strings that specifies the domain of the valid answers. A standard Widget (to use the X Window terminology) is created.
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 entry field. |
count | The number of initial strings that are proposed to the end user. Note that if no string is provided, only the message will be displayed. |
strings | An array of count strings that are proposed to the user. This array and its contents are copied. |
IlvPromptDialog::~IlvPromptDialog | ( | ) |
Destructor.
The encapsulated widget is destroyed.
void IlvPromptDialog::setString | ( | const char * | string | ) |
Sets the user choice to a string.
string | The string that is presented to the user when the dialog box is displayed. This string is copied. |
void IlvPromptDialog::setStrings | ( | IlUInt | count, |
const char ** | strings | ||
) |
Sets the user choice to a list of strings.
The initial choice is set to the first string of the list.
count | The number of strings that are proposed. |
strings | The array of count strings that define the new domain of valid answers. |
void IlvPromptDialog::setTitle | ( | const char * | title | ) |
Sets the dialog's title.
The default title is "Text chooser"
. Use this method to change this to whatever you need.
title | The new title of this dialog. The string is copied. |
const char* IlvPromptDialog::show | ( | ) |
Displays the dialog.
Pops the dialog box on the screen, and waits until the user has chosen a string and pressed the OK or Cancel buttons.
0
if the user has pressed the Cancel button. The returned string must not be modified or deleted. Displays the dialog at a given location.
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. |
0
if the user has pressed the Cancel button. The returned string must not be modified or deleted. © Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.