Skip to content

Commit aba7bcd

Browse files
vinsworldcomVinsWorldcom
andauthored
add missing SCNotification attributes (#254)
* add missing SCNotification attributes (and fix spelling error "SCINTILLANOTFICATION"), fix #253 * fix spelling error in documentation * update default case to include *all* parameters (as the comment indicates) simplify cases for DWELLSTART/END and MARGRIN(RIGHT)CLICK as they are the same returns * add some missing parameters to docs [skip ci] Co-authored-by: VinsWorldcom <vin@vinsworld.com>
1 parent 6faf9aa commit aba7bcd

File tree

2 files changed

+49
-23
lines changed

2 files changed

+49
-23
lines changed

PythonScript/src/ScintillaWrapper.cpp

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
106106

107107
case SCN_CHARADDED:
108108
params["ch"] = notifyCode->ch;
109+
params["characterSource"] = notifyCode->characterSource;
109110
break;
110111

111112
case SCN_SAVEPOINTREACHED:
@@ -170,11 +171,6 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
170171
break;
171172

172173
case SCN_MARGINCLICK:
173-
params["margin"] = notifyCode->margin;
174-
params["position"] = notifyCode->position;
175-
params["modifiers"] = notifyCode->modifiers;
176-
break;
177-
178174
case SCN_MARGINRIGHTCLICK:
179175
params["margin"] = notifyCode->margin;
180176
params["position"] = notifyCode->position;
@@ -190,21 +186,18 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
190186
break;
191187

192188
case SCN_USERLISTSELECTION:
189+
params["position"] = notifyCode->position;
190+
params["ch"] = notifyCode->ch;
193191
params["text"] = notifyCode->text;
194192
params["listType"] = notifyCode->listType;
195-
params["position"] = notifyCode->position;
193+
params["listCompletionMethod"] = notifyCode->listCompletionMethod;
196194
break;
197195

198196
case SCN_URIDROPPED:
199197
params["text"] = notifyCode->text;
200198
break;
201199

202200
case SCN_DWELLSTART:
203-
params["position"] = notifyCode->position;
204-
params["x"] = notifyCode->x;
205-
params["y"] = notifyCode->y;
206-
break;
207-
208201
case SCN_DWELLEND:
209202
params["position"] = notifyCode->position;
210203
params["x"] = notifyCode->x;
@@ -232,8 +225,10 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
232225
break;
233226

234227
case SCN_AUTOCSELECTION:
228+
params["position"] = notifyCode->position;
229+
params["ch"] = notifyCode->ch;
235230
params["text"] = notifyCode->text;
236-
params["position"] = notifyCode->position;
231+
params["listCompletionMethod"] = notifyCode->listCompletionMethod;
237232
break;
238233

239234
case SCN_AUTOCCANCELLED:
@@ -246,9 +241,20 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
246241
case SCN_FOCUSOUT:
247242
break;
248243

244+
case SCN_AUTOCCOMPLETED:
245+
params["listCompletionMethod"] = notifyCode->listCompletionMethod;
246+
break;
247+
248+
case SCN_AUTOCSELECTIONCHANGE:
249+
params["position"] = notifyCode->position;
250+
params["text"] = notifyCode->text;
251+
params["listType"] = notifyCode->listType;
252+
249253
default:
250254
// Unknown notification, so just fill in all the parameters.
251255
params["position"] = notifyCode->position;
256+
params["ch"] = notifyCode->ch;
257+
params["modifiers"] = notifyCode->modifiers;
252258
params["modificationType"] = notifyCode->modificationType;
253259
if (notifyCode->text)
254260
{
@@ -258,18 +264,21 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
258264
}
259265
params["length"] = notifyCode->length;
260266
params["linesAdded"] = notifyCode->linesAdded;
267+
params["message"] = notifyCode->message;
268+
params["wParam"] = notifyCode->wParam;
269+
params["lParam"] = notifyCode->lParam;
261270
params["line"] = notifyCode->line;
262271
params["foldLevelNow"] = notifyCode->foldLevelNow;
263272
params["foldLevelPrev"] = notifyCode->foldLevelPrev;
264-
params["annotationLinesAdded"] = notifyCode->annotationLinesAdded;
273+
params["margin"] = notifyCode->margin;
265274
params["listType"] = notifyCode->listType;
266-
params["message"] = notifyCode->message;
267-
params["wParam"] = notifyCode->wParam;
268-
params["lParam"] = notifyCode->lParam;
269-
params["modifiers"] = notifyCode->modifiers;
270-
params["token"] = notifyCode->token;
271275
params["x"] = notifyCode->x;
272276
params["y"] = notifyCode->y;
277+
params["token"] = notifyCode->token;
278+
params["annotationLinesAdded"] = notifyCode->annotationLinesAdded;
279+
params["updated"] = notifyCode->updated;
280+
params["listCompletionMethod"] = notifyCode->listCompletionMethod;
281+
params["characterSource"] = notifyCode->characterSource;
273282
break;
274283
}
275284

