System Projects Reference > Situational Awareness System Projects > Situational Awareness Include Project > Theme_Control_GetColorIndex

Theme_Control_GetColorIndex

Returns the common control (button) color index for the specific button state. This is different from the header button. The normal state color is always light grey regardless of the theme selected.

Syntax

Theme_Control_GetColorIndex(INT nState)

nState

Indicates which state the UI element is in such that correct shade of the color is returned. This can be one of the following values:

CTRL_ITEM_STATE_Normal 0 Normal state - no mouse over
CTRL_ITEM_STATE_NormalHover 2 Mouse is hovering over control
CTRL_ITEM_STATE_NormalPressed 3 Mouse button pressed on control
CTRL_ITEM_STATE_Active 4 Item is in selected state
CTRL_ITEM_STATE_ActiveHover 5 Item is in selected and mouse is hovering
CTRL_ITEM_STATE_ActivePressed 6 Item is is selected and mouse button is down
CTRL_ITEM_STATE_Disabled 1 Item is disabled
CTRL_ITEM_STATE_ActiveDisabled 7 Item is in selected AND disabled state

Typically, this state will be returned by a function such as “Button_GetState”.

Return Value

Returns an index into the color array configured on the graphics object that called this function.

Example

Theme_Control_GetColorIndex(Button_GetState(DspGetAnCur()))

Related Functions

Published June 2018