CGXProperties::AddColorProperty
int AddColorProperty(LPCTSTR pszName, COLORREF color = RGB(192,192,192));
int AddColorProperty(UINT nID, COLORREF color = RGB(192,192,192));
pszName
Specifies a name for the color property. This name will appear in the color list box in the CGXDisplayPropertiesDialog.
color
Specifies the initial color setting.
nID
A string resource id for the name of the color property.
Return Value
Returns a unique index for the color property. Use this index when you want to change the color with SetColor.
Remarks
Call this method to register a new color property in the property-object.
The method looks in its list of registered color properties to see if the specified name already exists. If yes, it return the index for the color; if not, it adds an entry and returns an index.
Example
This example illustrates how default color properties are registered:
// Colors
AddColorProperty(GX_IDS_COLOR_GRIDLINES, GetSysColor(COLOR_GRAYTEXT));
AddColorProperty(GX_IDS_COLOR_FIXEDLINES, GetSysColor(COLOR_ACTIVECAPTION));
AddColorProperty(GX_IDS_COLOR_TRACKINGLINE, RGB(255, 0, 0));
AddColorProperty(GX_IDS_COLOR_DRAGGINGLINE, RGB(255, 0, 0));
AddColorProperty(GX_IDS_COLOR_BACKGROUND, GetSysColor(COLOR_BTNFACE));
See Also
CGXProperties::GetColor CGXProperties::SetColor