Contains classes, types, and routines used to implement the TComboBoxEx and TCheckComboBox visual components.

comboex.pas contains classes, types, and routines used to implement extended combo-box controls. The following components are added to the Lazarus IDE component palette:

Misc Tab

  • TComboBoxEx
  • TCheckComboBox
Enumerated type with values representing the autocomplete options used in TComboBoxEx.

TAutoCompleteOption is an enumerated type with values representing the autocomplete options used in TCustomComboBoxEx and TComboBoxEx. Values from the enumeration are stored in the TAutoCompleteOptions set type used to implement the AutoCompleteOptions property in TCustomComboBoxEx and TComboBoxEx. Including a value from the enumeration in the TAutoCompleteOptions set enables the corresponding feature.

Enables auto-suggest. Enables auto-appending items to the combo-box. Enables searching items for the current value in the edit control. Enables prefixes in the filter for the control. Enables Tab key navigation in the control. Enables toggling the visibility of the drop down using Up and Down cursor keys. Enables Right-to-Left text rendering (BiDi Mode) in the control. Sets type used to store TAutoCompleteOption values.

TAutoCompleteOptions is a set type used to store zero or more values from the TAutoCompleteOption enumeration. TAutoCompleteOptions is the type used to implement the AutoCompleteOptions property in TCustomComboBoxEx and TComboBoxEx. When an enumeration value is included in the set type, the corresponding feature enabled. When the value is excluded, the feature is disabled.

Enumerated type with values for display styles available in TCustomComboBoxEx.

TComboBoxExStyle is an enumerated type with values representing the display styles available in TCustomComboBoxEx. TComboBoxExStyle is the type used to implement the Style property in TCustomComboBoxEx and TComboBoxEx.

TComboBoxExStyle replaces the values used in the ancestor class; there is no need for the various owner-drawn styles from the ancestor control. The extended combo-box controls are always owner-drawn using the fixed style in its DrawItem method.

TCustomComboBox.Style
Drawn as a drop down control. Drawn as simple edit control. Drawn as a list which drops down when focused. Enumerated type with values which modify the behavior in TComboEx.

TComboBoxExStyleEx is an enumerated type with values which modify the behavior in TComboEx. Values from the enumeration are stored in the TComboBoxExStyles set type, and used in the StyleEx property in TCustomComboBoxEx and TComboBoxEx.

Not used in the current LCL implementation.
Enables case-sensitive comparisons in the control. Set type used to store TComboBoxExStyle enumeration values.

TComboBoxExStyles is a set type used to store values from the TComboBoxExStyle enumeration. TComboBoxExStyles is the type used to implement the StyleEx property in TCustomComboBoxEx.

Pointer type used to access the arbitrary data in TListControlItem.

TCustomData is a Pointer type used to implement the Data property in TListControlItem.

Specifies a function type used to compare items in TComboEx.

TListItemsCompare is an Integer function type used to implement a comparison between the items stored at the specified positions in AList. The return value contains the relative sort order for the compared values, for example:

-1
Aitem1 occurs before AItem2
0
AItem1 and AItem2 have the same values
1
AItem1 occurs after AItem2

TListItemsCompare implements the sort operation performed in TListControlItems when its CustomSort method is called.

Integer with the relative order for the compared values at the specified positions. Collection with the items compared in the routine. Ordinal position for the first item in the comparison. Ordinal position for the second item in the comparison. Alias to the TSortType in ComCtrls.pp TSortType Specifies an event handler signalled when a check box in TCustomCheckCombo is changed.

TCheckItemChange is an object procedure which specifies an event handler signalled when a check box in TCustomCheckCombo is changed. TCheckItemChange is the type used to implement the OnItemChange property in TCustomCheckCombo and TCheckComboBox.

Object for the event notification. Ordinal position for the changed check box.

Similar to TListItemsSortType, but implemented as an object function.

Implements a collection item added to a list control.

TListControlItem is a TCollectionItem descendant which implements the base type for list items used in TComboBoxEx. It is used as the ancestor for TComboExItem. TListControlItem is the type maintained in the TListControlItems collection.

TListControlItem provides properties needed to represent an item displayed in a list control, including:

  • Caption
  • Data
  • ImageIndex

Applications and libraries do no normally create instances of this class; use the TComboExItem descendant.

Sets the value for the Caption property. Value for the property. Sets the value for the ImageIndex property. New value for the property. Pointer to the data used in custom sort operations.

Data is a Pointer type used to access arbitrary data associated with the list item. The content stored in Data is dependent on the control which implements the list item.

Data is used in the Sort method in TListControlItems collection when its SortType is set to stData or stBoth.

Use the Caption property to maintain the textual value displayed for the list item.

Constructor for the class instance.

Create is the overridden constructor for the class instance. Create calls the inherited constructor using the value in ACollection as the owner for the collection item.

Create sets the default value for ImageIndex to -1 to indicate an index value has not been explicitly assigned.

Collection where the class instance is stored. Text displayed for the collection item.

Caption is a String property which contains the text displayed in the list control for the item. Changing the value for the property causes the Changed method to be called to update the list item in its owner collection.

Use DisplayName to access the value displayed at design-time in the Object Inspector.

TCollectionItem.DisplayName
Ordinal position for the image displayed for the collection item.

