com.esri.arcgis.framework
Interface IColorPalette

All Superinterfaces:
Serializable
All Known Implementing Classes:
ColorPalette

public interface IColorPalette
extends Serializable

Provides access to members that control the Color Palette.

Description

The ColorPalette is a pop-up style dialog that allows a user to select a particular color interactively.

Remarks

The ColorPalette provides options to the user to show further color dialogs. Clicking the 'More Colors' option will display the ColorSelector dialog, which in turn allows the user to display the ColorBrowser dialog. In this way, the ColorPalette provides the developer with a simple way to allow the user to select from the full range of colors and color models available.

The following example shows how to display a ColorPalette with three simple colors. You would get m_app from the hook in ICommand::OnCreate().

When To Use

Use this interface to allow a user to select a color interactively.

Product Availability

Available with ArcGIS Desktop.


Method Summary
 IColor getColor()
          The Selected Color.
 boolean trackPopupMenu(tagRECT rect, IColor currentColor, boolean orientation, int hParentWnd)
          Show Color Palette.
 

Method Detail

trackPopupMenu

boolean trackPopupMenu(tagRECT rect,
                       IColor currentColor,
                       boolean orientation,
                       int hParentWnd)
                       throws IOException,
                              AutomationException
Show Color Palette.

Description

The TrackPopupMenu method displays the ColorPalette dialog on the screen.

Remarks

The TrackPopupMenu method controls the display of the palette with four parameters.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Parameters:
rect - A Structure: com.esri.arcgis.system.tagRECT (in)
currentColor - A reference to a com.esri.arcgis.display.IColor (in)
orientation - The orientation (in)
hParentWnd - The hParentWnd (A COM typedef) (in)
Returns:
The ok
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getColor

IColor getColor()
                throws IOException,
                       AutomationException
The Selected Color.

Description

The Color property of the IColorPalette interface returns the color selected during the TrackPopupMenu method.

Remarks

The Color property may return the IColor interface of either an RgbColor, HsvColor, HlsColor, CmykColor or GrayColor coclass.

If the user selects a specific color, the Color property will return that selected color. If the user selects the More Colors option and selects a color from the ColorSelector that is then displayed, the IColorPalette Color property will return that color.

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.
See Also:
IColorPalette.trackPopupMenu(com.esri.arcgis.system.tagRECT, com.esri.arcgis.display.IColor, boolean, int)