rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvPromptDialog Class Reference

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...
 

Detailed Description

String entry dialog.

Library: display

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.

See Also
IlvIPromptString, IlvInformationDialog, IlvQuestionDialog, IlvIQuestionDialog.

Constructor & Destructor Documentation

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.

Parameters
parentThe 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.
messageThe message that is displayed next to the entry field.
countThe number of initial strings that are proposed to the end user. Note that if no string is provided, only the message will be displayed.
stringsAn 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.

Member Function Documentation

void IlvPromptDialog::setString ( const char *  string)

Sets the user choice to a string.

Parameters
stringThe 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.

Parameters
countThe number of strings that are proposed.
stringsThe 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.

Parameters
titleThe 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.

Returns
The string that was chosen, or 0 if the user has pressed the Cancel button. The returned string must not be modified or deleted.
const char* IlvPromptDialog::show ( IlvPos  x,
IlvPos  y 
)

Displays the dialog at a given location.

This member function is similar to show(), but you can specify the location of the dialog box.

Parameters
xThe x coordinate, relative to the upper-left corner of the screen, where the dialogs appears.
yThe y coordinate, relative to the upper-left corner of the screen, where the dialogs appears.
Returns
The string that was chosen, or 0 if the user has pressed the Cancel button. The returned string must not be modified or deleted.

© Copyright 2014, 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.