ImageIndex is an Integer property used to specify the ordinal position in an image list for the bitmap displayed for the list item. -1 (the default value for the property) indicates that an explicit value has not been assigned for the property, and no image should be displayed for the collection item.

Implements an extended item used in TComboEx.

TComboExItem is a TListControlItem descendant which implements an extended item used in TComboEx. TComboExItem extends the ancestor class to include the following properties for the extended item:

  • Indent
  • OverlayImageIndex
  • SelectedImageIndex

TComboExItem is the type maintained in the TComboExItems collection used to implement the ItemsEx property in TCustomComboBoxEx and TComboBoxEx.

Sets the value for the Indent property. New value for the property. Sets the value for the OverlayImageIndex property. New value for the property. Sets the value for the SelectedImageIndex property. New value for the property. Default caption used for a new item. Constructor for the class instance.

Create calls the inherited constructor, and sets the default values for properties in the class instance.

Collection which owns the collection item. Destructor for the class instance.

Destroy is the overridden destructor for the class instance.

Destroy ensures that the number of items in the Collection and the Owner for the collection are kept in sync. Normally, the value in Count is maintained when the Collection frees an item instance in its Delete method. Destroy handles the situation where the collection item is destroyed by calling the Free method in the collection item instead.

A component notification message is performed for the Collection to signal the delete operation. The Notify method in Collection is not called when Collection is unassigned or does not have an Owner, or when the Owner of the Collection is being freed.

Destroy calls the inherited destructor prior to exiting from the method.

TCollectionItem.Collection TCollection.Owner TCollection.Count TCollection.Delete TComponent.ComponentState
Space reserved between the Image and the caption for the item.

The default value for the property is -1 and indicates that indent spacing is not used for the Combo-Box item. The value is assigned when the AddItem method in TComboExItems is used to create the item using the parameter value passed to the method. Changing the value for the property causes the Changed method to be called to update the current item.

The value in Indent is used when the DrawItem method in TCustomComboBoxEx is called to render an extended item in the Combo-Box.

Ordinal position for the image drawn as an overlay for the Image in the combo-box item.

The default value for the property is -1, and indicates that an overlay image index has not been explicitly assigned for the item. The overlay image is not drawn when the property contains -1.

Changing the value for the property does not call the Changed method in the current LCL version. This may be different than the behavior from a previous LCL version.
Ordinal position for the image drawn when the item is selected in the Combo-Box. Container for the items added to a list control.

TListControlItems is a TOwnedCollection descendant which implements a container for items added to a list control. TListControlItems extends the ancestor class to provides case sensitivity when comparing Items in the collection, sort types, and custom sorting using an event handler.

TListControlItems is the ancestor for the TComboExItems collection class.

TOwnedCollection
Gets the value for the indexed Items property.

GetItems ensures that the collection Item is cast to the TListControlItem type used in TListControlItems.

Value for the property. Ordinal position in the collection for the requested item. Sets the value for the CaseSensitive property. New value for the property. Sets the value for the SortType property. New value for the property. Implements a comparison function for items in the collection.

CompareItems is an Integer function used to perform a comparison for items in the collection. AItem1 and AItem2 contains the list items compared in the method.

CompareItems uses the value in CaseSensitive to determine if the comparison of captions value uses case sensitivity. When CaseSensitive is True, caption values are converted to lowercase prior to performing the comparison.

CompareItems calls CompareStr to perform a comparison for the Captions assigned for the specified list items. The return value contains the relative sort order for the items calculated as a difference between the ASCII values for characters in the item captions. For example:

< 0
The caption in AItem1 comes before the caption in AItem2
0
The captions in AItem1 and Aitem2 are the same
> 0
The caption in AItem1 comes after the caption in AItem2

CompareItems is used in the implementation of the Sort method when SortType contains the value stText or stBoth.

Use the OnCompare event handler when SortType contains stData or stBoth.

CompareStr
Relative sort order for the compared items First list item for the comparison. Second list item for the comparison. Performs the comparison for the CustomSort method.

DoCustomSort is an Integer function which performs the comparison for the CustomSort method. Arguments passed to the method contain the TListControlItem instances compared in the method.

DoCustomSort calls the TListItemsCompare routine passed as an argument to the CustomSort method.

The return value contains the relative sort order for the items compared in the method. For example:

<0
Item1 comes before Item2 using the custom sort.
0
Item1 and Item2 have the same value in the custom sort.
>0
Item1 comes after Item2 in the custom sort.
Relative sort order for the compared items. First TListControlItem for the comparison. Second TListControlItem for the comparison. Signals the OnCompare event handler to compare items in the collection.

DoOnCompare is called from the Sort method when SortType is set to stData or stBoth.

Relative sort order for the compared items. First TListControlItem for the comparison. Second TListControlItem for the comparison. Performs a notification when an item in the collection has been changed.

Update is an overridden method in TListControlItems used to send a notification to observers when the value in AItem has been changed. Update calls the inherited method in TCollection.

TCollection TPersistent.FPONotifyObservers
Collection item for the update notification. Adds a new item to the collection.

Add is a TListControlItem function used to add a new item to the collection. Add reimplements the method defined in the TCollection ancestor class to return the TListControlItem type. The return value contains the TListControlItem instance created and stored in the collection. The current class instance is used as the owner for the collection item.