docs/source/enums.rst

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ STATUSBARSECTION
5959

6060
SCINTILLANOTIFICATION
6161
---------------------
62-
.. _SCINTILLANOTFICATION:
63-
.. class:: SCINTILLANOTFICATION
62+
.. _SCINTILLANOTIFICATION:
63+
.. class:: SCINTILLANOTIFICATION
6464
.. attribute:: SCINTILLANOTIFICATION.STYLENEEDED
6565

6666
Arguments contains: ``position``
6767

6868
.. attribute:: SCINTILLANOTIFICATION.CHARADDED
6969

70-
Arguments contains: ``ch`` - the character added (as an int)
70+
Arguments contains: ``ch`` - the character added (as an int), ``characterSource``
7171

7272
.. attribute:: SCINTILLANOTIFICATION.SAVEPOINTREACHED
7373

@@ -85,6 +85,8 @@ SCINTILLANOTIFICATION
8585

8686
.. attribute:: SCINTILLANOTIFICATION.UPDATEUI
8787

88+
Arguments contains: ``updated``
89+
8890
.. attribute:: SCINTILLANOTIFICATION.MODIFIED
8991

9092
Arguments contains: ``position``, ``modificationType`` (a set of flags from :class:`MODIFICATIONFLAGS`), ``text``, ``length``, ``linesAdded``, ``line``, ``foldLevelNow``, ``foldLevelPrev``,
@@ -104,17 +106,21 @@ SCINTILLANOTIFICATION
104106

105107
.. attribute:: SCINTILLANOTIFICATION.NEEDSHOWN
106108

109+
Arguments contains: ``position``, ``length``
110+
107111
.. attribute:: SCINTILLANOTIFICATION.PAINTED
108112

109113
Note: Because Scintilla events are processed by Python asynchronously, care must be taken if handling a callback for this event
110114
- the window may have just been painted, or it may have been painted again since etc.
111115

112116
.. attribute:: SCINTILLANOTIFICATION.USERLISTSELECTION
113117

114-
Arguments contains: ``text``, ``listType``, ``position``
118+
Arguments contains: ``position``, ``ch``, ``text``, ``listType``, ``listCompletionMethod``
115119

116120
.. attribute:: SCINTILLANOTIFICATION.URIDROPPED
117121

122+
Arguments contains: ``text``
123+
118124
.. attribute:: SCINTILLANOTIFICATION.DWELLSTART
119125

120126
Arguments contains: ``position``, ``x``, ``y``
@@ -139,12 +145,16 @@ SCINTILLANOTIFICATION
139145

140146
.. attribute:: SCINTILLANOTIFICATION.AUTOCSELECTION
141147

142-
Arguments contains: ``text``, ``position``
148+
Arguments contains: ``position``, ``ch``, ``text``, ``listCompletionMethod``
143149

144150
.. attribute:: SCINTILLANOTIFICATION.INDICATORCLICK
145151

152+
Arguments contains: ``position``, ``modifiers``
153+
146154
.. attribute:: SCINTILLANOTIFICATION.INDICATORRELEASE
147155

156+
Arguments contains: ``position``, ``modifiers``
157+
148158
.. attribute:: SCINTILLANOTIFICATION.AUTOCCANCELLED
149159

150160
.. attribute:: SCINTILLANOTIFICATION.AUTOCCHARDELETED
@@ -153,6 +163,13 @@ SCINTILLANOTIFICATION
153163

154164
.. attribute:: SCINTILLANOTIFICATION.FOCUSOUT
155165

166+
.. attribute:: SCINTILLANOTIFICATION.AUTOCOMPLETED
167+
168+
Arguments contains: ``listCompletionMethod``
169+
170+
.. attribute:: SCINTILLANOTIFICATION.AUTOCSELECTIONCHANGE
171+
172+
Arguments contains: ``position``, ``text``, ``listType``
156173

157174
SCINTILLAMESSAGE
158175
----------------

0 commit comments

Comments
 (0)