Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Toolkit User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

4.15 Enhanced ComboBox with AutoComplete

The SECComboBoxEx class extends MFC's CComboBoxEx class by providing a type ahead or autocomplete feature. The Address combobox in MS Internet Explorer provides the same functionality. As the user types, the control searches through its list of entries for a match. If the control finds a match to the partial entry, it substitutes the text in the edit control with first matching entry and highlights the characters to the right the caret.

Figure 39: Example Enhanced Combobox Control

The autocomplete feature also skips ahead when the user types in an entry that includes a regularly repeating delimiter strings sequence, such as the "." in an IP address or the slash character (/) in an URL.

When the user presses the delimiter key once, the entry appears as follows:

Figure 40: Example Entry with Repeating Delimiters

When the user presses the delimiter key twice, the entry appears as follows:

When the user presses the delimiter key three times, the entry appears as follows:

The user can always click the button to the right to drop down the list of items as well.

4.15.1 The Enhanced ComboBox Class

The SECComboBoxEx class inherits directly from CComboBoxEx.

Figure 41: Enhanced Combobox Class Hierarchy

4.15.2 Using SECComboBoxEx

The following procedures describe how to use an enhanced combo box in your application.

To add SECComboBoxEx to a window:

Use the CComboBox::Create() method. For example:

To add string items to the combo box:

Use the CComboBox::InsertItem() method. For example:

where <stingray-installdir> refers to the top-level directory in your Stingray Studio installation.

To set the case sensitivity for the autocomplete feature:

Call the CComboBox::SetCaseSensitive() method.

The preceding call ensures that the autocomplete feature does not consider the case of the characters when it searches for a matching entry in the list.

To allow users to skip repeating delimiters:

Use the CComboBox::SetDelimiterKey() and SetDelimiterString() methods. For example, if the combobox contains long directory entries delimited by two backslashes, you can let the user skip the next delimiter by pressing the <TAB> key with the following calls.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.