tsc_DropDownXCodeListField

The tsc_DropDownXCodeListField allows a list of translated string items to be displayed on a form.  Initially only the selected item is displayed, and a drop-down arrow allows the user to display a full list.  The list will open as far as the bottom of the form, and if more items exist in the list a scrollbar is added.

Where the strings in a list are not translated, use the tsc_DropDownStringListField.

If the strings that are to be displayed represent an enum, use the tsc_DropDownEnumListField.

Control sizing

Drop-down lists may contain any reasonable number of items. 

The control in its closed-up state occupies a single line on a form and if no string within the list is too long, then two may fit side by side.  The width of the control is determined by the longest string. 

Horizontally, the list is sized to the longest string item, up to the width of the form.  When using a custom layout, the SetCustomDimensions() method on the control may be used to set the list to a fixed width.

When the list is opened by the user, it may occupy as much vertical space as is available on the form.  If the list contains more items than will fit, a vertical scroll bar is added.

The image to the right shows a variety of drop-down lists as displayed by the drop-down form in the HowTo sample.  See the Samples subdirectory in the SDK distribution.

Public methods

Events

An OnFieldCompleted event is generated when the user selects another item.  Override this method to receive a notification of a change to the selected item in a drop-down list.

 

virtual bool tsc_Form::OnFieldCompleted (tsc_Control& control);

This event is raised when the user changes the selected item.  The event doesn't occur until the user has committed the change by pressing Enter while focus is within the drop-down list, or clicks or tabs away from the control.  Selection changes performed programmatically do not raise this event.