TCollection.Add
Item added to the collection. Performs a custom sort using the specified routine.

CustomSort is a procedure used to perform a custom sort for items in the collection using the specified TListItemsCompare routine to implement the comparison. When ACompare is assigned, it is temporarily stored in an internal member and the Sort method is called. No actions are performed in the method when ACompare has not been assigned (contains Nil).

Routine used to perform the comparison for the items in the collection. Performs the Sort routine required for the setting in SortType.

Sort is a procedure used to perform the sort routine indicated in SortType.

Provides indexed access to the list of items maintained in the collection.

Items is a read-only indexed TListControlItem property which provides access to the list of items maintained in the collection. TListControlItems reimplements the read access specifier to return the TListControlItem type required for the collection.

Use the Count property to determine the number of Items stored in the collection. Use the Add or Insert method to create a new item in the collection. Use Delete or Clear to remove one or all items in the collection.

Items is the default property for the collection, and the property examined by the TCollectionEnumerator returned by the GetEnumerator method.

TCollection.Items TCollection.Count TCollection.Add TCollection.Insert TCollection.Clear TCollection.Delete
Ordinal position for the item requested. Indicates if case sensitivity is used when comparing items in the collection.

CaseSensitive is a Boolean property which indicates if case sensitivity is used when comparing items in the collection. The value in CaseSensitive is used in the CompareItems method. When set to False, the captions for the compared Items are converted to lowercase prior to comparing their values.

Set SortType to stText to use case sensitive sorting for the Items in the collection.

Determines the comparison mechanism used for collection items in the Sort method.

SortType is a TListItemsSortType property which determines the comparison mechanism used for collection items in the Sort method. The default value for the property is stNone and indicates that no sorting is performed for Items in the collection. Changing the value for the property causes the Sort method to be called to apply the new order to the collection Items.

Event handler signalled to sort the collection using the data in the collection items.

OnCompare is a TListCompareEvent property with the event handler signalled to sort the collection using the arbitrary data stored in each collection item. Applications must implement and assign an object procedure using the signature in TListCompareEvent to allow responding to the event notification.

OnCompare is signalled in the DoOnCompare method. Set the value in SortType to stData to enable the event handler when the Sort method is called. Use the CustomSort method to sort the collection using a TListItemsCompare routine.

Implements a collection for the items added to TCustomComboBoxEx.

TComboExItems is a TListControlItems descendant which Implements a collection for the items added to TCustomComboBoxEx and TComboBoxEx. TComboExItems extends the ancestor class to use the TComboExItem type for items added to the collection. Reimplemented methods are provided to add, insert, and retrieve collection items using the ItemClass required for the collection. An AddItem method is introduced to create a new collection item and configure its property values. The Notify and Update methods are overridden to use the correct ItemClass as well.

TComboExItems is the type used to implement the ItemsEx property in TCustomComboBoxEx.

Gets the value for the indexed ComboItems property. Value for the property. Ordinal position for the item accessed in the method. Tracks the add or delete status for the collection. Performs component notifications when a collection item is added to or removed from the Collection. Collection item for the notification. Action for the notification. Updates the collection when the specified item has been changed. Forces the owner of the collection (the control) to be redrawn when needed. Collection item examined in the method. Adds a new item to the collection.

Add is a TComboExItem function used to add a new item to the collection. Add reimplements the method in TListControlItems to use the type required for the derived collection. The return value contains the TComboExItem instance allocated in the method. The current class instance is used as the Owner of the collection item. Add is used in the implementation of the AddItem method.

Use AddItem to create a new collection item with the values specified in the arguments to the method.

Item added to the collection. Adds a new item with the specified values to the collection.

AddItem is a TComboExItem function used to add a new item to the collection with the values specified in the parameters passed to the method. AddItem calls the Add method to create a new TComboExItem instance. The following properties are updated in the collection item to use the values specified in the arguments:

  • Caption
  • indent
  • ImageIndex
  • OverlayImageIndex
  • SelectedImageIndex
  • Data
Item added to the collection. Caption for the item. Image index for the item. Overlay image index for the item. Selected image index for the item. Indent spacing for the item. Pointer to the arbitrary data associated with the item. Inserts a collection item at the specified position in the collection.

Insert is a TComboExItem function used to insert a new collection item at the specified position in the collection. Insert reimplements the method in TCollection to create and return the TComboExItem type used in the derived collection. Inserts calls the inherited method, and casts the return value to a TComboExItem type.

TCollection.Insert
Collection item created and stored at the specified position. Ordinal position in the collection where the new item is inserted. Provides indexed access to the items in the collection.

ComboItems is a read-only indexed TComboExItem property used to provide access to the Items in the collection. The read access specifier for the property ensures that values in Items are cast to the TComboExItem type used in the derived collection.

ComboItems is the default property for the collection, and the subject visited in an enumerator for the class.

TCollection.GetEnumerator
Ordinal position for the collection item requested in the method. Implements the base class for an extended/enhanced combo-box.

TCustomComboBoxEx is a TCustomComboBox descendant which implements the base class for TComboBoxEx.

