Generic UI Controllers: 7.1 Other Controllers: ColorSelectorClass

Up: GEOS SDK TechDocs | Up | Prev: 7 Other Controllers | Next: 7.2 GenPageControlClass

The ColorSelector controller provides all the UI necessary to allow the user to select a color, a draw mask, and a draw pattern. The color may be selected either as an index or an RGB value. The ColorSelector must be put on the GenApplication's GAGCNLT_SELF_LOAD_OPTIONS GCN list.

The ColorSelector has the following features:

  typedef WordFlags CSFeatures;
#define CSF_FILLED_LIST				0x10
#define CSF_INDEX				0x08
#define CSF_RGB				0x04
#define CSF_DRAW_MASK				0x02
#define CSF_PATTERN				0x01
#define CS_DEFAULT_FEATURES					(CSF_FILLED_LIST |
		CSF_INDEX | CSF_RGB | CSF_DRAW_MASK |
		CSF_PATTERN)

In addition, the ColorSelector has several instance fields, all shown below:

 @instance ColorQuad				CSI_color = {0, 0, 0, 0};
		/* currently selected color */
@instance byte				CSI_colorIndeterminate;
		/* true if color is indeterminate */
@instance SystemDrawMask CSI_drawMask = SDM_0;
		/* draw mask in use by the color */
@instance byte				CSI_drawMaskIndeterminate;
		/* true if mask is indeterminate */
@instance GraphicPattern CSI_pattern = {0, 0};
		/* pattern in use by the color */
@instance byte				CSI_patternIndeterminate;
		/* true if pattern indeterminate */
@instance ColorModifiedStates CSI_states = 0;
		/* indicates which aspects have changed:
		 * CMS_COLOR_CHANGED
		 * CMS_DRAW_MASK_CHANGED
		 * CMS_PATTERN_CHANGED */
@instance ColorToolboxPreferences CSI_toolboxPrefs
						= CTP_IS_POPUP;
		/* preferences for color selector:
		 * CTP_INDEX_ORIENTATION
		 * CTP_DRAW_MASK_ORIENTATION
		 * CTP_PATTERN_ORIENTATION
		 * CTP_IS_POPUP */
@vardata optr ATTR_COLOR_SELECTOR_DISABLE_OBJECT;
		/* when color selector is disabled, the
		 * object named will also be disabled */

Messages Sent Out by the ColorSelector

MSG_META_COLORED_OBJECT_SET_COLOR, MSG_META_COLORED_OBJECT_SET_DRAW_MASK, MSG_META_COLORED_OBJECT_SET_PATTERN

The ColorSelector sends out three messages to its data objects. These messages each serve to set a particular attribute of the object it currently controls (the target object). The target object must be able to handle these messages if it is to use the ColorSelector.

MSG_META_COLORED_OBJECT_SET_COLOR

void	MSG_META_COLORED_OBJECT_SET_COLOR(
        ColorQuad color);

This message notifies the controlled object that it should set its color to the passed value.

Source: ColorSelector object.

Destination: The current Target object.

Parameters: color The ColorQuad structure describing the color to be set.

Return: Nothing.

Interception: Must be intercepted by the controlled object if it is to work with the ColorSelector controller.

MSG_META_COLORED_OBJECT_SET_DRAW_MASK

void	MSG_META_COLORED_OBJECT_SET_DRAW_MASK(
        SystemDrawMask mask);

This message notifies the controlled object that it should set its draw mask to the passed value.

Source: ColorSelector object.

Destination: The current Target object.

Parameters: mask The SystemDrawMask to be set as the object's draw mask.

Return: Nothing.

Interception: Must be intercepted by the controlled object if it is to work with the ColorSelector controller.

MSG_META_COLORED_OBJECT_SET_PATTERN

void	MSG_META_COLORED_OBJECT_SET_PATTERN(
        GraphicPattern pattern);

This message notifies the controlled object that it should sets its draw pattern to that passed.

Source: ColorSelector object.

Destination: The current Target object.

Parameters: pattern The GraphicPattern to be set as the object's draw pattern.

Return: Nothing.

Interception: Must be intercepted by the controlled object if it is to work with the ColorSelector controller.

Messages Handled by ColorSelectorClass

MSG_COLOR_SELECTOR_GET_COLOR, MSG_COLOR_SELECTOR_SET_COLOR, MSG_COLOR_SELECTOR_GET_DRAW_MASK, MSG_COLOR_SELECTOR_SET_DRAW_MASK, MSG_COLOR_SELECTOR_GET_PATTERN, MSG_COLOR_SELECTOR_SET_PATTERN

The ColorSelector handles a number of messages including the normal GenControlClass messages it inherits. These messages allow the setting or retrieval of the instance data of the controller.

MSG_COLOR_SELECTOR_GET_COLOR

void	MSG_COLOR_SELECTOR_GET_COLOR(
        ColorQuad		*retVal);

This message retrieves the controller's CSI_color field.

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: retVal A pointer to an empty ColorQuad structure.

Return: The ColorQuad structure pointed to by retVal will be the color set in CSI_color .

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_SET_COLOR

void	MSG_COLOR_SELECTOR_SET_COLOR(
        ColorQuad color);

