From afc7afe13b6eb49984e1c9c66eef3cebc1392a09 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 9 Mar 2005 03:34:46 +0000 Subject: Patch from Blair McGlashan to send a notification before accepting an autocompletion. --- doc/ScintillaDoc.html | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-) (limited to 'doc/ScintillaDoc.html') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 7c4637c33..e075df0b1 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -38,7 +38,7 @@

Scintilla Documentation

-

Last edited 29/May/2004 NH

+

Last edited 9/March/2005 NH

There is an overview of the internal design of Scintilla.
@@ -2876,7 +2876,7 @@ struct TextToFind {

Autocompletion

-

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 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.

+

When the user makes a selection from the list the container is sent a SCN_AUTOCSELECTION 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 + SCI_AUTOCCANCEL.

+

To make use of autocompletion you must monitor each character added to the document. See SciTEBase::CharAdded() in SciTEBase.cxx for an example of autocompletion.

SCI_AUTOCSHOW(int lenEntered, const char @@ -3042,7 +3048,8 @@ struct TextToFind { effect.
o When the user makes a selection you are sent a
SCN_USERLISTSELECTION notification message.

+ href="#Notifications">notification message rather than 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 { SCN_HOTSPOTCLICK
SCN_HOTSPOTDOUBLECLICK
SCN_CALLTIPCLICK
+ SCN_AUTOCSELECTION

The following SCI_* messages are associated with these notifications:

@@ -4478,8 +4486,8 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber); Valid for text changes, not for style changes. If we are collecting undo information this holds a pointer to the text that is handed to the Undo system, otherwise it is zero. For user performed SC_MOD_BEFOREDELETE the text field is 0 and - for user performed SC_MOD_BEFOREINSERT the text field points to an array of cells, - not bytes. + for user performed SC_MOD_BEFOREINSERT the text field points to an array of cells, + not bytes. @@ -4890,6 +4898,35 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next The 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 + SCI_AUTOCCANCEL message + before returning from the notification. The SCNotification fields used are:

+ + + + + + + + + + + + + + + + + + + + + + +
FieldUsage
lParamThe start position of the word being completed.
textThe text of the selection.
+

Deprecated messages and notifications

The following messages are currently supported to emulate existing Windows controls, but -- cgit v1.2.3