1 ////////////////////////////////////////////////////////////////////////////
3 // Purpose: A wxWindows implementation of Scintilla. This class is the
4 // one meant to be used directly by wx applications. It does not
5 // derive directly from the Scintilla classes, and in fact there
6 // is no mention of Scintilla classes at all in this header.
7 // This class delegates all method calls and events to the
8 // Scintilla objects and so forth. This allows the use of
9 // Scintilla without polluting the namespace with all the
10 // classes and itentifiers from Scintilla.
14 // Created: 13-Jan-2000
16 // Copyright: (c) 2000 by Total Control Software
17 // Licence: wxWindows license
18 /////////////////////////////////////////////////////////////////////////////
26 //----------------------------------------------------------------------
27 // BEGIN generated section. The following code is automatically generated
28 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
31 #define wxSTC_INVALID_POSITION -1
33 // Define start of Scintilla messages to be greater than all edit (EM_*) messages
34 // as many EM_ messages can be used although that use is deprecated.
35 #define wxSTC_START 2000
36 #define wxSTC_OPTIONAL_START 3000
37 #define wxSTC_LEXER_START 4000
38 #define wxSTC_CMD_REDO 2011
39 #define wxSTC_CMD_SELECTALL 2013
40 #define wxSTC_WS_INVISIBLE 0
41 #define wxSTC_WS_VISIBLEALWAYS 1
42 #define wxSTC_WS_VISIBLEAFTERINDENT 2
43 #define wxSTC_EOL_CRLF 0
44 #define wxSTC_EOL_CR 1
45 #define wxSTC_EOL_LF 2
47 // The SC_CP_UTF8 value can be used to enter Unicode mode.
48 // This is the same value as CP_UTF8 in Windows
49 #define wxSTC_CP_UTF8 65001
50 #define wxSTC_MARKER_MAX 31
51 #define wxSTC_MARK_CIRCLE 0
52 #define wxSTC_MARK_ROUNDRECT 1
53 #define wxSTC_MARK_ARROW 2
54 #define wxSTC_MARK_SMALLRECT 3
55 #define wxSTC_MARK_SHORTARROW 4
56 #define wxSTC_MARK_EMPTY 5
57 #define wxSTC_MARK_ARROWDOWN 6
58 #define wxSTC_MARK_MINUS 7
59 #define wxSTC_MARK_PLUS 8
61 // Shapes used for outlining column
62 #define wxSTC_MARK_VLINE 9
63 #define wxSTC_MARK_LCORNER 10
64 #define wxSTC_MARK_TCORNER 11
65 #define wxSTC_MARK_BOXPLUS 12
66 #define wxSTC_MARK_BOXPLUSCONNECTED 13
67 #define wxSTC_MARK_BOXMINUS 14
68 #define wxSTC_MARK_BOXMINUSCONNECTED 15
69 #define wxSTC_MARK_LCORNERCURVE 16
70 #define wxSTC_MARK_TCORNERCURVE 17
71 #define wxSTC_MARK_CIRCLEPLUS 18
72 #define wxSTC_MARK_CIRCLEPLUSCONNECTED 19
73 #define wxSTC_MARK_CIRCLEMINUS 20
74 #define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
75 #define wxSTC_MARK_CHARACTER 10000
77 // Markers used for outlining column
78 #define wxSTC_MARKNUM_FOLDEREND 25
79 #define wxSTC_MARKNUM_FOLDEROPENMID 26
80 #define wxSTC_MARKNUM_FOLDERMIDTAIL 27
81 #define wxSTC_MARKNUM_FOLDERTAIL 28
82 #define wxSTC_MARKNUM_FOLDERSUB 29
83 #define wxSTC_MARKNUM_FOLDER 30
84 #define wxSTC_MARKNUM_FOLDEROPEN 31
85 #define wxSTC_MARGIN_SYMBOL 0
86 #define wxSTC_MARGIN_NUMBER 1
88 // Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles.
89 // Styles 38 and 39 are for future use.
90 #define wxSTC_STYLE_DEFAULT 32
91 #define wxSTC_STYLE_LINENUMBER 33
92 #define wxSTC_STYLE_BRACELIGHT 34
93 #define wxSTC_STYLE_BRACEBAD 35
94 #define wxSTC_STYLE_CONTROLCHAR 36
95 #define wxSTC_STYLE_INDENTGUIDE 37
96 #define wxSTC_STYLE_LASTPREDEFINED 39
97 #define wxSTC_STYLE_MAX 127
99 // Character set identifiers are used in StyleSetCharacterSet.
100 // The values are the same as the Windows *_CHARSET values.
101 #define wxSTC_CHARSET_ANSI 0
102 #define wxSTC_CHARSET_DEFAULT 1
103 #define wxSTC_CHARSET_BALTIC 186
104 #define wxSTC_CHARSET_CHINESEBIG5 136
105 #define wxSTC_CHARSET_EASTEUROPE 238
106 #define wxSTC_CHARSET_GB2312 134
107 #define wxSTC_CHARSET_GREEK 161
108 #define wxSTC_CHARSET_HANGUL 129
109 #define wxSTC_CHARSET_MAC 77
110 #define wxSTC_CHARSET_OEM 255
111 #define wxSTC_CHARSET_RUSSIAN 204
112 #define wxSTC_CHARSET_SHIFTJIS 128
113 #define wxSTC_CHARSET_SYMBOL 2
114 #define wxSTC_CHARSET_TURKISH 162
115 #define wxSTC_CHARSET_JOHAB 130
116 #define wxSTC_CHARSET_HEBREW 177
117 #define wxSTC_CHARSET_ARABIC 178
118 #define wxSTC_CHARSET_VIETNAMESE 163
119 #define wxSTC_CHARSET_THAI 222
120 #define wxSTC_CASE_MIXED 0
121 #define wxSTC_CASE_UPPER 1
122 #define wxSTC_CASE_LOWER 2
123 #define wxSTC_INDIC_MAX 7
124 #define wxSTC_INDIC_PLAIN 0
125 #define wxSTC_INDIC_SQUIGGLE 1
126 #define wxSTC_INDIC_TT 2
127 #define wxSTC_INDIC_DIAGONAL 3
128 #define wxSTC_INDIC_STRIKE 4
129 #define wxSTC_INDIC0_MASK 32
130 #define wxSTC_INDIC1_MASK 64
131 #define wxSTC_INDIC2_MASK 128
132 #define wxSTC_INDICS_MASK 224
134 // PrintColourMode - use same colours as screen.
135 #define wxSTC_PRINT_NORMAL 0
137 // PrintColourMode - invert the light value of each style for printing.
138 #define wxSTC_PRINT_INVERTLIGHT 1
140 // PrintColourMode - force black text on white background for printing.
141 #define wxSTC_PRINT_BLACKONWHITE 2
143 // PrintColourMode - text stays coloured, but all background is forced to be white for printing.
144 #define wxSTC_PRINT_COLOURONWHITE 3
146 // PrintColourMode - only the default-background is forced to be white for printing.
147 #define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4
148 #define wxSTC_FIND_WHOLEWORD 2
149 #define wxSTC_FIND_MATCHCASE 4
150 #define wxSTC_FIND_WORDSTART 0x00100000
151 #define wxSTC_FIND_REGEXP 0x00200000
152 #define wxSTC_CMD_UNDO 2176
153 #define wxSTC_CMD_CUT 2177
154 #define wxSTC_CMD_COPY 2178
155 #define wxSTC_CMD_PASTE 2179
156 #define wxSTC_FOLDLEVELBASE 0x400
157 #define wxSTC_FOLDLEVELWHITEFLAG 0x1000
158 #define wxSTC_FOLDLEVELHEADERFLAG 0x2000
159 #define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF
160 #define wxSTC_TIME_FOREVER 10000000
161 #define wxSTC_CMD_LINEDOWN 2300
162 #define wxSTC_CMD_LINEDOWNEXTEND 2301
163 #define wxSTC_CMD_LINEUP 2302
164 #define wxSTC_CMD_LINEUPEXTEND 2303
165 #define wxSTC_CMD_CHARLEFT 2304
166 #define wxSTC_CMD_CHARLEFTEXTEND 2305
167 #define wxSTC_CMD_CHARRIGHT 2306
168 #define wxSTC_CMD_CHARRIGHTEXTEND 2307
169 #define wxSTC_CMD_WORDLEFT 2308
170 #define wxSTC_CMD_WORDLEFTEXTEND 2309
171 #define wxSTC_CMD_WORDRIGHT 2310
172 #define wxSTC_CMD_WORDRIGHTEXTEND 2311
173 #define wxSTC_CMD_HOME 2312
174 #define wxSTC_CMD_HOMEEXTEND 2313
175 #define wxSTC_CMD_LINEEND 2314
176 #define wxSTC_CMD_LINEENDEXTEND 2315
177 #define wxSTC_CMD_DOCUMENTSTART 2316
178 #define wxSTC_CMD_DOCUMENTSTARTEXTEND 2317
179 #define wxSTC_CMD_DOCUMENTEND 2318
180 #define wxSTC_CMD_DOCUMENTENDEXTEND 2319
181 #define wxSTC_CMD_PAGEUP 2320
182 #define wxSTC_CMD_PAGEUPEXTEND 2321
183 #define wxSTC_CMD_PAGEDOWN 2322
184 #define wxSTC_CMD_PAGEDOWNEXTEND 2323
185 #define wxSTC_CMD_EDITTOGGLEOVERTYPE 2324
186 #define wxSTC_CMD_CANCEL 2325
187 #define wxSTC_CMD_DELETEBACK 2326
188 #define wxSTC_CMD_TAB 2327
189 #define wxSTC_CMD_BACKTAB 2328
190 #define wxSTC_CMD_NEWLINE 2329
191 #define wxSTC_CMD_FORMFEED 2330
192 #define wxSTC_CMD_VCHOME 2331
193 #define wxSTC_CMD_VCHOMEEXTEND 2332
194 #define wxSTC_CMD_ZOOMIN 2333
195 #define wxSTC_CMD_ZOOMOUT 2334
196 #define wxSTC_CMD_DELWORDLEFT 2335
197 #define wxSTC_CMD_DELWORDRIGHT 2336
198 #define wxSTC_CMD_LINECUT 2337
199 #define wxSTC_CMD_LINEDELETE 2338
200 #define wxSTC_CMD_LINETRANSPOSE 2339
201 #define wxSTC_CMD_LOWERCASE 2340
202 #define wxSTC_CMD_UPPERCASE 2341
203 #define wxSTC_CMD_LINESCROLLDOWN 2342
204 #define wxSTC_CMD_LINESCROLLUP 2343
205 #define wxSTC_EDGE_NONE 0
206 #define wxSTC_EDGE_LINE 1
207 #define wxSTC_EDGE_BACKGROUND 2
209 // Show caret within N lines of edge when it's scrolled to view
210 // If CARET_SLOP not set then centre caret on screen when it's
212 #define wxSTC_CARET_SLOP 0x01
215 #define wxSTC_CARET_CENTER 0x02
217 // If CARET_SLOP also set then reposition whenever outside slop border
218 // If CARET_SLOP not set then recentre even when visible
219 #define wxSTC_CARET_STRICT 0x04
221 // If CARET_XEVEN set then both left and right margins are given equal weight
222 // rather than favouring left following behaviour.
223 #define wxSTC_CARET_XEVEN 0x08
225 // If CARET_XJUMPS set then when caret reaches the margin the display jumps
226 // enough to leave the caret solidly within the display.
227 #define wxSTC_CARET_XJUMPS 0x10
228 #define wxSTC_CURSORNORMAL -1
229 #define wxSTC_CURSORWAIT 3
231 // Constants for use with SetVisiblePolicy, similar to SetCaretPolicy
232 #define wxSTC_VISIBLE_SLOP 0x01
233 #define wxSTC_VISIBLE_STRICT 0x04
236 // Type of modification and the action which caused the modification
237 // These are defined as a bit mask to make it easy to specify which notifications are wanted.
238 // One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
239 #define wxSTC_MOD_INSERTTEXT 0x1
240 #define wxSTC_MOD_DELETETEXT 0x2
241 #define wxSTC_MOD_CHANGESTYLE 0x4
242 #define wxSTC_MOD_CHANGEFOLD 0x8
243 #define wxSTC_PERFORMED_USER 0x10
244 #define wxSTC_PERFORMED_UNDO 0x20
245 #define wxSTC_PERFORMED_REDO 0x40
246 #define wxSTC_LASTSTEPINUNDOREDO 0x100
247 #define wxSTC_MOD_CHANGEMARKER 0x200
248 #define wxSTC_MOD_BEFOREINSERT 0x400
249 #define wxSTC_MOD_BEFOREDELETE 0x800
250 #define wxSTC_MODEVENTMASKALL 0xF77
252 // Symbolic key codes and modifier flags
253 // ASCII and other printable characters below 256
254 // Extended keys above 300
255 #define wxSTC_KEY_DOWN 300
256 #define wxSTC_KEY_UP 301
257 #define wxSTC_KEY_LEFT 302
258 #define wxSTC_KEY_RIGHT 303
259 #define wxSTC_KEY_HOME 304
260 #define wxSTC_KEY_END 305
261 #define wxSTC_KEY_PRIOR 306
262 #define wxSTC_KEY_NEXT 307
263 #define wxSTC_KEY_DELETE 308
264 #define wxSTC_KEY_INSERT 309
265 #define wxSTC_KEY_ESCAPE 7
266 #define wxSTC_KEY_BACK 8
267 #define wxSTC_KEY_TAB 9
268 #define wxSTC_KEY_RETURN 13
269 #define wxSTC_KEY_ADD 310
270 #define wxSTC_KEY_SUBTRACT 311
271 #define wxSTC_KEY_DIVIDE 312
272 #define wxSTC_SCMOD_SHIFT 1
273 #define wxSTC_SCMOD_CTRL 2
274 #define wxSTC_SCMOD_ALT 4
277 #define wxSTC_LEX_CONTAINER 0
278 #define wxSTC_LEX_NULL 1
279 #define wxSTC_LEX_PYTHON 2
280 #define wxSTC_LEX_CPP 3
281 #define wxSTC_LEX_HTML 4
282 #define wxSTC_LEX_XML 5
283 #define wxSTC_LEX_PERL 6
284 #define wxSTC_LEX_SQL 7
285 #define wxSTC_LEX_VB 8
286 #define wxSTC_LEX_PROPERTIES 9
287 #define wxSTC_LEX_ERRORLIST 10
288 #define wxSTC_LEX_MAKEFILE 11
289 #define wxSTC_LEX_BATCH 12
290 #define wxSTC_LEX_XCODE 13
291 #define wxSTC_LEX_LATEX 14
292 #define wxSTC_LEX_LUA 15
293 #define wxSTC_LEX_DIFF 16
294 #define wxSTC_LEX_CONF 17
295 #define wxSTC_LEX_PASCAL 18
296 #define wxSTC_LEX_AVE 19
297 #define wxSTC_LEX_ADA 20
298 #define wxSTC_LEX_LISP 21
299 #define wxSTC_LEX_RUBY 22
300 #define wxSTC_LEX_EIFFEL 23
301 #define wxSTC_LEX_EIFFELKW 24
302 #define wxSTC_LEX_TCL 25
303 #define wxSTC_LEX_NNCRONTAB 26
305 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
306 // value assigned in sequence from SCLEX_AUTOMATIC+1.
307 #define wxSTC_LEX_AUTOMATIC 1000
309 // Lexical states for SCLEX_PYTHON
310 #define wxSTC_P_DEFAULT 0
311 #define wxSTC_P_COMMENTLINE 1
312 #define wxSTC_P_NUMBER 2
313 #define wxSTC_P_STRING 3
314 #define wxSTC_P_CHARACTER 4
315 #define wxSTC_P_WORD 5
316 #define wxSTC_P_TRIPLE 6
317 #define wxSTC_P_TRIPLEDOUBLE 7
318 #define wxSTC_P_CLASSNAME 8
319 #define wxSTC_P_DEFNAME 9
320 #define wxSTC_P_OPERATOR 10
321 #define wxSTC_P_IDENTIFIER 11
322 #define wxSTC_P_COMMENTBLOCK 12
323 #define wxSTC_P_STRINGEOL 13
325 // Lexical states for SCLEX_CPP, SCLEX_VB
326 #define wxSTC_C_DEFAULT 0
327 #define wxSTC_C_COMMENT 1
328 #define wxSTC_C_COMMENTLINE 2
329 #define wxSTC_C_COMMENTDOC 3
330 #define wxSTC_C_NUMBER 4
331 #define wxSTC_C_WORD 5
332 #define wxSTC_C_STRING 6
333 #define wxSTC_C_CHARACTER 7
334 #define wxSTC_C_UUID 8
335 #define wxSTC_C_PREPROCESSOR 9
336 #define wxSTC_C_OPERATOR 10
337 #define wxSTC_C_IDENTIFIER 11
338 #define wxSTC_C_STRINGEOL 12
339 #define wxSTC_C_VERBATIM 13
340 #define wxSTC_C_REGEX 14
341 #define wxSTC_C_COMMENTLINEDOC 15
342 #define wxSTC_C_WORD2 16
343 #define wxSTC_C_COMMENTDOCKEYWORD 17
344 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
346 // Lexical states for SCLEX_HTML, SCLEX_XML
347 #define wxSTC_H_DEFAULT 0
348 #define wxSTC_H_TAG 1
349 #define wxSTC_H_TAGUNKNOWN 2
350 #define wxSTC_H_ATTRIBUTE 3
351 #define wxSTC_H_ATTRIBUTEUNKNOWN 4
352 #define wxSTC_H_NUMBER 5
353 #define wxSTC_H_DOUBLESTRING 6
354 #define wxSTC_H_SINGLESTRING 7
355 #define wxSTC_H_OTHER 8
356 #define wxSTC_H_COMMENT 9
357 #define wxSTC_H_ENTITY 10
360 #define wxSTC_H_TAGEND 11
361 #define wxSTC_H_XMLSTART 12
362 #define wxSTC_H_XMLEND 13
363 #define wxSTC_H_SCRIPT 14
364 #define wxSTC_H_ASP 15
365 #define wxSTC_H_ASPAT 16
366 #define wxSTC_H_CDATA 17
367 #define wxSTC_H_QUESTION 18
370 #define wxSTC_H_VALUE 19
373 #define wxSTC_H_XCCOMMENT 20
376 #define wxSTC_H_SGML_DEFAULT 21
377 #define wxSTC_H_SGML_COMMAND 22
378 #define wxSTC_H_SGML_1ST_PARAM 23
379 #define wxSTC_H_SGML_DOUBLESTRING 24
380 #define wxSTC_H_SGML_SIMPLESTRING 25
381 #define wxSTC_H_SGML_ERROR 26
382 #define wxSTC_H_SGML_SPECIAL 27
383 #define wxSTC_H_SGML_ENTITY 28
384 #define wxSTC_H_SGML_COMMENT 29
385 #define wxSTC_H_SGML_1ST_PARAM_COMMENT 30
386 #define wxSTC_H_SGML_BLOCK_DEFAULT 31
388 // Embedded Javascript
389 #define wxSTC_HJ_START 40
390 #define wxSTC_HJ_DEFAULT 41
391 #define wxSTC_HJ_COMMENT 42
392 #define wxSTC_HJ_COMMENTLINE 43
393 #define wxSTC_HJ_COMMENTDOC 44
394 #define wxSTC_HJ_NUMBER 45
395 #define wxSTC_HJ_WORD 46
396 #define wxSTC_HJ_KEYWORD 47
397 #define wxSTC_HJ_DOUBLESTRING 48
398 #define wxSTC_HJ_SINGLESTRING 49
399 #define wxSTC_HJ_SYMBOLS 50
400 #define wxSTC_HJ_STRINGEOL 51
401 #define wxSTC_HJ_REGEX 52
404 #define wxSTC_HJA_START 55
405 #define wxSTC_HJA_DEFAULT 56
406 #define wxSTC_HJA_COMMENT 57
407 #define wxSTC_HJA_COMMENTLINE 58
408 #define wxSTC_HJA_COMMENTDOC 59
409 #define wxSTC_HJA_NUMBER 60
410 #define wxSTC_HJA_WORD 61
411 #define wxSTC_HJA_KEYWORD 62
412 #define wxSTC_HJA_DOUBLESTRING 63
413 #define wxSTC_HJA_SINGLESTRING 64
414 #define wxSTC_HJA_SYMBOLS 65
415 #define wxSTC_HJA_STRINGEOL 66
416 #define wxSTC_HJA_REGEX 67
419 #define wxSTC_HB_START 70
420 #define wxSTC_HB_DEFAULT 71
421 #define wxSTC_HB_COMMENTLINE 72
422 #define wxSTC_HB_NUMBER 73
423 #define wxSTC_HB_WORD 74
424 #define wxSTC_HB_STRING 75
425 #define wxSTC_HB_IDENTIFIER 76
426 #define wxSTC_HB_STRINGEOL 77
429 #define wxSTC_HBA_START 80
430 #define wxSTC_HBA_DEFAULT 81
431 #define wxSTC_HBA_COMMENTLINE 82
432 #define wxSTC_HBA_NUMBER 83
433 #define wxSTC_HBA_WORD 84
434 #define wxSTC_HBA_STRING 85
435 #define wxSTC_HBA_IDENTIFIER 86
436 #define wxSTC_HBA_STRINGEOL 87
439 #define wxSTC_HP_START 90
440 #define wxSTC_HP_DEFAULT 91
441 #define wxSTC_HP_COMMENTLINE 92
442 #define wxSTC_HP_NUMBER 93
443 #define wxSTC_HP_STRING 94
444 #define wxSTC_HP_CHARACTER 95
445 #define wxSTC_HP_WORD 96
446 #define wxSTC_HP_TRIPLE 97
447 #define wxSTC_HP_TRIPLEDOUBLE 98
448 #define wxSTC_HP_CLASSNAME 99
449 #define wxSTC_HP_DEFNAME 100
450 #define wxSTC_HP_OPERATOR 101
451 #define wxSTC_HP_IDENTIFIER 102
454 #define wxSTC_HPA_START 105
455 #define wxSTC_HPA_DEFAULT 106
456 #define wxSTC_HPA_COMMENTLINE 107
457 #define wxSTC_HPA_NUMBER 108
458 #define wxSTC_HPA_STRING 109
459 #define wxSTC_HPA_CHARACTER 110
460 #define wxSTC_HPA_WORD 111
461 #define wxSTC_HPA_TRIPLE 112
462 #define wxSTC_HPA_TRIPLEDOUBLE 113
463 #define wxSTC_HPA_CLASSNAME 114
464 #define wxSTC_HPA_DEFNAME 115
465 #define wxSTC_HPA_OPERATOR 116
466 #define wxSTC_HPA_IDENTIFIER 117
469 #define wxSTC_HPHP_DEFAULT 118
470 #define wxSTC_HPHP_HSTRING 119
471 #define wxSTC_HPHP_SIMPLESTRING 120
472 #define wxSTC_HPHP_WORD 121
473 #define wxSTC_HPHP_NUMBER 122
474 #define wxSTC_HPHP_VARIABLE 123
475 #define wxSTC_HPHP_COMMENT 124
476 #define wxSTC_HPHP_COMMENTLINE 125
477 #define wxSTC_HPHP_HSTRING_VARIABLE 126
478 #define wxSTC_HPHP_OPERATOR 127
480 // Lexical states for SCLEX_PERL
481 #define wxSTC_PL_DEFAULT 0
482 #define wxSTC_PL_ERROR 1
483 #define wxSTC_PL_COMMENTLINE 2
484 #define wxSTC_PL_POD 3
485 #define wxSTC_PL_NUMBER 4
486 #define wxSTC_PL_WORD 5
487 #define wxSTC_PL_STRING 6
488 #define wxSTC_PL_CHARACTER 7
489 #define wxSTC_PL_PUNCTUATION 8
490 #define wxSTC_PL_PREPROCESSOR 9
491 #define wxSTC_PL_OPERATOR 10
492 #define wxSTC_PL_IDENTIFIER 11
493 #define wxSTC_PL_SCALAR 12
494 #define wxSTC_PL_ARRAY 13
495 #define wxSTC_PL_HASH 14
496 #define wxSTC_PL_SYMBOLTABLE 15
497 #define wxSTC_PL_REGEX 17
498 #define wxSTC_PL_REGSUBST 18
499 #define wxSTC_PL_LONGQUOTE 19
500 #define wxSTC_PL_BACKTICKS 20
501 #define wxSTC_PL_DATASECTION 21
502 #define wxSTC_PL_HERE_DELIM 22
503 #define wxSTC_PL_HERE_Q 23
504 #define wxSTC_PL_HERE_QQ 24
505 #define wxSTC_PL_HERE_QX 25
506 #define wxSTC_PL_STRING_Q 26
507 #define wxSTC_PL_STRING_QQ 27
508 #define wxSTC_PL_STRING_QX 28
509 #define wxSTC_PL_STRING_QR 29
510 #define wxSTC_PL_STRING_QW 30
512 // Lexical states for SCLEX_LATEX
513 #define wxSTC_L_DEFAULT 0
514 #define wxSTC_L_COMMAND 1
515 #define wxSTC_L_TAG 2
516 #define wxSTC_L_MATH 3
517 #define wxSTC_L_COMMENT 4
519 // Lexical states for SCLEX_LUA
520 #define wxSTC_LUA_DEFAULT 0
521 #define wxSTC_LUA_COMMENT 1
522 #define wxSTC_LUA_COMMENTLINE 2
523 #define wxSTC_LUA_COMMENTDOC 3
524 #define wxSTC_LUA_NUMBER 4
525 #define wxSTC_LUA_WORD 5
526 #define wxSTC_LUA_STRING 6
527 #define wxSTC_LUA_CHARACTER 7
528 #define wxSTC_LUA_LITERALSTRING 8
529 #define wxSTC_LUA_PREPROCESSOR 9
530 #define wxSTC_LUA_OPERATOR 10
531 #define wxSTC_LUA_IDENTIFIER 11
532 #define wxSTC_LUA_STRINGEOL 12
534 // Lexical states for SCLEX_ERRORLIST
535 #define wxSTC_ERR_DEFAULT 0
536 #define wxSTC_ERR_PYTHON 1
537 #define wxSTC_ERR_GCC 2
538 #define wxSTC_ERR_MS 3
539 #define wxSTC_ERR_CMD 4
540 #define wxSTC_ERR_BORLAND 5
541 #define wxSTC_ERR_PERL 6
542 #define wxSTC_ERR_NET 7
543 #define wxSTC_ERR_LUA 8
544 #define wxSTC_ERR_DIFF_CHANGED 10
545 #define wxSTC_ERR_DIFF_ADDITION 11
546 #define wxSTC_ERR_DIFF_DELETION 12
547 #define wxSTC_ERR_DIFF_MESSAGE 13
549 // Lexical states for SCLEX_BATCH
550 #define wxSTC_BAT_DEFAULT 0
551 #define wxSTC_BAT_COMMENT 1
552 #define wxSTC_BAT_WORD 2
553 #define wxSTC_BAT_LABEL 3
554 #define wxSTC_BAT_HIDE 4
555 #define wxSTC_BAT_COMMAND 5
556 #define wxSTC_BAT_IDENTIFIER 6
557 #define wxSTC_BAT_OPERATOR 7
559 // Lexical states for SCLEX_MAKEFILE
560 #define wxSTC_MAKE_DEFAULT 0
561 #define wxSTC_MAKE_COMMENT 1
562 #define wxSTC_MAKE_PREPROCESSOR 2
563 #define wxSTC_MAKE_IDENTIFIER 3
564 #define wxSTC_MAKE_OPERATOR 4
565 #define wxSTC_MAKE_TARGET 5
566 #define wxSTC_MAKE_IDEOL 9
568 // Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer)
569 #define wxSTC_CONF_DEFAULT 0
570 #define wxSTC_CONF_COMMENT 1
571 #define wxSTC_CONF_NUMBER 2
572 #define wxSTC_CONF_IDENTIFIER 3
573 #define wxSTC_CONF_EXTENSION 4
574 #define wxSTC_CONF_PARAMETER 5
575 #define wxSTC_CONF_STRING 6
576 #define wxSTC_CONF_OPERATOR 7
577 #define wxSTC_CONF_IP 8
578 #define wxSTC_CONF_DIRECTIVE 9
581 #define wxSTC_AVE_DEFAULT 0
582 #define wxSTC_AVE_COMMENT 1
583 #define wxSTC_AVE_NUMBER 2
584 #define wxSTC_AVE_WORD 3
585 #define wxSTC_AVE_KEYWORD 4
586 #define wxSTC_AVE_STATEMENT 5
587 #define wxSTC_AVE_STRING 6
588 #define wxSTC_AVE_ENUM 7
589 #define wxSTC_AVE_STRINGEOL 8
590 #define wxSTC_AVE_IDENTIFIER 9
591 #define wxSTC_AVE_OPERATOR 10
593 // Lexical states for SCLEX_ADA
594 #define wxSTC_ADA_DEFAULT 0
595 #define wxSTC_ADA_COMMENT 1
596 #define wxSTC_ADA_NUMBER 2
597 #define wxSTC_ADA_WORD 3
598 #define wxSTC_ADA_STRING 4
599 #define wxSTC_ADA_CHARACTER 5
600 #define wxSTC_ADA_OPERATOR 6
601 #define wxSTC_ADA_IDENTIFIER 7
602 #define wxSTC_ADA_STRINGEOL 8
604 // Lexical states for SCLEX_LISP
605 #define wxSTC_LISP_DEFAULT 0
606 #define wxSTC_LISP_COMMENT 1
607 #define wxSTC_LISP_NUMBER 2
608 #define wxSTC_LISP_KEYWORD 3
609 #define wxSTC_LISP_STRING 6
610 #define wxSTC_LISP_STRINGEOL 8
611 #define wxSTC_LISP_IDENTIFIER 9
612 #define wxSTC_LISP_OPERATOR 10
614 // Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW
615 #define wxSTC_EIFFEL_DEFAULT 0
616 #define wxSTC_EIFFEL_COMMENTLINE 1
617 #define wxSTC_EIFFEL_NUMBER 2
618 #define wxSTC_EIFFEL_WORD 3
619 #define wxSTC_EIFFEL_STRING 4
620 #define wxSTC_EIFFEL_CHARACTER 5
621 #define wxSTC_EIFFEL_OPERATOR 6
622 #define wxSTC_EIFFEL_IDENTIFIER 7
623 #define wxSTC_EIFFEL_STRINGEOL 8
625 // Lexical states for the SCLEX_NNCRONTAB (nnCron crontab Lexer)
626 #define wxSTC_NNCRONTAB_DEFAULT 0
627 #define wxSTC_NNCRONTAB_COMMENT 1
628 #define wxSTC_NNCRONTAB_TASK 2
629 #define wxSTC_NNCRONTAB_SECTION 3
630 #define wxSTC_NNCRONTAB_KEYWORD 4
631 #define wxSTC_NNCRONTAB_MODIFIER 5
632 #define wxSTC_NNCRONTAB_ASTERISK 6
633 #define wxSTC_NNCRONTAB_NUMBER 7
634 #define wxSTC_NNCRONTAB_STRING 8
635 #define wxSTC_NNCRONTAB_ENVIRONMENT 9
636 #define wxSTC_NNCRONTAB_IDENTIFIER 10
638 // END of generated section
639 //----------------------------------------------------------------------
642 #define wxSTC_MASK_FOLDERS ((1 << wxSTC_MARKNUM_FOLDER) | (1 << wxSTC_MARKNUM_FOLDEROPEN))
646 //----------------------------------------------------------------------
648 class ScintillaWX
; // forward declare
650 struct SCNotification
;
653 extern const wxChar
* wxSTCNameStr
;
655 //----------------------------------------------------------------------
657 class wxStyledTextCtrl
: public wxControl
{
661 wxStyledTextCtrl(wxWindow
*parent
, wxWindowID id
,
662 const wxPoint
& pos
= wxDefaultPosition
,
663 const wxSize
& size
= wxDefaultSize
, long style
= 0,
664 const char* name
= "styledtext");
665 %pragma
(python
) addtomethod
= "__init__:self._setOORInfo(self)"
668 wxStyledTextCtrl(wxWindow
*parent
, wxWindowID id
,
669 const wxPoint
& pos
= wxDefaultPosition
,
670 const wxSize
& size
= wxDefaultSize
, long style
= 0,
671 const wxString
& name
= wxSTCNameStr
);
679 //----------------------------------------------------------------------
680 // BEGIN generated section. The following code is automatically generated
681 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
685 // Add text to the document
686 void AddText(const wxString
& text
);
688 // Add array of cells to document
689 void AddStyledText(const wxString
& text
);
691 // Insert string at a position
692 void InsertText(int pos
, const wxString
& text
);
694 // Delete all text in the document
697 // Set all style bytes to 0, remove all folding information
698 void ClearDocumentStyle();
700 // The number of characters in the document
703 // Returns the character byte at the position
704 int GetCharAt(int pos
);
706 // Returns the position of the caret
709 // Returns the position of the opposite end of the selection to the caret
712 // Returns the style byte at the position
713 int GetStyleAt(int pos
);
715 // Redoes the next action on the undo history
718 // Choose between collecting actions into the undo
719 // history and discarding them.
720 void SetUndoCollection(bool collectUndo
);
722 // Select all the text in the document.
725 // Remember the current position in the undo history as the position
726 // at which the document was saved.
729 // Retrieve a buffer of cells.
730 wxString
GetStyledText(int startPos
, int endPos
);
732 // Are there any redoable actions in the undo history.
735 // Retrieve the line number at which a particular marker is located
736 int MarkerLineFromHandle(int handle
);
739 void MarkerDeleteHandle(int handle
);
741 // Is undo history being collected?
742 bool GetUndoCollection();
744 // Are white space characters currently visible?
745 // Returns one of SCWS_* constants.
746 int GetViewWhiteSpace();
748 // Make white space characters invisible, always visible or visible outside indentation.
749 void SetViewWhiteSpace(int viewWS
);
751 // Find the position from a point within the window.
752 int PositionFromPoint(wxPoint pt
);
754 // Find the position from a point within the window but return
755 // INVALID_POSITION if not close to text.
756 int PositionFromPointClose(int x
, int y
);
758 // Set caret to start of a line and ensure it is visible.
759 void GotoLine(int line
);
761 // Set caret to a position and ensure it is visible.
762 void GotoPos(int pos
);
764 // Set the selection anchor to a position. The anchor is the opposite
765 // end of the selection from the caret.
766 void SetAnchor(int posAnchor
);
768 // Retrieve the text of the line containing the caret.
769 // Returns the index of the caret on the line.
771 wxString
GetCurLine(int* OUTPUT
);
773 wxString
GetCurLine(int* linePos
=NULL
);
776 // Retrieve the position of the last correctly styled character.
779 // Convert all line endings in the document to one mode.
780 void ConvertEOLs(int eolMode
);
782 // Retrieve the current end of line mode - one of CRLF, CR, or LF.
785 // Set the current end of line mode.
786 void SetEOLMode(int eolMode
);
788 // Set the current styling position to pos and the styling mask to mask.
789 // The styling mask can be used to protect some bits in each styling byte from
791 void StartStyling(int pos
, int mask
);
793 // Change style from current styling position for length characters to a style
794 // and move the current styling position to after this newly styled segment.
795 void SetStyling(int length
, int style
);
797 // Is drawing done first into a buffer or direct to the screen.
798 bool GetBufferedDraw();
800 // If drawing is buffered then each line of text is drawn into a bitmap buffer
801 // before drawing it to the screen to avoid flicker.
802 void SetBufferedDraw(bool buffered
);
804 // Change the visible size of a tab to be a multiple of the width of a space
806 void SetTabWidth(int tabWidth
);
808 // Retrieve the visible size of a tab.
811 // Set the code page used to interpret the bytes of the document as characters.
812 // The SC_CP_UTF8 value can be used to enter Unicode mode.
813 void SetCodePage(int codePage
);
815 // Set the symbol used for a particular marker number,
816 // and optionally the for and background colours.
817 void MarkerDefine(int markerNumber
, int markerSymbol
,
818 const wxColour
& foreground
= wxNullColour
,
819 const wxColour
& background
= wxNullColour
);
821 // Set the foreground colour used for a particular marker number.
822 void MarkerSetForeground(int markerNumber
, const wxColour
& fore
);
824 // Set the background colour used for a particular marker number.
825 void MarkerSetBackground(int markerNumber
, const wxColour
& back
);
827 // Add a marker to a line.
828 void MarkerAdd(int line
, int markerNumber
);
830 // Delete a marker from a line
831 void MarkerDelete(int line
, int markerNumber
);
833 // Delete all markers with a particular number from all lines
834 void MarkerDeleteAll(int markerNumber
);
836 // Get a bit mask of all the markers set on a line.
837 int MarkerGet(int line
);
839 // Find the next line after lineStart that includes a marker in mask.
840 int MarkerNext(int lineStart
, int markerMask
);
842 // Find the previous line before lineStart that includes a marker in mask.
843 int MarkerPrevious(int lineStart
, int markerMask
);
845 // Set a margin to be either numeric or symbolic.
846 void SetMarginType(int margin
, int marginType
);
848 // Retrieve the type of a margin.
849 int GetMarginType(int margin
);
851 // Set the width of a margin to a width expressed in pixels.
852 void SetMarginWidth(int margin
, int pixelWidth
);
854 // Retrieve the width of a margin in pixels.
855 int GetMarginWidth(int margin
);
857 // Set a mask that determines which markers are displayed in a margin.
858 void SetMarginMask(int margin
, int mask
);
860 // Retrieve the marker mask of a margin.
861 int GetMarginMask(int margin
);
863 // Make a margin sensitive or insensitive to mouse clicks.
864 void SetMarginSensitive(int margin
, bool sensitive
);
866 // Retrieve the mouse click sensitivity of a margin.
867 bool GetMarginSensitive(int margin
);
869 // Clear all the styles and make equivalent to the global default style.
870 void StyleClearAll();
872 // Set the foreground colour of a style.
873 void StyleSetForeground(int style
, const wxColour
& fore
);
875 // Set the background colour of a style.
876 void StyleSetBackground(int style
, const wxColour
& back
);
878 // Set a style to be bold or not.
879 void StyleSetBold(int style
, bool bold
);
881 // Set a style to be italic or not.
882 void StyleSetItalic(int style
, bool italic
);
884 // Set the size of characters of a style.
885 void StyleSetSize(int style
, int sizePoints
);
887 // Set the font of a style.
888 void StyleSetFaceName(int style
, const wxString
& fontName
);
890 // Set a style to have its end of line filled or not.
891 void StyleSetEOLFilled(int style
, bool filled
);
893 // Reset the default style to its state at startup
894 void StyleResetDefault();
896 // Set a style to be underlined or not.
897 void StyleSetUnderline(int style
, bool underline
);
899 // Set a style to be mixed case, or to force upper or lower case.
900 void StyleSetCase(int style
, int caseForce
);
902 // Set the foreground colour of the selection and whether to use this setting.
903 void SetSelForeground(bool useSetting
, const wxColour
& fore
);
905 // Set the background colour of the selection and whether to use this setting.
906 void SetSelBackground(bool useSetting
, const wxColour
& back
);
908 // Set the foreground colour of the caret.
909 void SetCaretForeground(const wxColour
& fore
);
911 // When key+modifier combination km is pressed perform msg.
912 void CmdKeyAssign(int key
, int modifiers
, int cmd
);
914 // When key+modifier combination km do nothing.
915 void CmdKeyClear(int key
, int modifiers
);
917 // Drop all key mappings.
918 void CmdKeyClearAll();
920 // Set the styles for a segment of the document.
921 void SetStyleBytes(int length
, char* styleBytes
);
923 // Set a style to be visible or not.
924 void StyleSetVisible(int style
, bool visible
);
926 // Get the time in milliseconds that the caret is on and off.
927 int GetCaretPeriod();
929 // Get the time in milliseconds that the caret is on and off. 0 = steady on.
930 void SetCaretPeriod(int periodMilliseconds
);
932 // Set the set of characters making up words for when moving or selecting
934 void SetWordChars(const wxString
& characters
);
936 // Start a sequence of actions that is undone and redone as a unit.
938 void BeginUndoAction();
940 // End a sequence of actions that is undone and redone as a unit.
941 void EndUndoAction();
943 // Set an indicator to plain, squiggle or TT.
944 void IndicatorSetStyle(int indic
, int style
);
946 // Retrieve the style of an indicator.
947 int IndicatorGetStyle(int indic
);
949 // Set the foreground colour of an indicator.
950 void IndicatorSetForeground(int indic
, const wxColour
& fore
);
952 // Retrieve the foreground colour of an indicator.
953 wxColour
IndicatorGetForeground(int indic
);
955 // Divide each styling byte into lexical class bits (default:5) and indicator
956 // bits (default:3). If a lexer requires more than 32 lexical states, then this
957 // is used to expand the possible states.
958 void SetStyleBits(int bits
);
960 // Retrieve number of bits in style bytes used to hold the lexical state.
963 // Used to hold extra styling information for each line.
964 void SetLineState(int line
, int state
);
966 // Retrieve the extra styling information for a line.
967 int GetLineState(int line
);
969 // Retrieve the last line number that has line state.
970 int GetMaxLineState();
972 // Is the background of the line containing the caret in a different colour?
973 bool GetCaretLineVisible();
975 // Display the background of the line containing the caret in a different colour.
976 void SetCaretLineVisible(bool show
);
978 // Get the colour of the background of the line containing the caret.
979 wxColour
GetCaretLineBack();
981 // Set the colour of the background of the line containing the caret.
982 void SetCaretLineBack(const wxColour
& back
);
984 // Display a auto-completion list.
985 // The lenEntered parameter indicates how many characters before
986 // the caret should be used to provide context.
987 void AutoCompShow(int lenEntered
, const wxString
& itemList
);
989 // Remove the auto-completion list from the screen.
990 void AutoCompCancel();
992 // Is there an auto-completion list visible?
993 bool AutoCompActive();
995 // Retrieve the position of the caret when the auto-completion list was
997 int AutoCompPosStart();
999 // User has selected an item so remove the list and insert the selection.
1000 void AutoCompComplete();
1002 // Define a set of character that when typed cancel the auto-completion list.
1003 void AutoCompStops(const wxString
& characterSet
);
1005 // Change the separator character in the string setting up an auto-completion
1006 // list. Default is space but can be changed if items contain space.
1007 void AutoCompSetSeparator(int separatorCharacter
);
1009 // Retrieve the auto-completion list separator character.
1010 int AutoCompGetSeparator();
1012 // Select the item in the auto-completion list that starts with a string.
1013 void AutoCompSelect(const wxString
& text
);
1015 // Should the auto-completion list be cancelled if the user backspaces to a
1016 // position before where the box was created.
1017 void AutoCompSetCancelAtStart(bool cancel
);
1019 // Retrieve whether auto-completion cancelled by backspacing before start.
1020 bool AutoCompGetCancelAtStart();
1022 // Define a set of character that when typed fills up the selected word.
1023 void AutoCompSetFillUps(const wxString
& characterSet
);
1025 // Should a single item auto-completion list automatically choose the item.
1026 void AutoCompSetChooseSingle(bool chooseSingle
);
1028 // Retrieve whether a single item auto-completion list automatically choose the item.
1029 bool AutoCompGetChooseSingle();
1031 // Set whether case is significant when performing auto-completion searches.
1032 void AutoCompSetIgnoreCase(bool ignoreCase
);
1034 // Retrieve state of ignore case flag.
1035 bool AutoCompGetIgnoreCase();
1037 // Display a list of strings and send notification when user chooses one.
1038 void UserListShow(int listType
, const wxString
& itemList
);
1040 // Set whether or not autocompletion is hidden automatically when nothing matches
1041 void AutoCompSetAutoHide(bool autoHide
);
1043 // Retrieve whether or not autocompletion is hidden automatically when nothing matches
1044 bool AutoCompGetAutoHide();
1046 // Set the number of spaces used for one level of indentation.
1047 void SetIndent(int indentSize
);
1049 // Retrieve indentation size.
1052 // Indentation will only use space characters if useTabs is false, otherwise
1053 // it will use a combination of tabs and spaces.
1054 void SetUseTabs(bool useTabs
);
1056 // Retrieve whether tabs will be used in indentation.
1059 // Change the indentation of a line to a number of columns.
1060 void SetLineIndentation(int line
, int indentSize
);
1062 // Retrieve the number of columns that a line is indented.
1063 int GetLineIndentation(int line
);
1065 // Retrieve the position before the first non indentation character on a line.
1066 int GetLineIndentPosition(int line
);
1068 // Retrieve the column number of a position, taking tab width into account.
1069 int GetColumn(int pos
);
1071 // Show or hide the horizontal scroll bar.
1072 void SetUseHorizontalScrollBar(bool show
);
1074 // Is the horizontal scroll bar visible?
1075 bool GetUseHorizontalScrollBar();
1077 // Show or hide indentation guides.
1078 void SetIndentationGuides(bool show
);
1080 // Are the indentation guides visible?
1081 bool GetIndentationGuides();
1083 // Set the highlighted indentation guide column.
1084 // 0 = no highlighted guide.
1085 void SetHighlightGuide(int column
);
1087 // Get the highlighted indentation guide column.
1088 int GetHighlightGuide();
1090 // Get the position after the last visible characters on a line.
1091 int GetLineEndPosition(int line
);
1093 // Get the code page used to interpret the bytes of the document as characters.
1096 // Get the foreground colour of the caret.
1097 wxColour
GetCaretForeground();
1099 // In read-only mode?
1102 // Sets the position of the caret.
1103 void SetCurrentPos(int pos
);
1105 // Sets the position that starts the selection - this becomes the anchor.
1106 void SetSelectionStart(int pos
);
1108 // Returns the position at the start of the selection.
1109 int GetSelectionStart();
1111 // Sets the position that ends the selection - this becomes the currentPosition.
1112 void SetSelectionEnd(int pos
);
1114 // Returns the position at the end of the selection.
1115 int GetSelectionEnd();
1117 // Sets the print magnification added to the point size of each style for printing.
1118 void SetPrintMagnification(int magnification
);
1120 // Returns the print magnification.
1121 int GetPrintMagnification();
1123 // Modify colours when printing for clearer printed text.
1124 void SetPrintColourMode(int mode
);
1126 // Returns the print colour mode.
1127 int GetPrintColourMode();
1129 // Find some text in the document.
1130 int FindText(int minPos
, int maxPos
,
1131 const wxString
& text
,
1132 bool caseSensitive
, bool wholeWord
);
1134 // On Windows will draw the document into a display context such as a printer.
1135 int FormatRange(bool doDraw
,
1139 wxDC
* target
, // Why does it use two? Can they be the same?
1143 // Retrieve the line at the top of the display.
1144 int GetFirstVisibleLine();
1146 // Retrieve the contents of a line.
1147 wxString
GetLine(int line
);
1149 // Returns the number of lines in the document. There is always at least one.
1152 // Sets the size in pixels of the left margin.
1153 void SetMarginLeft(int pixelWidth
);
1155 // Returns the size in pixels of the left margin.
1156 int GetMarginLeft();
1158 // Sets the size in pixels of the right margin.
1159 void SetMarginRight(int pixelWidth
);
1161 // Returns the size in pixels of the right margin.
1162 int GetMarginRight();
1164 // Is the document different from when it was last saved?
1167 // Select a range of text.
1168 void SetSelection(int start
, int end
);
1170 // Retrieve the selected text.
1171 wxString
GetSelectedText();
1173 // Retrieve a range of text.
1174 wxString
GetTextRange(int startPos
, int endPos
);
1176 // Draw the selection in normal style or with selection highlighted.
1177 void HideSelection(bool normal
);
1179 // Retrieve the line containing a position.
1180 int LineFromPosition(int pos
);
1182 // Retrieve the position at the start of a line.
1183 int PositionFromLine(int line
);
1185 // Scroll horizontally and vertically.
1186 void LineScroll(int columns
, int lines
);
1188 // Ensure the caret is visible.
1189 void EnsureCaretVisible();
1191 // Replace the selected text with the argument text.
1192 void ReplaceSelection(const wxString
& text
);
1194 // Set to read only or read write.
1195 void SetReadOnly(bool readOnly
);
1197 // Will a paste succeed?
1200 // Are there any undoable actions in the undo history.
1203 // Delete the undo history.
1204 void EmptyUndoBuffer();
1206 // Undo one action in the undo history.
1209 // Cut the selection to the clipboard.
1212 // Copy the selection to the clipboard.
1215 // Paste the contents of the clipboard into the document replacing the selection.
1218 // Clear the selection.
1221 // Replace the contents of the document with the argument text.
1222 void SetText(const wxString
& text
);
1224 // Retrieve all the text in the document.
1227 // Retrieve the number of characters in the document.
1228 int GetTextLength();
1230 // Set to overtype (true) or insert mode
1231 void SetOvertype(bool overtype
);
1233 // Returns true if overtype mode is active otherwise false is returned.
1236 // Set the width of the insert mode caret
1237 void SetCaretWidth(int pixelWidth
);
1239 // Returns the width of the insert mode caret
1240 int GetCaretWidth();
1242 // Sets the position that starts the target which is used for updating the
1243 // document without affecting the scroll position.
1244 void SetTargetStart(int pos
);
1246 // Get the position that starts the target.
1247 int GetTargetStart();
1249 // Sets the position that ends the target which is used for updating the
1250 // document without affecting the scroll position.
1251 void SetTargetEnd(int pos
);
1253 // Get the position that ends the target.
1256 // Replace the target text with the argument text.
1257 // Text is counted so it can contain nulls.
1258 // Returns the length of the replacement text.
1259 int ReplaceTarget(const wxString
& text
);
1261 // Replace the target text with the argument text after \d processing.
1262 // Text is counted so it can contain nulls.
1263 // Looks for \d where d is between 1 and 9 and replaces these with the strings
1264 // matched in the last search operation which were surrounded by \( and \).
1265 // Returns the length of the replacement text including any change
1266 // caused by processing the \d patterns.
1267 int ReplaceTargetRE(const wxString
& text
);
1269 // Search for a counted string in the target and set the target to the found
1270 // range. Text is counted so it can contain nulls.
1271 // Returns length of range or -1 for failure in which case target is not moved.
1272 int SearchInTarget(const wxString
& text
);
1274 // Set the search flags used by SearchInTarget
1275 void SetSearchFlags(int flags
);
1277 // Get the search flags used by SearchInTarget
1278 int GetSearchFlags();
1280 // Show a call tip containing a definition near position pos.
1281 void CallTipShow(int pos
, const wxString
& definition
);
1283 // Remove the call tip from the screen.
1284 void CallTipCancel();
1286 // Is there an active call tip?
1287 bool CallTipActive();
1289 // Retrieve the position where the caret was before displaying the call tip.
1290 int CallTipPosAtStart();
1292 // Highlight a segment of the definition.
1293 void CallTipSetHighlight(int start
, int end
);
1295 // Set the background colour for the call tip.
1296 void CallTipSetBackground(const wxColour
& back
);
1298 // Find the display line of a document line taking hidden lines into account.
1299 int VisibleFromDocLine(int line
);
1301 // Find the document line of a display line taking hidden lines into account.
1302 int DocLineFromVisible(int lineDisplay
);
1304 // Set the fold level of a line.
1305 // This encodes an integer level along with flags indicating whether the
1306 // line is a header and whether it is effectively white space.
1307 void SetFoldLevel(int line
, int level
);
1309 // Retrieve the fold level of a line.
1310 int GetFoldLevel(int line
);
1312 // Find the last child line of a header line.
1313 int GetLastChild(int line
, int level
);
1315 // Find the parent line of a child line.
1316 int GetFoldParent(int line
);
1318 // Make a range of lines visible.
1319 void ShowLines(int lineStart
, int lineEnd
);
1321 // Make a range of lines invisible.
1322 void HideLines(int lineStart
, int lineEnd
);
1324 // Is a line visible?
1325 bool GetLineVisible(int line
);
1327 // Show the children of a header line.
1328 void SetFoldExpanded(int line
, bool expanded
);
1330 // Is a header line expanded?
1331 bool GetFoldExpanded(int line
);
1333 // Switch a header line between expanded and contracted.
1334 void ToggleFold(int line
);
1336 // Ensure a particular line is visible by expanding any header line hiding it.
1337 void EnsureVisible(int line
);
1339 // Set some debugging options for folding
1340 void SetFoldFlags(int flags
);
1342 // Ensure a particular line is visible by expanding any header line hiding it.
1343 // Use the currently set visibility policy to determine which range to display.
1344 void EnsureVisibleEnforcePolicy(int line
);
1346 // Sets whether a tab pressed when caret is within indentation indents
1347 void SetTabIndents(bool tabIndents
);
1349 // Does a tab pressed when caret is within indentation indent?
1350 bool GetTabIndents();
1352 // Sets whether a backspace pressed when caret is within indentation unindents
1353 void SetBackSpaceUnIndents(bool bsUnIndents
);
1355 // Does a backspace pressed when caret is within indentation unindent?
1356 bool GetBackSpaceUnIndents();
1358 // Sets the time the mouse must sit still to generate a mouse dwell event
1359 void SetMouseDwellTime(int periodMilliseconds
);
1361 // Retrieve the time the mouse must sit still to generate a mouse dwell event
1362 int GetMouseDwellTime();
1364 // Move the caret inside current view if it's not there already
1365 void MoveCaretInsideView();
1367 // How many characters are on a line, not including end of line characters.
1368 int LineLength(int line
);
1370 // Highlight the characters at two positions.
1371 void BraceHighlight(int pos1
, int pos2
);
1373 // Highlight the character at a position indicating there is no matching brace.
1374 void BraceBadLight(int pos
);
1376 // Find the position of a matching brace or INVALID_POSITION if no match.
1377 int BraceMatch(int pos
);
1379 // Are the end of line characters visible.
1382 // Make the end of line characters visible or invisible
1383 void SetViewEOL(bool visible
);
1385 // Retrieve a pointer to the document object.
1386 void* GetDocPointer();
1388 // Change the document object used.
1389 void SetDocPointer(void* docPointer
);
1391 // Set which document modification events are sent to the container.
1392 void SetModEventMask(int mask
);
1394 // Retrieve the column number which text should be kept within.
1395 int GetEdgeColumn();
1397 // Set the column number of the edge.
1398 // If text goes past the edge then it is highlighted.
1399 void SetEdgeColumn(int column
);
1401 // Retrieve the edge highlight mode.
1404 // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1405 // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1406 void SetEdgeMode(int mode
);
1408 // Retrieve the colour used in edge indication.
1409 wxColour
GetEdgeColour();
1411 // Change the colour used in edge indication.
1412 void SetEdgeColour(const wxColour
& edgeColour
);
1414 // Sets the current caret position to be the search anchor.
1415 void SearchAnchor();
1417 // Find some text starting at the search anchor.
1418 // Does not ensure the selection is visible.
1419 int SearchNext(int flags
, const wxString
& text
);
1421 // Find some text starting at the search anchor and moving backwards.
1422 // Does not ensure the selection is visible.
1423 int SearchPrev(int flags
, const wxString
& text
);
1425 // Set the way the line the caret is on is kept visible.
1426 void SetCaretPolicy(int caretPolicy
, int caretSlop
);
1428 // Retrieves the number of lines completely visible.
1429 int LinesOnScreen();
1431 // Set whether a pop up menu is displayed automatically when the user presses
1432 // the wrong mouse button.
1433 void UsePopUp(bool allowPopUp
);
1435 // Is the selection a rectangular. The alternative is the more common stream selection.
1436 bool SelectionIsRectangle();
1438 // Set the zoom level. This number of points is added to the size of all fonts.
1439 // It may be positive to magnify or negative to reduce.
1440 void SetZoom(int zoom
);
1442 // Retrieve the zoom level.
1445 // Create a new document object.
1446 // Starts with reference count of 1 and not selected into editor.
1447 void* CreateDocument();
1449 // Extend life of document.
1450 void AddRefDocument(void* docPointer
);
1452 // Release a reference to the document, deleting document if it fades to black.
1453 void ReleaseDocument(void* docPointer
);
1455 // Get which document modification events are sent to the container.
1456 int GetModEventMask();
1458 // Change internal focus flag
1459 void SetSTCFocus(bool focus
);
1461 // Get internal focus flag
1464 // Change error status - 0 = OK
1465 void SetStatus(int statusCode
);
1470 // Set whether the mouse is captured when its button is pressed
1471 void SetMouseDownCaptures(bool captures
);
1473 // Get whether mouse gets captured
1474 bool GetMouseDownCaptures();
1476 // Sets the cursor to one of the SC_CURSOR* values
1477 void SetCursor(int cursorType
);
1482 // Move to the previous change in capitalistion
1483 void WordPartLeft();
1485 // Move to the previous change in capitalistion extending selection to new caret position.
1486 void WordPartLeftExtend();
1488 // Move to the change next in capitalistion
1489 void WordPartRight();
1491 // Move to the next change in capitalistion extending selection to new caret position.
1492 void WordPartRightExtend();
1494 // Set the way the display area is determined when a particular line is to be moved to.
1495 void SetVisiblePolicy(int visiblePolicy
, int visibleSlop
);
1497 // Delete back from the current position to the start of the line
1500 // Delete forwards from the current position to the end of the line
1501 void DelLineRight();
1503 // Start notifying the container of all key presses and commands.
1506 // Stop notifying the container of all key presses and commands.
1509 // Set the lexing language of the document.
1510 void SetLexer(int lexer
);
1512 // Retrieve the lexing language of the document.
1515 // Colourise a segment of the document using the current lexing language.
1516 void Colourise(int start
, int end
);
1518 // Set up a value that may be used by a lexer for some optional feature.
1519 void SetProperty(const wxString
& key
, const wxString
& value
);
1521 // Set up the key words used by the lexer.
1522 void SetKeyWords(int keywordSet
, const wxString
& keyWords
);
1524 // Set the lexing language of the document based on string name.
1525 void SetLexerLanguage(const wxString
& language
);
1527 // END of generated section
1528 //----------------------------------------------------------------------
1532 // Returns the line number of the line with the caret.
1533 int GetCurrentLine();
1535 // Extract style settings from a spec-string which is composed of one or
1536 // more of the following comma separated elements:
1538 // bold turns on bold
1539 // italic turns on italics
1540 // fore:#RRGGBB sets the foreground colour
1541 // back:#RRGGBB sets the background colour
1542 // face:[facename] sets the font face name to use
1543 // size:[num] sets the font size in points
1544 // eol turns on eol filling
1545 // underline turns on underlining
1547 void StyleSetSpec(int styleNum
, const wxString
& spec
);
1551 // Set style size, face, bold, italic, and underline attributes from
1552 // a wxFont's attributes.
1553 void StyleSetFont(int styleNum
, wxFont
& font
);
1557 // Set all font style attributes at once.
1558 void StyleSetFontAttr(int styleNum
, int size
,
1559 const wxString
& faceName
,
1560 bool bold
, bool italic
,
1565 // Perform one of the operations defined by the wxSTC_CMD_* constants.
1566 void CmdKeyExecute(int cmd
);
1570 // Set the left and right margin in the edit area, measured in pixels.
1571 void SetMargins(int left
, int right
);
1574 // Retrieve the start and end positions of the current selection.
1576 void GetSelection(int* OUTPUT
, int* OUTPUT
);
1578 void GetSelection(int* startPos
, int* endPos
);
1581 // Retrieve the point in the window where a position is displayed.
1582 wxPoint
PointFromPosition(int pos
);
1585 // Scroll enough to make the given line visible
1586 void ScrollToLine(int line
);
1589 // Scroll enough to make the given column visible
1590 void ScrollToColumn(int column
);
1593 // Send a message to Scintilla
1594 long SendMsg(int msg
, long wp
=0, long lp
=0);
1596 //----------------------------------------------------------------------
1602 void OnPaint(wxPaintEvent
& evt
);
1603 void OnScrollWin(wxScrollWinEvent
& evt
);
1604 void OnSize(wxSizeEvent
& evt
);
1605 void OnMouseLeftDown(wxMouseEvent
& evt
);
1606 void OnMouseMove(wxMouseEvent
& evt
);
1607 void OnMouseLeftUp(wxMouseEvent
& evt
);
1608 void OnContextMenu(wxContextMenuEvent
& evt
);
1609 void OnMouseWheel(wxMouseEvent
& evt
);
1610 void OnChar(wxKeyEvent
& evt
);
1611 void OnKeyDown(wxKeyEvent
& evt
);
1612 void OnLoseFocus(wxFocusEvent
& evt
);
1613 void OnGainFocus(wxFocusEvent
& evt
);
1614 void OnSysColourChanged(wxSysColourChangedEvent
& evt
);
1615 void OnEraseBackground(wxEraseEvent
& evt
);
1616 void OnMenu(wxCommandEvent
& evt
);
1617 void OnListBox(wxCommandEvent
& evt
);
1620 // Turn notifications from Scintilla into events
1621 void NotifyChange();
1622 void NotifyParent(SCNotification
* scn
);
1625 DECLARE_EVENT_TABLE()
1626 DECLARE_CLASS(wxStyledTextCtrl
)
1629 wxStopWatch m_stopWatch
;
1631 bool m_lastKeyDownConsumed
;
1633 friend class ScintillaWX
;
1634 friend class Platform
;
1638 //----------------------------------------------------------------------
1640 class wxStyledTextEvent
: public wxCommandEvent
{
1642 wxStyledTextEvent(wxEventType commandType
=0, int id
=0);
1643 ~wxStyledTextEvent() {}
1645 void SetPosition(int pos
) { m_position
= pos
; }
1646 void SetKey(int k
) { m_key
= k
; }
1647 void SetModifiers(int m
) { m_modifiers
= m
; }
1648 void SetModificationType(int t
) { m_modificationType
= t
; }
1649 void SetText(const char* t
) { m_text
= t
; }
1650 void SetLength(int len
) { m_length
= len
; }
1651 void SetLinesAdded(int num
) { m_linesAdded
= num
; }
1652 void SetLine(int val
) { m_line
= val
; }
1653 void SetFoldLevelNow(int val
) { m_foldLevelNow
= val
; }
1654 void SetFoldLevelPrev(int val
) { m_foldLevelPrev
= val
; }
1655 void SetMargin(int val
) { m_margin
= val
; }
1656 void SetMessage(int val
) { m_message
= val
; }
1657 void SetWParam(int val
) { m_wParam
= val
; }
1658 void SetLParam(int val
) { m_lParam
= val
; }
1659 void SetListType(int val
) { m_listType
= val
; }
1660 void SetX(int val
) { m_x
= val
; }
1661 void SetY(int val
) { m_y
= val
; }
1663 int GetPosition() const { return m_position
; }
1664 int GetKey() const { return m_key
; }
1665 int GetModifiers() const { return m_modifiers
; }
1666 int GetModificationType() const { return m_modificationType
; }
1667 wxString
GetText() const { return m_text
; }
1668 int GetLength() const { return m_length
; }
1669 int GetLinesAdded() const { return m_linesAdded
; }
1670 int GetLine() const { return m_line
; }
1671 int GetFoldLevelNow() const { return m_foldLevelNow
; }
1672 int GetFoldLevelPrev() const { return m_foldLevelPrev
; }
1673 int GetMargin() const { return m_margin
; }
1674 int GetMessage() const { return m_message
; }
1675 int GetWParam() const { return m_wParam
; }
1676 int GetLParam() const { return m_lParam
; }
1677 int GetListType() const { return m_listType
; }
1678 int GetX() const { return m_x
; }
1679 int GetY() const { return m_y
; }
1681 bool GetShift() const;
1682 bool GetControl() const;
1683 bool GetAlt() const;
1685 void CopyObject(wxObject
& obj
) const;
1689 DECLARE_DYNAMIC_CLASS(wxStyledTextEvent
)
1695 int m_modificationType
; // wxEVT_STC_MODIFIED
1701 int m_foldLevelPrev
;
1703 int m_margin
; // wxEVT_STC_MARGINCLICK
1705 int m_message
; // wxEVT_STC_MACRORECORD
1716 BEGIN_DECLARE_EVENT_TYPES()
1717 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE
, 1650)
1718 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED
, 1651)
1719 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED
, 1652)
1720 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED
, 1653)
1721 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT
, 1654)
1722 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT
, 1655)
1723 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY
, 1656)
1724 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK
, 1657)
1725 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI
, 1658)
1726 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED
, 1659)
1727 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD
, 1660)
1728 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK
, 1661)
1729 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN
, 1662)
1730 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED
, 1663)
1731 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_PAINTED
, 1664)
1732 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_USERLISTSELECTION
, 1665)
1733 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED
, 1666)
1734 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART
, 1667)
1735 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND
, 1668)
1736 END_DECLARE_EVENT_TYPES()
1740 wxEVT_STC_STYLENEEDED
,
1741 wxEVT_STC_CHARADDED
,
1742 wxEVT_STC_SAVEPOINTREACHED
,
1743 wxEVT_STC_SAVEPOINTLEFT
,
1744 wxEVT_STC_ROMODIFYATTEMPT
,
1746 wxEVT_STC_DOUBLECLICK
,
1749 wxEVT_STC_MACRORECORD
,
1750 wxEVT_STC_MARGINCLICK
,
1751 wxEVT_STC_NEEDSHOWN
,
1752 wxEVT_STC_POSCHANGED
,
1754 wxEVT_STC_USERLISTSELECTION
,
1755 wxEVT_STC_URIDROPPED
,
1756 wxEVT_STC_DWELLSTART
,
1764 typedef void (wxEvtHandler::*wxStyledTextEventFunction
)(wxStyledTextEvent
&);
1766 #define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1767 #define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1768 #define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1769 #define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1770 #define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1771 #define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1772 #define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1773 #define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1774 #define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1775 #define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1776 #define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1777 #define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1778 #define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1779 #define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1780 #define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1781 #define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1782 #define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1783 #define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1784 #define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1789 //----------------------------------------------------------------------
1790 //----------------------------------------------------------------------