SearchHint
SearchHint() Event
Partial search text
Applies to: KCMLEdit
Introduced in KCML version 7.07
This event fires when the user enters text and briefly pauses. The application can suggest a list of possible results without using a complex search UI. SearchHint can be used on any KCMLEdit control that does not have a drop down list. Text is in the ValidateText$ property.
Unlike other events SearchHint does not pause KClient while it is processed. This means several events could be queued up. KCML will will only present the newest SearchHint to the application and the application can use HintEventPending to check for further SearchHint events arriving during processing.
The delay after the user stops typing can be tuned using the SetDBeditSearchTimeout method. This should strike a balance between responsiveness and the time taken to performs searches.
Hints are presented to the user in a drop down list.
DEFEVENT Form1.editControl1.SearchHint() // Search for results based on ..ValidateText$ // ... // ... IF (.form.HintEventPending()) // While we were searching the user entered some more text. // Must abandon these results. RETURN END IF // Fill a drop down list with results. ..Delete() ..Add($PRINTF("Result for %s", ..ValidateText$)) ..Add($PRINTF("Another result for %s", ..ValidateText$)) ..DropDownFilled = TRUE ..ShowDropDown() END EVENT