TCustomComboBoxEx provides an extended combo-box with added features and capabilities like auto completion, additional display styles, more editing options, and a list with Images used in the control. Another key feature in the class is an extended Items property which provides normal, selected, and overlay image indexes and allows indentation between the image and caption for items in the combo-box. A pointer to arbitrary data for Items used in sort operations is also provided.

TCustomComboBox
Sets the value for the Images property. New value for the property. Sets the value for the ImagesWidth property. New value for the property. Sets the value for the Style property. New value for the property. Sets the value for the StyleEx property. New value for the property. Default value for the AutoCompleteOptions property. Default value for the Style property. Internal flag which indicates if the text height needs to be calculated when drawing an item. Internal flag which tracks the BidiMode setting in the control. Internal derived text height for an item in the combo-box. Performs actions needed when the BiDiMode setting is changed for the control. Message handled in the method. Draws an item in the control.

DrawItem is an overridden procedure used to draw an item in the extended combo-box control.

Index contains the ordinal position for the TComboExItem instance in ItemsEx that is drawn in the method.

ARect is the rectangle with the coordinates for the item. The values in ARect are set in the calling procedure (LMDrawListItem in TCustomComboBox). When the left coordinate is greater than zero (0), the item is a sub-item (or not a main item). Sub-items are drawn with the additional spacing in Indent applied to the drawing rectangle.

State contains the owner draw state used to render the item, and determines the window, border, and font colors for the control.

DrawItem uses ThemeServices to get theme details applied to enabled items in the combo-box. DrawItem ensures that a valid text height is available for the control Canvas, and is used to draw the text for the item.

When Images have been assigned for the control, the image index appropriate for the value in State is determined. The value odSelected causes the SelectedImageIndex for the item is be used. Otherwise, the ImageIndex for the item is used.

The image size is determined by calling the SizeForPPI method in Images using the ImagesWidth and the display density for the current Font. DrawItem determines the location for the image and the indent spacing for the current BiDiMode setting for the control. Right-to-Left rendering aligns the image and indent to the right-hand edge of the drawing rectangle. The DrawIcon method in ThemeServices is called to render the icon to the control Canvas using the theme details.

Images are not drawn when Images is unassigned or contains zero (0) images, or when values have not been explicitly assigned to either ImageIndex or SelectedImageIndex for the extended item in Index.

DrawItem configures the Canvas to use the brush style and font color needed for the value in State. Text drawing flags are derived for the item, and the text is rendered by calling the DrawText method.

DrawItem does NOT call the inherited method in TCustomComboBox or trigger its OnDrawItem event handler. The item is rendered entirely in this method.
Ordinal position for the item drawn in the method. Display rectangle for the item drawn in the method. State used to draw the item in the control. Performs actions needed when the font in the control has been changed.

FontChanged is an overridden procedure in TCustomComboBoxEx. FontChanged sets the value in the internal FNeedMeasure flag to True to force the text height for Items to be recalculated. FontChanged calls the inherited method prior to exiting from the procedure.

TWinControl.FontChanged
Object for the event notification. Initializes the window handle for the control.

InitializeWnd is an overridden procedure used to initialize the window handle for the control. InitializeWnd calls the inherited method, and sets the internal flag used to track the setting in IsRightToLeft for the control.

TCustomComboBox.InitializeWnd TControl.IsRightToLeft
Performs actions needed when the specified component is added to or removed from the control. Notification is an overridden method in TCustomComboBoxEx. It calls the inherited method on entry to handle notifications in ancestor classes and their child components. It ensures that the reference in Images is set to Nil when the component is removed from the control. TComponent Component for the notification. Operation performed for the specified component. Sets the value for the ItemHeight property.

Overridden in TCustomComboBoxEx to set the internal FNeedMeasure flag.

TCustomComboBox.ItemHeight
New value for the property. Constructor for the class instance.

Create is the constructor for the class instance. Create calls the inherited constructor, and allocates resources needed for the class instance. Create sets the default values for the following properties:

AutoCompleteOptions
Set to the constant in cDefAutoCompOpts
Style
The inherited property is set to csOwnerDrawFixed; the value is set to the constant in cDefStyle in the class instance
StyleEx
Set to an empty set ([])
FNeedMeasure
Set to True to force the item height to be recalculated
Owner of the class instance. Destructor for the class instance.

Destroy is the overridden destructor for the class instance. Destroy ensures that resources allocated to the ItemEx property are freed prior to destroying the class instance. Destroy calls the inherited destructor prior to exiting from the method.

TCustomComboBox.Destroy
Adds a new item to the extended combo-box control.

Add is an overloaded method used to add a new item to the extended combo-box control. Both procedure and function variants are provided.

The function variant accepts no arguments, and returns an Integer value with the ordinal position in ItemsEx where the new item was inserted. The caption for the new item is set to the TComboExItem.cDefCaption constant.

The procedure variant does not return the new position for the inserted item. Use the Count property in ItemsEx to determine the ordinal position for the item on exit from the method. Use the parameters to specify the values stored in the corresponding properties in the TComboExItem class instance.

Item added to the control. Caption for the added item. Indent for the added item. Image index for the added item. Overlay image index for the added item. Select image index for the added item. Adds the specified item and object instance to the control.

