diff --git a/docs/xml/lcl/stdctrls.xml b/docs/xml/lcl/stdctrls.xml index 24c84d759c..6b2388470f 100644 --- a/docs/xml/lcl/stdctrls.xml +++ b/docs/xml/lcl/stdctrls.xml @@ -2186,18 +2186,25 @@ - Adjusts ItemIndex for the new value in the edit box. + Updates ItemIndex when the new value for the control is updated.

- If the text AValue occurs in the list of strings, then the value in Itemindex is updated. Otherwise, the default action which is to store text as a string rather than performing read-write to a PChar buffer. + RealSetText is an overridden method in TCustomComboBox. It ensures that ItemIndex is updated with the ordinal position in Items where the AValue argument is found. If there are no values stored in Items, ItemIndex is set to -1. A visible emulated TextHint is hidden when AValue is not an empty string (''). +

+

+ The inherited method is called prior to exit. This causes the widgetset class to be updated when its Handle is valid. The value in Caption is also updated, and a CM_TEXTCHANGED control message is performed for the control.

- TControl.RealSetText + + + + TWinControl.RealSetText + TWinControl.RealGetText
- The new value in the edit box. + The new value for the control. @@ -3135,7 +3142,7 @@

- If text is selected in the edit box for the control, this is the starting position. When no text is selected, SelStart is the cursor position, and SelLength is 0 (zero). + If text is selected in the edit box for the control, this is the starting position. When no text is selected, SelStart is the cursor position and SelLength is 0 (zero).

Writing a new value to the property moves the cursor, and removes the current text selection. Set SelLength after changing SelStart, to establish a new text selection. @@ -3172,7 +3179,7 @@

csSimple
-
Displays an edit box with a static list (not a drop-down list).
+
Displays an edit box with an attached list (not a drop-down list).
csDropDown
Displays an edit box with a drop-down list.
csDropDownList
@@ -3208,21 +3215,41 @@ The value in the edit box for the control.

- Setting the value in Text selects a possibly matching item in the list. If an item is selected from the list, it replaces the contents of Text. + Text is a public property in TCustomComboBox and contains the TCaption value for the control. It is the value displayed in the edit box for the control.

- Use the Style property to control the display and editing features enabled for the control. + Setting a new value for Text in program code causes the RealSetText method to be called. The new property value is located in the Items property, and the value in ItemIndex is updated with the ordinal position for the found value. A case-insensitive comparison is used to locate the value in Items. The value applied to Text retains the original case used in the new property value. ItemIndex is set to -1 if a value is not located in Items that is a case-insensitive match the new property value.

- Text completion can be enabled or disabled using the AutoComplete property. + At run-time, the value in Text can be updated using the edit box for the control when it is enabled for the selected Style (such as csDropDown and csSimple). When Style contains csDropDownList, the edit box is not displayed. But the button for the drop-down list handles the first character key pressed, and locates a value in Items when the button has focus. +

+

+ AutoComplete enables or disables auto-completion for the value in Text. When set to True, the first item that matches the entered character(s) is located in Items and the value is highlighted in the drop-down list for the control. By default, a case-insensitive comparison is used to find the entered value. Case sensitivity can be enabled using cbactSearchCaseSensitive in the AutoCompleteText options, and requires the value in Items to be an exact case-sensitive match for the character(s) entered in the edit box. Text is updated to contain the complete value for the entry in Items. By default, the case for the value in Items is retained and applied to Text. Include cbactRetainPrefixCase in AutoCompleteText options to use the value as entered in the edit box in the Text property. +

+

+ When the edit box loses input focus, ItemIndex is updated with the ordinal position in Items where the partial value was found. It is set to -1 when a matching value could not be located in Items. +

+

+ When AutoComplete is disabled (set to False), the entered value is still located located and highlighted in the drop-down list for Items. However, the value in Text is not expanded and the the value in ItemIndex is not updated. The item must be selected using the drop-down list to apply the value to Text and update the value in ItemIndex. +

+

+ Use ItemIndex to select one of the Items by its ordinal position, and apply the value to the Text property.

+ + + A test application was used to verify the described functionality on the Windows platform. It has been attached to Issue #39413 to allow testing for other platforms / widgetsets. + + - - + + + + +