TcxColorComboBoxItems Class
Holds the collection of items displayed by color combo box controls.
Declaration
TcxColorComboBoxItems = class(
TOwnedCollection
)
Remarks
The TcxColorComboBoxItems object holds two properties of the color combo box. These are the Properties.Items and Properties.MRUColors properties that provide access to the entire list of items within the control together with its most recently used list.
There are several ways to populate the combo box with items. The first is to add items manually. This can be done using the Object Inspector (at design time) or by calling the AddColor or InsertColor method of the TcxColorComboBoxItems object (at runtime). In such an instance, the color combo box will display the specified set of items. A second way is to leave the Properties.Items collection empty and set the editor’s Properties.NamingConvention property to a value other than cxncNone. In this instance, the color combo box will be populated with the set of items specified by the Properties.NamingConvention property. You can then customize the list at runtime using the TcxColorComboBoxItems
methods.
Set the editor’s Properties.AllowSelectColor property to True to allow end-users to add items to the color combo box from the color editor dialog. In this instance, the editor will display an ellipsis button, which when clicked, invokes this dialog. The color selected in either the dialog or drop-down list is added to the combo box (unless it is prohibited by handling the OnSelectCustomColor event). The most recently used list is populated automatically when end-users select items. However, you can still access this list programmatically and populate it with the desired colors or perform other actions that suit your specific needs.
The Assign method of the TcxColorComboBoxItems object can be used to copy the contents of one collection to another. This can be useful if you need to provide a common list of items (or common most recently used lists) for multiple controls.
TcxColorComboBoxItems collection items are represented by TcxColorComboBoxItem objects. Refer to this object’s description for details on item settings.