AddItem is a procedure used to create a new item in the extended combo-box control with the specified caption and object data. Item contains the caption assigned to the new TComboExItem instance. AnObject is an object with the data stored in the new TComboExItem instance.

AddItem calls Insert to create, update, and store the item in the ItemsEx property.

Item added to the control. Object with data for the item added to the control. Assigns the specified values to the ItemsEx property.

AssignItemsEx is an overloaded procedure used to assign the specified values to the ItemsEx property.

The overloaded variants are used to specify different source types with the values stored in the method. When AItemsEx (TComboExItems) is used as the source, the Assign method in ItemsEx is called to store the new values in the property. When AItems (TStrings) is used as the source, additional processing is performed to clear the content in ItemsEx prior to calling its AddItem method for each of the captions in AItems.

TCollection.Assign TCollection.Clear
TStrings instance with values stored in the ItemsEx property. TComboExItems instance with values stored in the ItemsEx property. Clears the contents in the ItemsEx collection.

Clear is an overridden method used to clear the contents in the ItemsEx collection. Clear overrides the behavior from the ancestor class by accessing the Clear method in the ItemsEx property, instead of the Items property.

TCollection.Clear
Deletes the item stored at the specified ordinal position in ItemsEx.

Delete calls the Delete method in ItemsEx to remove the collection item at the position specified in AIndex.

TCollection.Delete
Ordinal position for the item deleted in the method. Deletes the current item selected in the control.

DeleteSelected uses the value in ItemIndex to determine if an item in the control has been selected. When ItemIndex contains a value other than -1, the Delete method is called to remove the item at the position in ItemIndex from the ItemsEx property. No actions are performed in the method when ItemIndex contains a non-zero negative value.

TCustomComboBox.ItemIndex
Inserts a new item with the specified values at the given position. Ordinal position where the new item is stored. Caption for the new combo-box item. Indent spacing for the new combo-box item. Image index for the new combo-box item. Overlay image index for the new combo-box item. Selected image index for the new combo-box item. Contains settings for autocompletion features enabled in the control. Contains images which can be displayed for items defined in the ItemsEx property. Specifies the width for images displayed in the control.

ImagesWidth is an Integer property used to specify the width for Images displayed in the extended combo-box control. The property value is the image size used at the design-time display density (PPI). The value may be adjusted in the DrawItem method to a scaled value relative to the PPI setting for the current Font in the control. The scaled value determines the image resolution requested when accessing the Images assigned for the control.

The default value for the property is zero (0) and indicates that an explicit value has not been assigned for the property.

Changing the value for the property causes the Invalidate method to be called to refresh the control.

TWinControl.Invalidate
Collection with the extended items defined for the control.

ItemsEx is a TComboExItems property which provides access to the extended items defined for the combo-box control. ItemsEx uses TComboExItem as the ItemClass for the collection. The collection is maintained using the Add, AddItem, Delete, DeleteSelected, and Clear methods. Use AssignItemsEx to set the values in the collection to the values from a specific source.

Values in ItemsEx are used in the DrawItem method to render the item(s) using the theme details for the control.

Specifies the control style used for the edit in the combo-box control.

Style is a TComboBoxExStyle property which specifies the control style used for the control. This is a narrower range of values than those used in the TCustomComboBox ancestor class; the owner drawn options are not needed in this class. The following values are used:

csExDropDown
Displays an edit control with a button to make the drop down visible
csExSimple
Displays an edit control only
csExDropDownList
Displays a read-only value with a button to make the drop down visible

The default value for the property is set using the cDefStyle constant.

Enables features or behaviors in the extended combo-box control.

StyleEx is a TComboBoxExStyles property used to store TComboBoxExStyleEx values which enable features in the extended combo-box control. Including a value from the enumeration enables the corresponding feature or behavior in the control. See for more information on the enumeration values and their meanings.

The default value for the property is an empty set ([]).

Values in StyleEx are not used in the current implementation of TCustomComboBoxEx.
Implements an extended combo-box component.

TComboBoxEx is a TCustomComboBoxEx descendant which implements an extended combo-box component.

TComboBoxEx provides an extended combo-box with added features and capabilities like auto completion, additional display styles, more editing options, and a list with Images used in the control. Another key feature in the class is an extended Items property which provides normal, selected, and overlay image indexes and allows indentation between the image and caption for items in the combo-box. A pointer to arbitrary data for Items used in sort operations is also provided.

Represents state and data for a check box item displayed in TCustomCheckCombo.

TCheckComboItemState is a class used to represent state and data for a check box item displayed in TCustomCheckCombo and TCheckComboBox. Properties are provided to store the check box state, the enabled setting for the control, and arbitrary data.

TCheckComboItemState instances are created when the check boxes are added or assigned in TCustomCheckCombo.

Represents the current state for a check box.

State is a TCheckBoxState property with the enumeration value which represents the current checked, unchecked, or grayed state for the check box.

Indicates the current enabled state for a check box.

Enabled is a Boolean property which indicates the current enabled state for a check box control in TCustomCheckCombo.

Contains arbitrary data associated with a check box item. Base class for a combo-box which displays check boxes for Items in the control.

TCustomCheckCombo is a TCustomComboBox descendant which defines the base class for a combo-box which displays check boxes for the Items in the control. It behaves like an ordinary combo-box with a drop-down using a customizable number of visible rows.

