com.esri.arcgis.framework
Interface IListDialog

All Superinterfaces:
Serializable
All Known Implementing Classes:
ListDialog

public interface IListDialog
extends Serializable

Provides access to members that work with a dialog for displaying a list.

Remarks

The list dialog is a dialog used to present a list of options and allows the user to select one of the options.

To get access to the IListDialog interface, create a new ListDialog object.

Product Availability

Available with ArcGIS Desktop.


Method Summary
 void addString(String choice)
          Adds a string to the list that the dialog will show.
 boolean doModal(String title, int initialChoice, int hWnd)
          Displays the list dialog and lets the user select a choice.
 int getChoice()
          The index of the string chosen (use after calling DoModal).
 

Method Detail

addString

void addString(String choice)
               throws IOException,
                      AutomationException
Adds a string to the list that the dialog will show. These strings will be sorted in alphabetical order.

Description

Choice is a string that will be used as an item in the list displayed by the dialog.

Remarks

The AddString method is used to populate the list that is displayed in the dialog. When the dialog is displayed, the items in the list are sorted in alphabetical order.

The following code shows a list in the dialog and then reports the string associated with the selected item. You would get m_app from the hook in ICommand::OnCreate().

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
choice - The choice (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getChoice

int getChoice()
              throws IOException,
                     AutomationException
The index of the string chosen (use after calling DoModal). Strings are numbered starting at 0 in the order that they were added, not the order that they appear in the dialog.

Remarks

The Choice property returns the index of the selected item in the list. The items are numbered starting at 0 in the order that they were added, not the order that they appear in the dialog.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
The index
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

doModal

boolean doModal(String title,
                int initialChoice,
                int hWnd)
                throws IOException,
                       AutomationException
Displays the list dialog and lets the user select a choice. Returns false if the user hits the cancel button.

Description

Title is a string that specifies the title of the dialog.

initialChoice specifies the index of the item in the list that is initially selected when the dialog is shown. The items are numbered starting at 0 in the order that they were added to the list.

hWnd specifies the window handle of the parent window. In most cases this will be the hWnd of the application.

Remarks

The DoModal method returns False if the dialog was cancelled.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
title - The title (in)
initialChoice - The initialChoice (in)
hWnd - The hWnd (A COM typedef) (in)
Returns:
The pOK
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.