com.esri.arcgis.framework
Interface IColorBrowser

All Superinterfaces:
Serializable
All Known Subinterfaces:
IColorSelector
All Known Implementing Classes:
ColorBrowser, ColorSelector

public interface IColorBrowser
extends Serializable

Provides access to members that control the Color Browser Dialog.

Remarks

Use the IColorBrowser interface to display the ColorBrowser dialog box.

Product Availability

Available with ArcGIS Desktop.


Method Summary
 boolean doModal(int hWnd)
          Show the browser.
 IColor getColor()
          Color edited by the browser.
 void setColor(IColor color)
          Color edited by the browser.
 

Method Detail

setColor

void setColor(IColor color)
              throws IOException,
                     AutomationException
Color edited by the browser.

Remarks

Set the Color property to an existing IColor object—the type of coclass you use will determine what options the dialog displays for editing the colors (see the pictures in the ColorBrowser topic).

The following code creates an intial color to show in the color browser, displays the color browser, and then sets a new color to the selected color in the color browser. You would get m_app from the hook in ICommand::OnCreate().

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
color - A reference to a com.esri.arcgis.display.IColor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getColor

IColor getColor()
                throws IOException,
                       AutomationException
Color edited by the browser.

Remarks

Set the Color property to an existing IColor object—the type of coclass you use will determine what options the dialog displays for editing the colors (see the pictures in the ColorBrowser topic).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Returns:
A reference to a com.esri.arcgis.display.IColor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

doModal

boolean doModal(int hWnd)
                throws IOException,
                       AutomationException
Show the browser.

Remarks

To display the dialog box, you should call the DoModal method. The method takes one parameter, a handle to the Application object of the ArcMap framework.

The DoModal method returns a Boolean—you should check the result to determine if the user intended to cancel the action (the result is False) or click OK (the result is True).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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