TCustomCheckCombo provides additional properties, methods, and events which allow the checked state for values in Items to be specified as either a Boolean or a TCheckBoxState value. An OnItemChange event handler is added to perform custom actions when the Checked value for an item is changed. Convenience methods are included which allow check boxes to be added or deleted, or toggle their value.

TCustomCheckCombo is the ancestor for the TCheckComboBox control.

TCustomComboBox
Checks for valid state information in the Items for the control.

AsyncCheckItemStates calls the CheckItemStates method to ensure that TCheckComboItemState instances have been created for the Items in the control. Used in the implementation of the QueueCheckItemStates method. Queued as an asynchronous call using the Application.QueueAsyncCall method.

TCustomComboBox.Items TApplication.QueueAsyncCall Application
Pointer to an Integer value examined in the method; not used in the current implementation. Gets the value for the indexed Checked property. Value for the property. Ordinal position for the item examined in the method. Gets the value for the Count property. Value for the property. Gets the value for the indexed ItemEnabled property. Value for the property. Ordinal position for the item examined in the method. Gets the value for the indexed Object property. Value for the property. Ordinal position for the item examined in the method. Gets the value for the indexed State property. Value for the property. Ordinal position for the item examined in the method. Sets the value for the indexed Checked property. Ordinal position for the item updated in the method. New value for the property. Sets the value for the indexed ItemEnabled property. Ordinal position for the item updated in the method. New value for the property. Sets the value for the indexed Object property. Ordinal position for the item updated in the method. New value for the property. Sets the value for the indexed State property. Ordinal position for the item updated in the method. New value for the property. Internal member used to to track the highlighting state. Internal member used to track size adjusts needed for them services. Internal members used to track the state for the drop down in the control. Internal member used to track the item highlighted in the control. Internal member used to track the left coordinate for the highlight. Internal member used to track the right coordinate for the highlight. Internal member used to track whether the text height has been calculated for items in the control. Internal member used to track whether drop down requests should be rejected; i. e. the drop down is already visible. Internal member used to track whether the current check box selection can toggle its value; i. e. whether the drop down is visible. Internal member used to track the BiDi status for the control. Internal member used to track the text height for check boxes in the control. Performs actions needed when the BiDiMode setting is changed for the control. Message handled in the method. Removes all state classes allocated for the check boxes in the control.

ClearItemStates is a procedure used to remove all state information classes allocated for the check boxes in the control. ClearItemStates iterates over the Items defined in the control, and frees the TCheckBoxState class instances stored in its Objects property.

ClearItemStates is used in the implementation of the SetItems, AssignItems, and Clear methods.

TCustomComboBox.Items
Closes the drop down displayed for the control.

CloseUp is overridden in TCustomCheckCombo to use the internal member which tracks the visibility for the drop down portion of the control. When it is already visible, the flag value is toggled and the Update method is called to refresh the control. Otherwise, the inherited method is called to perform actions defined in the ancestor class.

Use the DropDown method to make the drop down portion of control visible.

TCustomComboBox.DropDown TCustomComboBox.CloseUp TWinControl.Update
Draws a check box item defined in the combo-box control.

DrawItem is an overridden procedure used to draw a check box defined in the Items for the control.

Index contains the ordinal position for the TComboExItem instance in ItemsEx that is drawn in the method.

ARect is the rectangle with the coordinates for the check box item drawn in the method. The values in ARect are set in the calling procedure (LMDrawListItem in TCustomComboBox).

State contains the owner draw state used to render the check box item, and determines the window and font colors for the check box.

DrawItem uses ThemeServices to get theme element details applied to check box items in the combo-box. DrawItem ensures that a valid text height is available for the control Canvas, and is used to draw the text for the check box.

DrawItem configures the Canvas to use the brush style and font color needed for the value in State. Text drawing flags are derived for the item, and the text is rendered by calling the DrawText method.

DrawItem does NOT call the inherited method in TCustomComboBox or trigger its OnDrawItem event handler. The item is rendered entirely in this method.
Ordinal position for the check box drawn in the method. Rectangle with the coordinates for the check box drawn in the method. Owner draw state for the check box. Displays the drop down for the combo-box.

DropDown is an overridden method used to display the drop down for the combo-box if it is not already visible. DropDown calls the inherited method to trigger the OnDropDown method (when assigned). When the drop down is already visible, the value in an enabled at ItemIndex is Toggled.

TCustomComboBox.ItemIndex TCustomComboBox.DropDown TCustomComboBox.OnDropDown
Performs actions needed when the font for the control has been changed.

FontChanged is an overridden method in TCustomCheckCombo. It sets the internal FNeedMeasure flag to recalculate the text height for check box Items displayed in the control, and calls the inherited method.

TWinControl.FontChanged
Object for the event notification. Initializes the window handle for the control.

InitializeWnd is an overridden method used to Initializes the window handle for the control. InitializeWnd ensures that the item states for check boxes defined in Items is initialized by calling the InitItemStates method. InitializeWnd call the inherited method, and sets the internal FRightToLeft flag used to track the BiDi mode for the control.

TCustomComboBox.InitializeWnd TCustomComboBox.Items
Initializes check box state information for items in the control.

