Color Chooser Item

The color chooser item may be placed on a dialog box with a specified width and height allowing the user to select one color form a palette of choices.


Item list specification

The DialogItemRsc field extent specifies the location, width and height of the color chooser.

The type field should be ColorChooser.

The ID determines the DItem_ColorChooserRsc instance to load.

The attributes field can be ON or OFF and optionally combined with HIDDEN. It will usually be ON.

The itemArg field is unused and should usually be set to 0.

The label field can override the label contained in the DItem_ColorChooserRsc instance.

The following is an example of a color chooser item list specification:

{{XC, YC, 34*XC, 34*XC}, ColorChooser, COLORCHOOSERID_ElementColor, ON, 0, "", ""}

Item resource specification

The color chooser item is defined in a resource file with the following structure:

typedef struct ditem_colorchooserrsc
ULong commandNumber;
ULong commandSource;
long synonymsId;
ULong helpInfo;
ULong helpSource;
long itemHookId;
long itemHookArg;
#if defined (resource)
char label[];
char accessStr[];
long labelLength;
char label[1];
#if defined (resource)
extendedAttributes, extendedIntAttributes, extendedWideAttributes;
#define ColorChooser RTYPE_ColorChooser

The DItem_ColorChooserRsc structure has the following unique fields. See CommonItemResourceFields for a description of any field not shown in this table.

Field Description
accessStr For a color chooser, accessStr specifies a variable used to determine the current color index.

The following is an example of a color chooser item resource:

DItem_ColorChooser COLORCHOOSERID_Color =

Item hook function messages

The following messages are sent to item hook functions that are attached to color chooser items:


ColorChooser item functions

Function Description
mdlDialog_colorPickerSetColorTable sets the color table for the color chooser item. It is applicable to both the ColorPicker and the ColorChooser dialog items.

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.