This message sets the color in CSI_color .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: color The ColorQuad structure representing the new color for the CSI_color field.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_GET_DRAW_MASK

SystemDrawMask MSG_COLOR_SELECTOR_GET_DRAW_MASK();

This message retrieves the draw mask set in CSI_drawMask .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: None.

Return: The SystemDrawMask set in CSI_drawMask .

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_SET_DRAW_MASK

void	MSG_COLOR_SELECTOR_SET_DRAW_MASK(
        SystemDrawMask mask);

This message sets the draw mask stored in CSI_drawMask .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: mask The new SystemDrawMask to be set into CSI_drawMask .

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_GET_PATTERN

GraphicPattern MSG_COLOR_SELECTOR_GET_PATTERN();

This message returns the pattern set in CSI_pattern .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: None.

Return: The GraphicPattern currently set in CSI_pattern .

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_SET_PATTERN

void	MSG_COLOR_SELECTOR_SET_PATTERN(
        GraphicPattern pattern);

This message sets the drawing pattern stored in CSI_pattern .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: pattern The GraphicPattern value to be set.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_UPDATE_COLOR

See colorC.goh

Update the current color in the toolbox and normal UI. This message is normally sent from within a MSG_GEN_CONTROL_UPDATE_UI handler.

Source: Unrestricted--sent in a MSG_GEN_CONTROL_UPDATE_UI handler.

Destination: Any ColorSelector object.

Parameters: A ColorQuad structure and an indeterminate flag.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_APPLY_COLOR

See colorC.goh

Makes the color selector send MSG_META_COLORED_OBJECT_SET_COLOR .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: A Color enumeration value.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_UPDATE_FILLED_STATUS

See colorC.goh

Makes the color selector update the draw mask and associated UI.

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: A SystemDrawMask , an indeterminate flag, and a tools update flag.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_GET_FILLED_MONIKER

See colorC.goh

Returns the VisMoniker that should be used to represent the "do draw" item in the color selector.

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: None.

Return: The optr of the VisMoniker chunk or NullOptr to use the default.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_GET_UNFILLED_MONIKER

See colorC.goh

Returns the VisMoniker that should be used to represent the "don't draw" item in the color selector.

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: None.

Return: The optr of the VisMoniker chunk or NullOptr to use the default.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_UPDATE_DRAW_MASK

See colorC.goh

Update the current draw mask in the toolbox and the UI. This is often sent from within a MSG_GEN_CONTROL_UPDATE_UI handler.

Source: Unrestricted--sent in a MSG_GEN_CONTROL_UPDATE_UI handler.

Destination: Any ColorSelector object.

Parameters: A SystemDrawMask value and an indeterminate flag.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_APPLY_DRAW_MASK

See colorC.goh

Generates MSG_META_COLORED_OBJECT_SET_DRAW_MASK .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: A SystemDrawMask value.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_UPDATE_PATTERN

See colorC.goh

Update the current pattern in the toolbox and the UI. This is often sent from within a MSG_GEN_CONTROL_UPDATE_UI handler.

Source: Unrestricted--sent in a MSG_GEN_CONTROL_UPDATE_UI handler.

Destination: Any ColorSelector object.

Parameters: A GraphicPattern value and an indeterminate flag.

Return: Nothing.

Interception: Generally not intercepted.

MSG_COLOR_SELECTOR_APPLY_PATTERN

See colorC.goh

Generates MSG_META_COLORED_OBJECT_SET_PATTERN .

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: A GraphicPattern value.

Return: Nothing.

Interception: Generally not intercepted.

MSG_CS_SET_FILLED_STATUS

See colorC.goh

Tells the controller to disable itself and set the mask to zero or to re-enable itself and set the mask to 100, based on the passed flag.

Source: Unrestricted.

Destination: Any ColorSelector object.

Parameters: A SysDrawMask value.

Return: Nothing.

Interception: Generally not intercepted.

MSG_CS_SET_CF_INDEX

See colorC.goh

Sent by the color list to set a color via an index.

Source: The color list.

Destination: Any ColorSelector object.

Parameters: See colorC.goh .

Return: Nothing.

Interception: Generally not intercepted.

MSG_CS_SET_CF_RGB_RED

See colorC.goh

Sent by the color list to set a color's red value.

Source: The color list.

Destination: Any ColorSelector object.

Parameters: see colorC.goh .

Return: Nothing.

Interception: Generally not intercepted.

MSG_CS_SET_CF_RGB_GREEN

See colorC.goh

Sent by the color list to set a color's green value.

Source: The color list.

Destination: Any ColorSelector object.

Parameters: see colorC.goh .

Return: Nothing.

Interception: Generally not intercepted.

MSG_CS_SET_CF_RGB_BLUE

See colorC.goh

Sent by the color list to set a color's blue value.

Source: The color list.

Destination: Any ColorSelector object.

Parameters: see colorC.goh .

Return: Nothing.

Interception: Generally not intercepted.

MSG_CS_SET_DRAW_MASK

See colorC.goh

Sets the draw mask for the color selector.

MSG_CS_SET_PATTERN

See colorC.goh

Sets the pattern for the color selector .


Up: GEOS SDK TechDocs | Up | Prev: 7 Other Controllers | Next: 7.2 GenPageControlClass