InitItemStates is used to initialize state information for the Items defined in the check box control. InitItemStates iterates over the values in Items, and creates a TCheckComboItemState instance with the enabled, checked state, and state data for each of the items.

The TCheckComboItemState instance is stored in the indexed Objects property. Existing values in Objects are not modified. An Exception is raised if an existing value not derived from TCheckComboItemState is found in Objects.

InitItemStates is called from the AssignItems, InitializeWnd, and Loaded methods. It is also called when a new values is assigned to the Items property.

ClearItemStates is used to remove TCheckComboItemState instances for Items in the control.

Raises an Exception with the message 'Item # is not a TCheckComboItemState' when Objects contains a value not derived from TCheckComboItemState.
Ensures that check box item state classes have been allocated for items in the control.

CheckItemStates is a procedure used to ensure that TCheckComboItemState class instances exist for the Items defined in the control. CheckItemStates iterates over the values in Items to determine if its Objects property contains a valid TCheckComboItemState instance. An Exception is raised when the object is not derived from TCheckComboItemState.

CheckItemStates is used in the implementation of the InitializeWnd and AsyncCheckItemStates methods.

Raises an Exception when a check box in Items does not have a valid TCheckComboItemState object. TCustomComboBox.Items TStrings.Objects
Queues an asynchronous call to AsyncCheckItemStates in the Application singleton.

QueueCheckItemStates is a procedure used to queue an asynchronous call to the AsyncCheckItemStates method in the global Application singleton. QueueCheckItemStates is called from the DrawItem method.

TApplication.QueueAsyncCall Application
Handles key down events for the control.

KeyDown is the overridden method used to handle key down events for the control. KeyDown ensures that Return (VK_RETURN) and Space (VK_SPACE) are applied to the control. Return causes the value for an enabled item to be toggled when highlighted. Space also toggles the value in an enabled check box, and makes the item selected before hiding the drop down for the combo-box.

KeyDown calls the inherited method.

TCustomComboBox.KeyDown
Key examined in the method. Keystroke modifier examined in the method. Performs actions needed when the component has finished loading from the LCL streaming mechanism.

Loaded is an overridden method used to perform actions needed when the component has finished loading from the LCL streaming mechanism. Loaded calls the inherited method, and calls InitItemStates to allocate TCheckComboItemState instances (when needed) for the check box Items defined in the control.

TCustomComboBox.Items
Deactivates tracking the highlighted check box when the mouse leaves the control. TControl.MouseLeave Tracks changes to the mouse position for the highlighted check box in the control.

MouseMove is overridden in TCustomCheckCombo to track the X and Y coordinates for the highlighted check box item, and to refresh the control when needed. MouseMove calls the inherited method.

TControl.MouseMove
Mouse event modifier examined in the method. Horizontal coordinate for the mouse pointer examined in the method. Vertical coordinate for the mouse pointer examined in the method. Sets the value for the ItemHeight property. New value for the property. Sets the value for the Items property. New value for the property. Toggles the value for the current item selected in the control.

Select is an overridden procedure used to toggle the value for the current item in the combo-box. Select calls the inherited method.

For the Windows platform, the value for the selection cannot be toggled if the combo-box is already in a dropped-down state (when the DropDown method has been called).

Select calls the Toggle method using the value in ItemIndex as the affected check box item. The internal flag used to track drop down state is reset prior to exiting from the method. Toggle is not called when ItemIndex contains a negative value, or when the item at the position in ItemIndex is not enabled.

Alternatively, you can use the Checked property to assign an explicit Boolean value for the check box in ItemIndex.

Select is called from the KeyDown event handler to apply a Space key which occurs in the control.

TCustomComboBox.DropDown TCustomComboBox.Select TCustomComboBox.ItemIndex
Constructor for the class instance.

Create is the overridden constructor for the class instance, and calls the inherited method. Create ensures that the Items property is configured to ignore duplicate values. Create sets the default values for the following properties and members:

Style
Set to the value csOwnerDrawFixed
FNeedMeasure
Set to True to force item height to be recalculated
FRejectToggleOnSelect
Set to True until the control is dropped down
TCustomComboBox.Items TStringList.Duplicates
Owner of the object instance. Destructor for the class instance.

Destroy is the overridden destructor for the class instance. Destroy calls ClearItemStates to free the TCheckComboItemState instances allocated for Items in the control. Destroy calls the inherited destructor.

TCustomComboBox.Items
Adds a check box with the specified settings to the Items property.

AddItem is a reintroduced procedure used to add a check box with the specified settings to the Items property. AddItem creates a TCheckComboItemState instance which stores the values specified in the AItem, AState, and AEnabled parameters. AddItem calls the inherited method to allocate a new item for the control with the associated item state object.

Caption for the new check box item. Check box State for the new item. Enabled state for the new check box item. Assigns the content in the specified TStringList to the Items in the control.

AssignItems calls ClearItemStates to reset the state flags for the existing Items. The Assign method in Items is called to store the values in AItems. The InitItemStates method is called to initialize the Objects properties in Items with TCheckComboItemState instances for each of the check boxes.

