From 0f684a5b30d62ead00e955607e88558846ababe3 Mon Sep 17 00:00:00 2001
From: nyamatongwe
Date: Mon, 4 Apr 2011 11:40:24 +1000
Subject: Updates to documentation of notifications. Set the position field for
SCN_USERLISTSELECTION and SCN_AUTOCSELECTION.
---
doc/ScintillaDoc.html | 75 +++++++++++++++++++++++++++++--------------------
include/Scintilla.h | 19 ++++++++++---
include/Scintilla.iface | 14 ++++-----
src/ScintillaBase.cxx | 1 +
4 files changed, 67 insertions(+), 42 deletions(-)
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 46e4bc1e0..208ffe8ea 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -79,7 +79,7 @@
Scintilla Documentation
- Last edited 31/March/2011 NH
+ Last edited 4/April/2011 NH
There is an overview of the internal design of
Scintilla.
@@ -5682,31 +5682,38 @@ struct NotifyHeader { // This matches the Win32 NMHDR structure
};
struct SCNotification {
- struct NotifyHeader nmhdr;
- int position;
- // SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_DWELLSTART,
- // SCN_DWELLEND, SCN_CALLTIPCLICK,
- // SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK
- int ch; // SCN_CHARADDED, SCN_KEY
- int modifiers;
- // SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK
- int modificationType; // SCN_MODIFIED
- const char *text; // SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
- int length; // SCN_MODIFIED
- int linesAdded; // SCN_MODIFIED
- int message; // SCN_MACRORECORD
- uptr_t wParam; // SCN_MACRORECORD
- sptr_t lParam; // SCN_MACRORECORD
- int line; // SCN_MODIFIED, SCN_DOUBLECLICK
- int foldLevelNow; // SCN_MODIFIED
- int foldLevelPrev; // SCN_MODIFIED
- int margin; // SCN_MARGINCLICK
- int listType; // SCN_USERLISTSELECTION, SCN_AUTOCSELECTION
- int x; // SCN_DWELLSTART, SCN_DWELLEND
- int y; // SCN_DWELLSTART, SCN_DWELLEND
- int token; // SCN_MODIFIED with SC_MOD_CONTAINER
- int annotationLinesAdded; // SC_MOD_CHANGEANNOTATION
- int updated; // SCN_UPDATEUI
+ struct Sci_NotifyHeader nmhdr;
+ int position;
+ /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
+ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
+ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
+ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
+
+ int ch; /* SCN_CHARADDED, SCN_KEY */
+ int modifiers;
+ /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
+ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+
+ int modificationType; /* SCN_MODIFIED */
+ const char *text;
+ /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
+
+ int length; /* SCN_MODIFIED */
+ int linesAdded; /* SCN_MODIFIED */
+ int message; /* SCN_MACRORECORD */
+ uptr_t wParam; /* SCN_MACRORECORD */
+ sptr_t lParam; /* SCN_MACRORECORD */
+ int line; /* SCN_MODIFIED */
+ int foldLevelNow; /* SCN_MODIFIED */
+ int foldLevelPrev; /* SCN_MODIFIED */
+ int margin; /* SCN_MARGINCLICK */
+ int listType; /* SCN_USERLISTSELECTION */
+ int x; /* SCN_DWELLSTART, SCN_DWELLEND */
+ int y; /* SCN_DWELLSTART, SCN_DWELLEND */
+ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
+ int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
+ int updated; /* SCN_UPDATEUI */
};
@@ -5804,7 +5811,9 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);
SCN_DOUBLECLICK
The mouse button was double clicked in editor. The position field is set to the text position of the
- double click and the line field is set to the line of the double click.
+ double click, the line field is set to the line of the double click, and
+ the modifiers field is set to the key modifiers
+ held down in a similar manner to SCN_KEY.
SCN_UPDATEUI
Either the text or styling of the document has changed or the selection range or scroll position has changed.
@@ -6333,7 +6342,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
- wParam |
+ listType |
This is set to the listType parameter from the SCI_USERLISTSHOW message that
@@ -6345,10 +6354,15 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
| The text of the selection. |
+
+
+ position |
+
+ The position the list was displayed at. |
+
-
SCN_URIDROPPED
@@ -6392,7 +6406,6 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
-
SCI_SETMOUSEDWELLTIME
SCI_GETMOUSEDWELLTIME
@@ -6452,7 +6465,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
- lParam |
+ position |
The start position of the word being completed. |
diff --git a/include/Scintilla.h b/include/Scintilla.h
index ed1102010..b3907fff2 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -960,11 +960,22 @@ struct Sci_NotifyHeader {
struct SCNotification {
struct Sci_NotifyHeader nmhdr;
- int position; /* SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND */
+ int position;
+ /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
+ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
+ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
+ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
+
int ch; /* SCN_CHARADDED, SCN_KEY */
- int modifiers; /* SCN_KEY */
+ int modifiers;
+ /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
+ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
+
int modificationType; /* SCN_MODIFIED */
- const char *text; /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
+ const char *text;
+ /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
+
int length; /* SCN_MODIFIED */
int linesAdded; /* SCN_MODIFIED */
int message; /* SCN_MACRORECORD */
@@ -978,7 +989,7 @@ struct SCNotification {
int x; /* SCN_DWELLSTART, SCN_DWELLEND */
int y; /* SCN_DWELLSTART, SCN_DWELLEND */
int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
- int annotationLinesAdded; /* SC_MOD_CHANGEANNOTATION */
+ int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
int updated; /* SCN_UPDATEUI */
};
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 0d3644d65..ce197da75 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -3889,22 +3889,22 @@ evt void SavePointLeft=2003(void)
evt void ModifyAttemptRO=2004(void)
# GTK+ Specific to work around focus and accelerator problems:
evt void Key=2005(int ch, int modifiers)
-evt void DoubleClick=2006(void)
-evt void UpdateUI=2007(void)
-evt void Modified=2008(int position, int modificationType, string text, int length, int linesAdded, int line, int foldLevelNow, int foldLevelPrev)
+evt void DoubleClick=2006(int modifiers, int position, int line)
+evt void UpdateUI=2007(int updated)
+evt void Modified=2008(int position, int modificationType, string text, int length, int linesAdded, int line, int foldLevelNow, int foldLevelPrev, int token, int annotationLinesAdded)
evt void MacroRecord=2009(int message, int wParam, int lParam)
evt void MarginClick=2010(int modifiers, int position, int margin)
evt void NeedShown=2011(int position, int length)
evt void Painted=2013(void)
-evt void UserListSelection=2014(int listType, string text)
+evt void UserListSelection=2014(int listType, string text, int position)
evt void URIDropped=2015(string text)
-evt void DwellStart=2016(int position)
-evt void DwellEnd=2017(int position)
+evt void DwellStart=2016(int position, int x, int y)
+evt void DwellEnd=2017(int position, int x, int y)
evt void Zoom=2018(void)
evt void HotSpotClick=2019(int modifiers, int position)
evt void HotSpotDoubleClick=2020(int modifiers, int position)
evt void CallTipClick=2021(int position)
-evt void AutoCSelection=2022(string text)
+evt void AutoCSelection=2022(string text, int position)
evt void IndicatorClick=2023(int modifiers, int position)
evt void IndicatorRelease=2024(int modifiers, int position)
evt void AutoCCancelled=2025(void)
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 9467025e8..0e6ecc8b7 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -349,6 +349,7 @@ void ScintillaBase::AutoCompleteCompleted() {
scn.wParam = listType;
scn.listType = listType;
Position firstPos = ac.posStart - ac.startLen;
+ scn.position = firstPos;
scn.lParam = firstPos;
scn.text = selected;
NotifyParent(scn);
--
cgit v1.2.3