srvcombobox TSRVComboBox

<< Click to display table of contents >>

srvcombobox TSRVComboBox

TSRVComboBox combines an edit box with a scrollable list. Items can have captions and images. A list can be hierarchical. Additionally, editing suggestions (hints) may be displayed.

Unit SRVComboBox;

Syntax

TSRVComboBox = class(TSRVCustomComboBox)

Hierarchy

TObject

TPersistent

TComponent

TControl

TWinControl

TSRVWinControl

TSRVEditControl

TSRVCustomComboBox

Properties and events

This component publishes public properties inherited from TSRVCustomComboBox.

Hints (Suggestions)

A list of suggestions can be displayed on editing.

Suggestions are requested in the event OnEditHints. In this event, you can fill a list of suggestions (EditHints) for the Text, and specify the Index of item to highlight initially.

A height of this list is defined in DropDownHints property.

Painting

The default combo box appearance (if skins are not assigned) depends on SRVControlStyle: TSRVControlStyle property:

srvcsSimple (if RVControlsPainter.Theme = rvctPaleBlue):

combobox_simple

srvcsClassic (the scroll bar appearance depends on Windows, this screenshot is for Windows 10)::

combobox_classic

The border around the box has width defined in DisabledBorderWidth, EnabledBorderWidth, MouseInBorderWidth, FocusedBorderWidth properties. When auto-sizing the control, it is assumed that the border width is equal to EnabledBorderWidth.

A border color depends on the combo box state (normal, disabled, under the mouse pointer, focused) and SRVControlStyle: TSRVControlStyle property. If it is equal to srvcsSimple, colors are defined by RVControlsPainter (see the TRichView manual). If it is equal to srvcsClassic, colors are defined in EnabledBorderColor, DisabledBorderColor, MouseInBorderColor, FocusedBorderColor properties. The same is for colors used for drawing selected items (SelectedItemBackColor, SelectedItemBorderColor, SelectedItemTextColor).

Item colors are defined in the items properties.

If SkinManager is assigned:

an editing region is drawn using SkinManager.CurrentSkin.BoxSchemes[EditSkinSchemeIndex];

a drop down list is drawn using SkinManager.CurrentSkin.BoxSchemes[SkinSchemeIndex];

each item in a drop down list is drawn using SkinManager.CurrentSkin.BoxSchemes[ItemSkinSchemeIndex];

a scrollbar of a drop down list is drawn using SkinManager.CurrentSkin.VerticalScrollBarSchemes[ScrollBarSkinSchemeIndex].

a list of hints (suggestions) is drawn using SkinManager.CurrentSkin.BoxSchemes[HintsSkinSchemeIndex];

each item in a list of hints is drawn using SkinManager.CurrentSkin.BoxSchemes[HintsItemSkinSchemeIndex];

a scrollbar of a list hints is drawn using SkinManager.CurrentSkin.VerticalScrollBarSchemes[HintsScrollBarSkinSchemeIndex].

Example:

SRVComboBox Scheme