InitItemStates can raise an exception if any of the Objects in AItems contains a class not derived from TCheckComboItemState.
TStrings.Assign TStrings.Objects
TStringList with values stored in the method. Removes the values stored in the Items property.

Clear is an overridden procedure in TCustomCheckCombo used to remove check box item state information. Clear calls ClearItemStates to free TCheckComboItemState classes instances stored in the Objects property in Items. Clear calls the inherited method prior to exit to remove its contents.

TStringList.Clear TStrings.Objects
Deletes the check box at the specified position.

Ensures that an object instance stored in Objects is freed before removing the item. Calls the Delete method to remove the item at the position in AIndex.

TStrings.Delete
Ordinal position for the item removed in the method. Sets the state for all check boxes defined in the control meeting the specified criteria.

CheckAll is a procedure used to set the checked state for all check boxes defined in the Items for the control. AState contains the state applied to the check boxes defined in the control.

AAllowGrayed indicates whether check boxes with an indeterminate ("grayed") state can be updated in the method. AAllowDisabled indicates whether check boxes which are not enabled can be updated in the method.

CheckAll iterates over the Items defined for the control, and when allowed using the specified arguments, sets the value in the State property to the value in AState.

CheckAll is a convenience method; the same result can be achieved by setting the value in the State or Checked properties for an individual check box at a specified position.

Checked state for the matching check boxes. Indicates if grayed check boxes can be updated in the method. Indicates if disabled check boxes can be updated in the method. Toggles the checked state for the check box at the specified position.

Toggle is a method used to toggle the checked state for the combo-box item at the position specified in AIndex. Toggle sets the value in the indexed State property to the next TCheckBoxState value for the entry in Items.

The value in the AllowGrayed property is used to determine the next checked stated. When AllowGrayed is False, the value progresses in the order cbUnchecked to cbChecked and repeats. When AllowGrayed is True, the order is cbGrayed, cbUnchecked, cbChecked and repeats.

Toggle is called from the KeyDown and DropDown methods when the Return or Space key is pressed on the item in ItemIndex and the item is Enabled. It is also called from the Select method.

Ordinal position for the check box affected in the method. Indicates if check boxes can be drawn in the indeterminate state.

AllowGrayed is a Boolean property which indicates if check boxes can be displayed in the "grayed" or indeterminate state. The default value for the property is False.

Reflects the number of check boxes defined for the control.

Count is a read-only Integer property which reflects the number of check boxes defined for the control. The value for the property is retrieved from the corresponding property in Items.

Use the AddItem method to add a new check box to the control. Use the DeleteItem method to remove a specific check box defined in Items. Use Clear to remove all check boxes defined for the control.

TStrings.Count TCustomComboBox.Items
Provides indexed access to the Boolean value for a check box defined in Items.

Checked is an indexed Boolean property which provides access to the checked state for a check box item defined in the control. AIndex specifies the ordinal position in Items for the check box. Checked uses the value from the TCheckComboItemState object stored in the Items property. True indicates that TCheckComboItemState.Checked contains the value cbChecked. False indicates that it contains the value cbUnchecked.

Changing the value for the property causes the OnItemChange event handler to be signalled, and the Invalidate method is called when AIndex is also the selected ItemIndex for the control.

Ordinal position for the requested check box value. Provides indexed access to the Boolean enabled value for a check box defined in Items. Ordinal position for the requested check box enabled value. Provides indexed access to the Data for a check box defined in Items.

Objects is an indexed TObject property which provides access to the Data for a check box defined in Items. AIndex specifies the ordinal position in Items for the check box. Objects return the value from the TCheckComboItemState object stored in the Items property. The object instance is the property value that represents the content stored in the TCheckComboItemState.Data property.

Ordinal position for the requested check box item state. Provides indexed access to the checked State for a check box defined in Items.

State is an indexed TCheckBoxState property which provides access to the checked State for a check box defined in Items. AIndex specifies the ordinal position in Items for the check box. State returns the TCheckBoxState value in TCheckComboItemState.State for the associated object instance.

Changing the value for the property causes the OnItemChange event handler to be signalled. The Invalidate method is also called when AIndex is the current value in the ItemIndex property.

Ordinal position for the check box state requested. Event handler signalled when the state for a check box in the control is changed.

OnItemChange is a TCheckItemChange property with the event handler signalled when a value in the Checked or State properties is changed. Arguments passed to the event handler identify the object for the event notification, and the ordinal position in Items for the modified check box.

TCustomComboBox.Items
Combo-box control which displays check boxes for the items in the control.

TCheckComboBox is a TCustomCheckCombo descendant which implements a combo-box which displays check boxes for the Items in the control. It behaves like an ordinary combo-box with a drop-down using a customizable number of visible rows.

TCheckComboBox provides additional properties, methods, and events which allow the checked state for values in Items to be specified as either a Boolean or a TCheckBoxState value. An OnItemChange event handler is added to perform custom actions when the Checked value for an item is changed. Convenience methods are included which allow check boxes to be added or deleted, or toggle their value.

TCheckComboBox sets the visibility for property defined in ancestor classes.

Registers components for use in the Lazarus IDE.

Register is a procedure used to register components in the comboex.pas unit for use in the Lazarus IDE. Register adds the TComboBoxEx and TCheckComboBox components to the Misc tab in the Lazarus IDE.