From afc7afe13b6eb49984e1c9c66eef3cebc1392a09 Mon Sep 17 00:00:00 2001
From: nyamatongwe Last edited 29/May/2004 NH Last edited 9/March/2005 NH There is an overview of the internal design of
Scintilla. Autocompletion displays a list box showing likely identifiers based upon the users typing.
+ Autocompletion displays a list box showing likely identifiers based upon the user's typing.
The user chooses the currently selected item by pressing the tab character or another character
that is a member of the fillup character set defined with When the user makes a selection from the list the container is sent a To make use of autocompletion you must monitor each character added to the document. See
Scintilla Documentation
-
@@ -2876,7 +2876,7 @@ struct TextToFind {
Autocompletion
- SCI_AUTOCSETFILLUPS.
Autocompletion is triggered by your application. For example, in C if you detect that the user
@@ -2886,6 +2886,12 @@ struct TextToFind {
the choice to a reasonable list. As yet another alternative, you could define a key code to
activate the list. notification message. On return from the notification Scintilla will insert
+ the selected text unless the autocompletion list has been cancelled, for example by the container sending
+ .SciTEBase::CharAdded() in SciTEBase.cxx for an example of autocompletion.notification message.
SCN_AUTOCSELECTION.
BEWARE: if you have set fillup characters or stop characters, these will still be active
with the user list, and may result in items being selected or the user list cancelled due to
@@ -4315,7 +4322,7 @@ struct SCNotification {
int ch; // SCN_CHARADDED, SCN_KEY
int modifiers; // SCN_KEY, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK
int modificationType; // SCN_MODIFIED
- const char *text; // SCN_MODIFIED
+ const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
int length; // SCN_MODIFIED
int linesAdded; // SCN_MODIFIED
int message; // SCN_MACRORECORD
@@ -4325,7 +4332,7 @@ struct SCNotification {
int foldLevelNow; // SCN_MODIFIED
int foldLevelPrev; // SCN_MODIFIED
int margin; // SCN_MARGINCLICK
- int listType; // SCN_USERLISTSELECTION
+ int listType; // SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
int x; // SCN_DWELLSTART, SCN_DWELLEND
int y; // SCN_DWELLSTART, SCN_DWELLEND
};
@@ -4354,6 +4361,7 @@ struct SCNotification {
+
The following SCI_* messages are associated with these notifications:
position field is set to 1 if the click is in an up arrow,
2 if in a down arrow, and 0 if elsewhere.
+ SCN_AUTOCSELECTION
+ The user has selected an item in an autocompletion list. The
+ notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a
+ message
+ before returning from the notification. The SCNotification fields used are:
| Field | + +Usage | +
|---|---|
lParam |
+
+ The start position of the word being completed. | +
text |
+
+ The text of the selection. | +
The following messages are currently supported to emulate existing Windows controls, but -- cgit v1.2.3