table of contents
MatchEditor(3I) | InterViews Reference Manual | MatchEditor(3I) |
NAME¶
MatchEditor - StringEditor with string completion
SYNOPSIS¶
#include <InterViews/compeditor.h>
DESCRIPTION¶
CompletionEditor is a StringEditor subclass with the added ability tocomplete the current contents of the edit buffer against a specifiedset of strings. A CompletionEditor is often useful when a user mustspecify a selection from a large set of well-known strings--the userneed only type the first few characters of the string; he types thecompletion character to fill out the remainder.
When the user types the completion character, CompletionEditor checksthe current string against the list of possible completions. If thecurrent string is a prefix of one or more completion strings,characters are appended so that the edit string contains the longestcommon prefix; if the current string does not match any completionstring, trailing characters are removed until the string matches atleast one completion. In any case, if there is more than one possiblecompletion of a string, CompletionEditor rings the workstation bell.
PUBLICOPERATIONS¶
- CompletionEditor(ButtonState*, const char* sample, const char* done)
- Create a new CompletionEditor object. The ButtonState, sample string,and termination string are passed to the StringEditor constructor.
- void Completions(const char* completions[], int count, char complete)
- Specify the list of completion strings and the completion character.The initial completion list is empty, and the completion characterdefaults to a space. CompletionEditor does not copy the strings inthe list.
SEEALSO¶
StringEditor(3I)
13 Dec 1989 | InterViews |