The TTMSFNCControlPicker helps you to create a dropdown variant of your control.
Base Interface: ITMSFNCControlPickerBase
|PickerGetContent||Function that returns the content for the picker edit|
Items Interface: ITMSFNCControlPickerItems (ITMSFNCControlPickerBase as base class)
|PickerSelectItem||Implementation to set the item index of the component.|
|PickerGetSelectedItem||Function that returns the selected item index.|
|PickerGetVisibleItemCount||Function that returns the number of visible items. Used when the width or height are set by the number of items.|
|PickerGetItemCount||Function that returns the number of items. Used for checks if the itemindex is within the range.|
|PickerGetItemHeight||Function that returns the item height. Used when the height is set by the number of items.|
|PickerSetItemHeight||Procedure that sets the item height. Used when the height must be changed in the component.|
|PickerGetItemWidth||Function that returns the item width. Used when the width is set by the number of items.|
|PickerSetItemWidth||Procedure that sets the item width. Used when the width must be changed in the component.|
|PickerGetNextSelectableItem||Function that returns the next item index, based on the current. Used when the keyboard bindings are used.|
|PickerGetPreviousSelectableItem||Function that returns the previous item index, based on the current. Used when the keyboard bindings are used.|
|PickerGetFirstSelectableItem||Function that returns the first item index. Used when the keyboard bindings are used.|
|PickerGetLastSelectableItem||Function that returns the last item index. Used when the keyboard bindings are used.|
Full Interface: ITMSFNCControlPickerFull (ITMSFNCControlPickerItems as base class) This interface can be used when you want to use filtering and autocompletion.
|PickerApplyFilter||Implementation for the interface to apply the filter that has a condition string as a parameter.|
|PickerLookupItem||Function that returns a TTMSFNCControlPickerFilterItem record that has an item index and text of the lookup string you are checking.|
|PickerResetFilter||Implementation to clear the filters of your component.|
|AutoCloseUp||Property to automatically close the dropdown if the written text matches an item from the list.|
|AutoComplete||Property to enable autocompletion.|
|AutoCompleteDelay||Defines the delay between 2 keystrokes during autocompletion. Only applies if the Style is set to csDropDownList.|
|AutoCompleteNumChar||Defines the numer of characters that are necessary for autocompletion to trigger. Only applies if the Style is set to csDropDown.|
|AutoDropDown||Property to automatically open the dropdown when typing. Relies on the AutoCompleteNumChar if the Style is set to csDropDown.|
|CaseSensitive||Enable or disable case sensitivity.|
|Control||The control that will be used in the picker for the dropdown|
|DropDownControlHeight||The height of the dropdown window, when the mode is set to chmDropDownHeight.|
|DropDownControlWidth||The width of the dropdown window, when the mode is set to chmDropDownWidth.|
|DropDownHeightMode||Different ways to set the height of the dropdown window. Can be set to the DropDownControlHeight, the height of the control or based on the visible item count and the item height.|
|DropDownWidthMode||Different ways to set the width of the dropdown window. Can be set to the DropDownControlWidth, the width of the control or based on the visible item count and the item width.|
|ItemIndex||Selected item index.|
|Style||The 2 possible values are csDropDown and csDropDownList. It’s affecting the editability of the combobox.|
|Text||Returns the text that is displayed in the combobox.|
|OnAdjustDropDownHeight||Event triggered before changing the dropdown height of the window.|
|OnAdjustDropDownWidth||Event triggered before changing the dropdown width of the window.|
|OnAfterDrawPickerContent||Event triggered after drawing the text of the picker.|
|OnBeforeDrawPickerContent||Event triggered before drawing the text of the picker.|
|OnItemSelected||Event triggered when the item index is set.|
|OnSetContent||Event triggered before you set the content of the picker.|
It is possible to achieve some of the functionality of the control picker with the use of the events without implementing the interface.
To help you with keeping the control in the picker up-to-date to user interaction, you can use the following procedures:
CallItemClicked(AItemIndex: Integer); This will update the picker text, clear the filter and set the selected item to the AItemIndex value and will close or open the dropdown window. (This procedure should be called after you selected another item with user interaction.)
UpdateDropDown; This will update the picker text and will close or open the dropdown window.
UpdatePickerContent; This procedure will set the text of the picker based on the retrieved value of the interface or with the DoSetContent event.
UpdatePickerDropDownSize; Will set the dropdown height and width. This is based on de the dropdown mode and can be altered in the OnAdjustDropDownHeight or width event.