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
76 // Markers used for outlining column
77 #define wxSTC_MARKNUM_FOLDEREND 25
78 #define wxSTC_MARKNUM_FOLDEROPENMID 26
79 #define wxSTC_MARKNUM_FOLDERMIDTAIL 27
80 #define wxSTC_MARKNUM_FOLDERTAIL 28
81 #define wxSTC_MARKNUM_FOLDERSUB 29
82 #define wxSTC_MARKNUM_FOLDER 30
83 #define wxSTC_MARKNUM_FOLDEROPEN 31
84 #define wxSTC_MARGIN_SYMBOL 0
85 #define wxSTC_MARGIN_NUMBER 1
86 #define wxSTC_STYLE_DEFAULT 32
87 #define wxSTC_STYLE_LINENUMBER 33
88 #define wxSTC_STYLE_BRACELIGHT 34
89 #define wxSTC_STYLE_BRACEBAD 35
90 #define wxSTC_STYLE_CONTROLCHAR 36
91 #define wxSTC_STYLE_INDENTGUIDE 37
92 #define wxSTC_STYLE_MAX 127
94 // Character set identifiers are used in StyleSetCharacterSet.
95 // The values are the same as the Windows *_CHARSET values.
96 #define wxSTC_CHARSET_ANSI 0
97 #define wxSTC_CHARSET_DEFAULT 1
98 #define wxSTC_CHARSET_BALTIC 186
99 #define wxSTC_CHARSET_CHINESEBIG5 136
100 #define wxSTC_CHARSET_EASTEUROPE 238
101 #define wxSTC_CHARSET_GB2312 134
102 #define wxSTC_CHARSET_GREEK 161
103 #define wxSTC_CHARSET_HANGUL 129
104 #define wxSTC_CHARSET_MAC 77
105 #define wxSTC_CHARSET_OEM 255
106 #define wxSTC_CHARSET_RUSSIAN 204
107 #define wxSTC_CHARSET_SHIFTJIS 128
108 #define wxSTC_CHARSET_SYMBOL 2
109 #define wxSTC_CHARSET_TURKISH 162
110 #define wxSTC_CHARSET_JOHAB 130
111 #define wxSTC_CHARSET_HEBREW 177
112 #define wxSTC_CHARSET_ARABIC 178
113 #define wxSTC_CHARSET_VIETNAMESE 163
114 #define wxSTC_CHARSET_THAI 222
115 #define wxSTC_CASE_MIXED 0
116 #define wxSTC_CASE_UPPER 1
117 #define wxSTC_CASE_LOWER 2
118 #define wxSTC_INDIC_MAX 7
119 #define wxSTC_INDIC_PLAIN 0
120 #define wxSTC_INDIC_SQUIGGLE 1
121 #define wxSTC_INDIC_TT 2
122 #define wxSTC_INDIC_DIAGONAL 3
123 #define wxSTC_INDIC_STRIKE 4
124 #define wxSTC_INDIC0_MASK 32
125 #define wxSTC_INDIC1_MASK 64
126 #define wxSTC_INDIC2_MASK 128
127 #define wxSTC_INDICS_MASK 224
129 // PrintColourMode - use same colours as screen.
130 #define wxSTC_PRINT_NORMAL 0
132 // PrintColourMode - invert the light value of each style for printing.
133 #define wxSTC_PRINT_INVERTLIGHT 1
135 // PrintColourMode - force black text on white background for printing.
136 #define wxSTC_PRINT_BLACKONWHITE 2
138 // PrintColourMode - text stays coloured, but all background is forced to be white for printing.
139 #define wxSTC_PRINT_COLOURONWHITE 3
141 // PrintColourMode - only the default-background is forced to be white for printing.
142 #define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4
143 #define wxSTC_FIND_WHOLEWORD 2
144 #define wxSTC_FIND_MATCHCASE 4
145 #define wxSTC_FIND_WORDSTART 0x00100000
146 #define wxSTC_FIND_REGEXP 0x00200000
147 #define wxSTC_CMD_UNDO 2176
148 #define wxSTC_CMD_CUT 2177
149 #define wxSTC_CMD_COPY 2178
150 #define wxSTC_CMD_PASTE 2179
151 #define wxSTC_FOLDLEVELBASE 0x400
152 #define wxSTC_FOLDLEVELWHITEFLAG 0x1000
153 #define wxSTC_FOLDLEVELHEADERFLAG 0x2000
154 #define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF
155 #define wxSTC_TIME_FOREVER 10000000
156 #define wxSTC_CMD_LINEDOWN 2300
157 #define wxSTC_CMD_LINEDOWNEXTEND 2301
158 #define wxSTC_CMD_LINEUP 2302
159 #define wxSTC_CMD_LINEUPEXTEND 2303
160 #define wxSTC_CMD_CHARLEFT 2304
161 #define wxSTC_CMD_CHARLEFTEXTEND 2305
162 #define wxSTC_CMD_CHARRIGHT 2306
163 #define wxSTC_CMD_CHARRIGHTEXTEND 2307
164 #define wxSTC_CMD_WORDLEFT 2308
165 #define wxSTC_CMD_WORDLEFTEXTEND 2309
166 #define wxSTC_CMD_WORDRIGHT 2310
167 #define wxSTC_CMD_WORDRIGHTEXTEND 2311
168 #define wxSTC_CMD_HOME 2312
169 #define wxSTC_CMD_HOMEEXTEND 2313
170 #define wxSTC_CMD_LINEEND 2314
171 #define wxSTC_CMD_LINEENDEXTEND 2315
172 #define wxSTC_CMD_DOCUMENTSTART 2316
173 #define wxSTC_CMD_DOCUMENTSTARTEXTEND 2317
174 #define wxSTC_CMD_DOCUMENTEND 2318
175 #define wxSTC_CMD_DOCUMENTENDEXTEND 2319
176 #define wxSTC_CMD_PAGEUP 2320
177 #define wxSTC_CMD_PAGEUPEXTEND 2321
178 #define wxSTC_CMD_PAGEDOWN 2322
179 #define wxSTC_CMD_PAGEDOWNEXTEND 2323
180 #define wxSTC_CMD_EDITTOGGLEOVERTYPE 2324
181 #define wxSTC_CMD_CANCEL 2325
182 #define wxSTC_CMD_DELETEBACK 2326
183 #define wxSTC_CMD_TAB 2327
184 #define wxSTC_CMD_BACKTAB 2328
185 #define wxSTC_CMD_NEWLINE 2329
186 #define wxSTC_CMD_FORMFEED 2330
187 #define wxSTC_CMD_VCHOME 2331
188 #define wxSTC_CMD_VCHOMEEXTEND 2332
189 #define wxSTC_CMD_ZOOMIN 2333
190 #define wxSTC_CMD_ZOOMOUT 2334
191 #define wxSTC_CMD_DELWORDLEFT 2335
192 #define wxSTC_CMD_DELWORDRIGHT 2336
193 #define wxSTC_CMD_LINECUT 2337
194 #define wxSTC_CMD_LINEDELETE 2338
195 #define wxSTC_CMD_LINETRANSPOSE 2339
196 #define wxSTC_CMD_LOWERCASE 2340
197 #define wxSTC_CMD_UPPERCASE 2341
198 #define wxSTC_CMD_LINESCROLLDOWN 2342
199 #define wxSTC_CMD_LINESCROLLUP 2343
200 #define wxSTC_EDGE_NONE 0
201 #define wxSTC_EDGE_LINE 1
202 #define wxSTC_EDGE_BACKGROUND 2
204 // Show caret within N lines of edge when it's scrolled to view
205 // If CARET_SLOP not set then centre caret on screen when it's
207 #define wxSTC_CARET_SLOP 0x01
210 #define wxSTC_CARET_CENTER 0x02
212 // If CARET_SLOP also set then reposition whenever outside slop border
213 // If CARET_SLOP not set then recentre even when visible
214 #define wxSTC_CARET_STRICT 0x04
216 // If CARET_XEVEN set then both left and right margins are given equal weight
217 // rather than favouring left following behaviour.
218 #define wxSTC_CARET_XEVEN 0x08
220 // If CARET_XJUMPS set then when caret reaches the margin the display jumps
221 // enough to leave the caret solidly within the display.
222 #define wxSTC_CARET_XJUMPS 0x10
223 #define wxSTC_CURSORNORMAL -1
224 #define wxSTC_CURSORWAIT 3
226 // Constants for use with SetVisiblePolicy, similar to SetCaretPolicy
227 #define wxSTC_VISIBLE_SLOP 0x01
228 #define wxSTC_VISIBLE_STRICT 0x04
231 // Type of modification and the action which caused the modification
232 // These are defined as a bit mask to make it easy to specify which notifications are wanted.
233 // One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
234 #define wxSTC_MOD_INSERTTEXT 0x1
235 #define wxSTC_MOD_DELETETEXT 0x2
236 #define wxSTC_MOD_CHANGESTYLE 0x4
237 #define wxSTC_MOD_CHANGEFOLD 0x8
238 #define wxSTC_PERFORMED_USER 0x10
239 #define wxSTC_PERFORMED_UNDO 0x20
240 #define wxSTC_PERFORMED_REDO 0x40
241 #define wxSTC_LASTSTEPINUNDOREDO 0x100
242 #define wxSTC_MOD_CHANGEMARKER 0x200
243 #define wxSTC_MOD_BEFOREINSERT 0x400
244 #define wxSTC_MOD_BEFOREDELETE 0x800
245 #define wxSTC_MODEVENTMASKALL 0xF77
247 // Symbolic key codes and modifier flags
248 // ASCII and other printable characters below 256
249 // Extended keys above 300
250 #define wxSTC_KEY_DOWN 300
251 #define wxSTC_KEY_UP 301
252 #define wxSTC_KEY_LEFT 302
253 #define wxSTC_KEY_RIGHT 303
254 #define wxSTC_KEY_HOME 304
255 #define wxSTC_KEY_END 305
256 #define wxSTC_KEY_PRIOR 306
257 #define wxSTC_KEY_NEXT 307
258 #define wxSTC_KEY_DELETE 308
259 #define wxSTC_KEY_INSERT 309
260 #define wxSTC_KEY_ESCAPE 7
261 #define wxSTC_KEY_BACK 8
262 #define wxSTC_KEY_TAB 9
263 #define wxSTC_KEY_RETURN 13
264 #define wxSTC_KEY_ADD 310
265 #define wxSTC_KEY_SUBTRACT 311
266 #define wxSTC_KEY_DIVIDE 312
267 #define wxSTC_SCMOD_SHIFT 1
268 #define wxSTC_SCMOD_CTRL 2
269 #define wxSTC_SCMOD_ALT 4
272 #define wxSTC_LEX_CONTAINER 0
273 #define wxSTC_LEX_NULL 1
274 #define wxSTC_LEX_PYTHON 2
275 #define wxSTC_LEX_CPP 3
276 #define wxSTC_LEX_HTML 4
277 #define wxSTC_LEX_XML 5
278 #define wxSTC_LEX_PERL 6
279 #define wxSTC_LEX_SQL 7
280 #define wxSTC_LEX_VB 8
281 #define wxSTC_LEX_PROPERTIES 9
282 #define wxSTC_LEX_ERRORLIST 10
283 #define wxSTC_LEX_MAKEFILE 11
284 #define wxSTC_LEX_BATCH 12
285 #define wxSTC_LEX_XCODE 13
286 #define wxSTC_LEX_LATEX 14
287 #define wxSTC_LEX_LUA 15
288 #define wxSTC_LEX_DIFF 16
289 #define wxSTC_LEX_CONF 17
290 #define wxSTC_LEX_PASCAL 18
291 #define wxSTC_LEX_AVE 19
292 #define wxSTC_LEX_ADA 20
293 #define wxSTC_LEX_LISP 21
294 #define wxSTC_LEX_RUBY 22
295 #define wxSTC_LEX_EIFFEL 23
296 #define wxSTC_LEX_EIFFELKW 24
297 #define wxSTC_LEX_TCL 25
299 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
300 // value assigned in sequence from SCLEX_AUTOMATIC+1.
301 #define wxSTC_LEX_AUTOMATIC 1000
303 // Lexical states for SCLEX_PYTHON
304 #define wxSTC_P_DEFAULT 0
305 #define wxSTC_P_COMMENTLINE 1
306 #define wxSTC_P_NUMBER 2
307 #define wxSTC_P_STRING 3
308 #define wxSTC_P_CHARACTER 4
309 #define wxSTC_P_WORD 5
310 #define wxSTC_P_TRIPLE 6
311 #define wxSTC_P_TRIPLEDOUBLE 7
312 #define wxSTC_P_CLASSNAME 8
313 #define wxSTC_P_DEFNAME 9
314 #define wxSTC_P_OPERATOR 10
315 #define wxSTC_P_IDENTIFIER 11
316 #define wxSTC_P_COMMENTBLOCK 12
317 #define wxSTC_P_STRINGEOL 13
319 // Lexical states for SCLEX_CPP, SCLEX_VB
320 #define wxSTC_C_DEFAULT 0
321 #define wxSTC_C_COMMENT 1
322 #define wxSTC_C_COMMENTLINE 2
323 #define wxSTC_C_COMMENTDOC 3
324 #define wxSTC_C_NUMBER 4
325 #define wxSTC_C_WORD 5
326 #define wxSTC_C_STRING 6
327 #define wxSTC_C_CHARACTER 7
328 #define wxSTC_C_UUID 8
329 #define wxSTC_C_PREPROCESSOR 9
330 #define wxSTC_C_OPERATOR 10
331 #define wxSTC_C_IDENTIFIER 11
332 #define wxSTC_C_STRINGEOL 12
333 #define wxSTC_C_VERBATIM 13
334 #define wxSTC_C_REGEX 14
335 #define wxSTC_C_COMMENTLINEDOC 15
336 #define wxSTC_C_WORD2 16
338 // Lexical states for SCLEX_HTML, SCLEX_XML
339 #define wxSTC_H_DEFAULT 0
340 #define wxSTC_H_TAG 1
341 #define wxSTC_H_TAGUNKNOWN 2
342 #define wxSTC_H_ATTRIBUTE 3
343 #define wxSTC_H_ATTRIBUTEUNKNOWN 4
344 #define wxSTC_H_NUMBER 5
345 #define wxSTC_H_DOUBLESTRING 6
346 #define wxSTC_H_SINGLESTRING 7
347 #define wxSTC_H_OTHER 8
348 #define wxSTC_H_COMMENT 9
349 #define wxSTC_H_ENTITY 10
352 #define wxSTC_H_TAGEND 11
353 #define wxSTC_H_XMLSTART 12
354 #define wxSTC_H_XMLEND 13
355 #define wxSTC_H_SCRIPT 14
356 #define wxSTC_H_ASP 15
357 #define wxSTC_H_ASPAT 16
358 #define wxSTC_H_CDATA 17
359 #define wxSTC_H_QUESTION 18
362 #define wxSTC_H_VALUE 19
365 #define wxSTC_H_XCCOMMENT 20
368 #define wxSTC_H_SGML 21
370 // Embedded Javascript
371 #define wxSTC_HJ_START 40
372 #define wxSTC_HJ_DEFAULT 41
373 #define wxSTC_HJ_COMMENT 42
374 #define wxSTC_HJ_COMMENTLINE 43
375 #define wxSTC_HJ_COMMENTDOC 44
376 #define wxSTC_HJ_NUMBER 45
377 #define wxSTC_HJ_WORD 46
378 #define wxSTC_HJ_KEYWORD 47
379 #define wxSTC_HJ_DOUBLESTRING 48
380 #define wxSTC_HJ_SINGLESTRING 49
381 #define wxSTC_HJ_SYMBOLS 50
382 #define wxSTC_HJ_STRINGEOL 51
383 #define wxSTC_HJ_REGEX 52
386 #define wxSTC_HJA_START 55
387 #define wxSTC_HJA_DEFAULT 56
388 #define wxSTC_HJA_COMMENT 57
389 #define wxSTC_HJA_COMMENTLINE 58
390 #define wxSTC_HJA_COMMENTDOC 59
391 #define wxSTC_HJA_NUMBER 60
392 #define wxSTC_HJA_WORD 61
393 #define wxSTC_HJA_KEYWORD 62
394 #define wxSTC_HJA_DOUBLESTRING 63
395 #define wxSTC_HJA_SINGLESTRING 64
396 #define wxSTC_HJA_SYMBOLS 65
397 #define wxSTC_HJA_STRINGEOL 66
398 #define wxSTC_HJA_REGEX 67
401 #define wxSTC_HB_START 70
402 #define wxSTC_HB_DEFAULT 71
403 #define wxSTC_HB_COMMENTLINE 72
404 #define wxSTC_HB_NUMBER 73
405 #define wxSTC_HB_WORD 74
406 #define wxSTC_HB_STRING 75
407 #define wxSTC_HB_IDENTIFIER 76
408 #define wxSTC_HB_STRINGEOL 77
411 #define wxSTC_HBA_START 80
412 #define wxSTC_HBA_DEFAULT 81
413 #define wxSTC_HBA_COMMENTLINE 82
414 #define wxSTC_HBA_NUMBER 83
415 #define wxSTC_HBA_WORD 84
416 #define wxSTC_HBA_STRING 85
417 #define wxSTC_HBA_IDENTIFIER 86
418 #define wxSTC_HBA_STRINGEOL 87
421 #define wxSTC_HP_START 90
422 #define wxSTC_HP_DEFAULT 91
423 #define wxSTC_HP_COMMENTLINE 92
424 #define wxSTC_HP_NUMBER 93
425 #define wxSTC_HP_STRING 94
426 #define wxSTC_HP_CHARACTER 95
427 #define wxSTC_HP_WORD 96
428 #define wxSTC_HP_TRIPLE 97
429 #define wxSTC_HP_TRIPLEDOUBLE 98
430 #define wxSTC_HP_CLASSNAME 99
431 #define wxSTC_HP_DEFNAME 100
432 #define wxSTC_HP_OPERATOR 101
433 #define wxSTC_HP_IDENTIFIER 102
436 #define wxSTC_HPA_START 105
437 #define wxSTC_HPA_DEFAULT 106
438 #define wxSTC_HPA_COMMENTLINE 107
439 #define wxSTC_HPA_NUMBER 108
440 #define wxSTC_HPA_STRING 109
441 #define wxSTC_HPA_CHARACTER 110
442 #define wxSTC_HPA_WORD 111
443 #define wxSTC_HPA_TRIPLE 112
444 #define wxSTC_HPA_TRIPLEDOUBLE 113
445 #define wxSTC_HPA_CLASSNAME 114
446 #define wxSTC_HPA_DEFNAME 115
447 #define wxSTC_HPA_OPERATOR 116
448 #define wxSTC_HPA_IDENTIFIER 117
451 #define wxSTC_HPHP_DEFAULT 118
452 #define wxSTC_HPHP_HSTRING 119
453 #define wxSTC_HPHP_SIMPLESTRING 120
454 #define wxSTC_HPHP_WORD 121
455 #define wxSTC_HPHP_NUMBER 122
456 #define wxSTC_HPHP_VARIABLE 123
457 #define wxSTC_HPHP_COMMENT 124
458 #define wxSTC_HPHP_COMMENTLINE 125
459 #define wxSTC_HPHP_HSTRING_VARIABLE 126
460 #define wxSTC_HPHP_OPERATOR 127
462 // Lexical states for SCLEX_PERL
463 #define wxSTC_PL_DEFAULT 0
464 #define wxSTC_PL_ERROR 1
465 #define wxSTC_PL_COMMENTLINE 2
466 #define wxSTC_PL_POD 3
467 #define wxSTC_PL_NUMBER 4
468 #define wxSTC_PL_WORD 5
469 #define wxSTC_PL_STRING 6
470 #define wxSTC_PL_CHARACTER 7
471 #define wxSTC_PL_PUNCTUATION 8
472 #define wxSTC_PL_PREPROCESSOR 9
473 #define wxSTC_PL_OPERATOR 10
474 #define wxSTC_PL_IDENTIFIER 11
475 #define wxSTC_PL_SCALAR 12
476 #define wxSTC_PL_ARRAY 13
477 #define wxSTC_PL_HASH 14
478 #define wxSTC_PL_SYMBOLTABLE 15
479 #define wxSTC_PL_REGEX 17
480 #define wxSTC_PL_REGSUBST 18
481 #define wxSTC_PL_LONGQUOTE 19
482 #define wxSTC_PL_BACKTICKS 20
483 #define wxSTC_PL_DATASECTION 21
484 #define wxSTC_PL_HERE_DELIM 22
485 #define wxSTC_PL_HERE_Q 23
486 #define wxSTC_PL_HERE_QQ 24
487 #define wxSTC_PL_HERE_QX 25
488 #define wxSTC_PL_STRING_Q 26
489 #define wxSTC_PL_STRING_QQ 27
490 #define wxSTC_PL_STRING_QX 28
491 #define wxSTC_PL_STRING_QR 29
492 #define wxSTC_PL_STRING_QW 30
494 // Lexical states for SCLEX_LATEX
495 #define wxSTC_L_DEFAULT 0
496 #define wxSTC_L_COMMAND 1
497 #define wxSTC_L_TAG 2
498 #define wxSTC_L_MATH 3
499 #define wxSTC_L_COMMENT 4
501 // Lexical states for SCLEX_LUA
502 #define wxSTC_LUA_DEFAULT 0
503 #define wxSTC_LUA_COMMENT 1
504 #define wxSTC_LUA_COMMENTLINE 2
505 #define wxSTC_LUA_COMMENTDOC 3
506 #define wxSTC_LUA_NUMBER 4
507 #define wxSTC_LUA_WORD 5
508 #define wxSTC_LUA_STRING 6
509 #define wxSTC_LUA_CHARACTER 7
510 #define wxSTC_LUA_LITERALSTRING 8
511 #define wxSTC_LUA_PREPROCESSOR 9
512 #define wxSTC_LUA_OPERATOR 10
513 #define wxSTC_LUA_IDENTIFIER 11
514 #define wxSTC_LUA_STRINGEOL 12
516 // Lexical states for SCLEX_ERRORLIST
517 #define wxSTC_ERR_DEFAULT 0
518 #define wxSTC_ERR_PYTHON 1
519 #define wxSTC_ERR_GCC 2
520 #define wxSTC_ERR_MS 3
521 #define wxSTC_ERR_CMD 4
522 #define wxSTC_ERR_BORLAND 5
523 #define wxSTC_ERR_PERL 6
524 #define wxSTC_ERR_NET 7
525 #define wxSTC_ERR_LUA 8
526 #define wxSTC_ERR_DIFF_CHANGED 10
527 #define wxSTC_ERR_DIFF_ADDITION 11
528 #define wxSTC_ERR_DIFF_DELETION 12
529 #define wxSTC_ERR_DIFF_MESSAGE 13
531 // Lexical states for SCLEX_BATCH
532 #define wxSTC_BAT_DEFAULT 0
533 #define wxSTC_BAT_COMMENT 1
534 #define wxSTC_BAT_WORD 2
535 #define wxSTC_BAT_LABEL 3
536 #define wxSTC_BAT_HIDE 4
537 #define wxSTC_BAT_COMMAND 5
538 #define wxSTC_BAT_IDENTIFIER 6
539 #define wxSTC_BAT_OPERATOR 7
541 // Lexical states for SCLEX_MAKEFILE
542 #define wxSTC_MAKE_DEFAULT 0
543 #define wxSTC_MAKE_COMMENT 1
544 #define wxSTC_MAKE_PREPROCESSOR 2
545 #define wxSTC_MAKE_IDENTIFIER 3
546 #define wxSTC_MAKE_OPERATOR 4
547 #define wxSTC_MAKE_TARGET 5
548 #define wxSTC_MAKE_IDEOL 9
550 // Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer)
551 #define wxSTC_CONF_DEFAULT 0
552 #define wxSTC_CONF_COMMENT 1
553 #define wxSTC_CONF_NUMBER 2
554 #define wxSTC_CONF_IDENTIFIER 3
555 #define wxSTC_CONF_EXTENSION 4
556 #define wxSTC_CONF_PARAMETER 5
557 #define wxSTC_CONF_STRING 6
558 #define wxSTC_CONF_OPERATOR 7
559 #define wxSTC_CONF_IP 8
560 #define wxSTC_CONF_DIRECTIVE 9
563 #define wxSTC_AVE_DEFAULT 0
564 #define wxSTC_AVE_COMMENT 1
565 #define wxSTC_AVE_NUMBER 2
566 #define wxSTC_AVE_WORD 3
567 #define wxSTC_AVE_KEYWORD 4
568 #define wxSTC_AVE_STATEMENT 5
569 #define wxSTC_AVE_STRING 6
570 #define wxSTC_AVE_ENUM 7
571 #define wxSTC_AVE_STRINGEOL 8
572 #define wxSTC_AVE_IDENTIFIER 9
573 #define wxSTC_AVE_OPERATOR 10
575 // Lexical states for SCLEX_ADA
576 #define wxSTC_ADA_DEFAULT 0
577 #define wxSTC_ADA_COMMENT 1
578 #define wxSTC_ADA_NUMBER 2
579 #define wxSTC_ADA_WORD 3
580 #define wxSTC_ADA_STRING 4
581 #define wxSTC_ADA_CHARACTER 5
582 #define wxSTC_ADA_OPERATOR 6
583 #define wxSTC_ADA_IDENTIFIER 7
584 #define wxSTC_ADA_STRINGEOL 8
586 // Lexical states for SCLEX_LISP
587 #define wxSTC_LISP_DEFAULT 0
588 #define wxSTC_LISP_COMMENT 1
589 #define wxSTC_LISP_NUMBER 2
590 #define wxSTC_LISP_KEYWORD 3
591 #define wxSTC_LISP_STRING 6
592 #define wxSTC_LISP_STRINGEOL 8
593 #define wxSTC_LISP_IDENTIFIER 9
594 #define wxSTC_LISP_OPERATOR 10
596 // Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW
597 #define wxSTC_EIFFEL_DEFAULT 0
598 #define wxSTC_EIFFEL_COMMENTLINE 1
599 #define wxSTC_EIFFEL_NUMBER 2
600 #define wxSTC_EIFFEL_WORD 3
601 #define wxSTC_EIFFEL_STRING 4
602 #define wxSTC_EIFFEL_CHARACTER 5
603 #define wxSTC_EIFFEL_OPERATOR 6
604 #define wxSTC_EIFFEL_IDENTIFIER 7
605 #define wxSTC_EIFFEL_STRINGEOL 8
607 // END of generated section
608 //----------------------------------------------------------------------
611 #define wxSTC_MASK_FOLDERS ((1 << wxSTC_MARKNUM_FOLDER) | (1 << wxSTC_MARKNUM_FOLDEROPEN))
615 //----------------------------------------------------------------------
617 class ScintillaWX
; // forward declare
619 struct SCNotification
;
622 extern const wxChar
* wxSTCNameStr
;
624 //----------------------------------------------------------------------
626 class wxStyledTextCtrl
: public wxControl
{
630 wxStyledTextCtrl(wxWindow
*parent
, wxWindowID id
,
631 const wxPoint
& pos
= wxDefaultPosition
,
632 const wxSize
& size
= wxDefaultSize
, long style
= 0,
633 const char* name
= "styledtext");
634 %pragma
(python
) addtomethod
= "__init__:self._setOORInfo(self)"
637 wxStyledTextCtrl(wxWindow
*parent
, wxWindowID id
,
638 const wxPoint
& pos
= wxDefaultPosition
,
639 const wxSize
& size
= wxDefaultSize
, long style
= 0,
640 const wxString
& name
= wxSTCNameStr
);
648 //----------------------------------------------------------------------
649 // BEGIN generated section. The following code is automatically generated
650 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
654 // Add text to the document
655 void AddText(const wxString
& text
);
657 // Add array of cells to document
658 void AddStyledText(const wxString
& text
);
660 // Insert string at a position
661 void InsertText(int pos
, const wxString
& text
);
663 // Delete all text in the document
666 // Set all style bytes to 0, remove all folding information
667 void ClearDocumentStyle();
669 // The number of characters in the document
672 // Returns the character byte at the position
673 int GetCharAt(int pos
);
675 // Returns the position of the caret
678 // Returns the position of the opposite end of the selection to the caret
681 // Returns the style byte at the position
682 int GetStyleAt(int pos
);
684 // Redoes the next action on the undo history
687 // Choose between collecting actions into the undo
688 // history and discarding them.
689 void SetUndoCollection(bool collectUndo
);
691 // Select all the text in the document.
694 // Remember the current position in the undo history as the position
695 // at which the document was saved.
698 // Retrieve a buffer of cells.
699 wxString
GetStyledText(int startPos
, int endPos
);
701 // Are there any redoable actions in the undo history.
704 // Retrieve the line number at which a particular marker is located
705 int MarkerLineFromHandle(int handle
);
708 void MarkerDeleteHandle(int handle
);
710 // Is undo history being collected?
711 bool GetUndoCollection();
713 // Are white space characters currently visible?
714 // Returns one of SCWS_* constants.
715 int GetViewWhiteSpace();
717 // Make white space characters invisible, always visible or visible outside indentation.
718 void SetViewWhiteSpace(int viewWS
);
720 // Find the position from a point within the window.
721 int PositionFromPoint(wxPoint pt
);
723 // Find the position from a point within the window but return
724 // INVALID_POSITION if not close to text.
725 int PositionFromPointClose(int x
, int y
);
727 // Set caret to start of a line and ensure it is visible.
728 void GotoLine(int line
);
730 // Set caret to a position and ensure it is visible.
731 void GotoPos(int pos
);
733 // Set the selection anchor to a position. The anchor is the opposite
734 // end of the selection from the caret.
735 void SetAnchor(int posAnchor
);
737 // Retrieve the text of the line containing the caret.
738 // Returns the index of the caret on the line.
740 wxString
GetCurLine(int* OUTPUT
);
742 wxString
GetCurLine(int* linePos
=NULL
);
745 // Retrieve the position of the last correctly styled character.
748 // Convert all line endings in the document to one mode.
749 void ConvertEOLs(int eolMode
);
751 // Retrieve the current end of line mode - one of CRLF, CR, or LF.
754 // Set the current end of line mode.
755 void SetEOLMode(int eolMode
);
757 // Set the current styling position to pos and the styling mask to mask.
758 // The styling mask can be used to protect some bits in each styling byte from
760 void StartStyling(int pos
, int mask
);
762 // Change style from current styling position for length characters to a style
763 // and move the current styling position to after this newly styled segment.
764 void SetStyling(int length
, int style
);
766 // Is drawing done first into a buffer or direct to the screen.
767 bool GetBufferedDraw();
769 // If drawing is buffered then each line of text is drawn into a bitmap buffer
770 // before drawing it to the screen to avoid flicker.
771 void SetBufferedDraw(bool buffered
);
773 // Change the visible size of a tab to be a multiple of the width of a space
775 void SetTabWidth(int tabWidth
);
777 // Retrieve the visible size of a tab.
780 // Set the code page used to interpret the bytes of the document as characters.
781 // The SC_CP_UTF8 value can be used to enter Unicode mode.
782 void SetCodePage(int codePage
);
784 // Set the symbol used for a particular marker number,
785 // and optionally the for and background colours.
786 void MarkerDefine(int markerNumber
, int markerSymbol
,
787 const wxColour
& foreground
= wxNullColour
,
788 const wxColour
& background
= wxNullColour
);
790 // Set the foreground colour used for a particular marker number.
791 void MarkerSetForeground(int markerNumber
, const wxColour
& fore
);
793 // Set the background colour used for a particular marker number.
794 void MarkerSetBackground(int markerNumber
, const wxColour
& back
);
796 // Add a marker to a line.
797 void MarkerAdd(int line
, int markerNumber
);
799 // Delete a marker from a line
800 void MarkerDelete(int line
, int markerNumber
);
802 // Delete all markers with a particular number from all lines
803 void MarkerDeleteAll(int markerNumber
);
805 // Get a bit mask of all the markers set on a line.
806 int MarkerGet(int line
);
808 // Find the next line after lineStart that includes a marker in mask.
809 int MarkerNext(int lineStart
, int markerMask
);
811 // Find the previous line before lineStart that includes a marker in mask.
812 int MarkerPrevious(int lineStart
, int markerMask
);
814 // Set a margin to be either numeric or symbolic.
815 void SetMarginType(int margin
, int marginType
);
817 // Retrieve the type of a margin.
818 int GetMarginType(int margin
);
820 // Set the width of a margin to a width expressed in pixels.
821 void SetMarginWidth(int margin
, int pixelWidth
);
823 // Retrieve the width of a margin in pixels.
824 int GetMarginWidth(int margin
);
826 // Set a mask that determines which markers are displayed in a margin.
827 void SetMarginMask(int margin
, int mask
);
829 // Retrieve the marker mask of a margin.
830 int GetMarginMask(int margin
);
832 // Make a margin sensitive or insensitive to mouse clicks.
833 void SetMarginSensitive(int margin
, bool sensitive
);
835 // Retrieve the mouse click sensitivity of a margin.
836 bool GetMarginSensitive(int margin
);
838 // Clear all the styles and make equivalent to the global default style.
839 void StyleClearAll();
841 // Set the foreground colour of a style.
842 void StyleSetForeground(int style
, const wxColour
& fore
);
844 // Set the background colour of a style.
845 void StyleSetBackground(int style
, const wxColour
& back
);
847 // Set a style to be bold or not.
848 void StyleSetBold(int style
, bool bold
);
850 // Set a style to be italic or not.
851 void StyleSetItalic(int style
, bool italic
);
853 // Set the size of characters of a style.
854 void StyleSetSize(int style
, int sizePoints
);
856 // Set the font of a style.
857 void StyleSetFaceName(int style
, const wxString
& fontName
);
859 // Set a style to have its end of line filled or not.
860 void StyleSetEOLFilled(int style
, bool filled
);
862 // Reset the default style to its state at startup
863 void StyleResetDefault();
865 // Set a style to be underlined or not.
866 void StyleSetUnderline(int style
, bool underline
);
868 // Set a style to be mixed case, or to force upper or lower case.
869 void StyleSetCase(int style
, int caseForce
);
871 // Set the foreground colour of the selection and whether to use this setting.
872 void SetSelForeground(bool useSetting
, const wxColour
& fore
);
874 // Set the background colour of the selection and whether to use this setting.
875 void SetSelBackground(bool useSetting
, const wxColour
& back
);
877 // Set the foreground colour of the caret.
878 void SetCaretForeground(const wxColour
& fore
);
880 // When key+modifier combination km is pressed perform msg.
881 void CmdKeyAssign(int key
, int modifiers
, int cmd
);
883 // When key+modifier combination km do nothing.
884 void CmdKeyClear(int key
, int modifiers
);
886 // Drop all key mappings.
887 void CmdKeyClearAll();
889 // Set the styles for a segment of the document.
890 void SetStyleBytes(int length
, char* styleBytes
);
892 // Set a style to be visible or not.
893 void StyleSetVisible(int style
, bool visible
);
895 // Get the time in milliseconds that the caret is on and off.
896 int GetCaretPeriod();
898 // Get the time in milliseconds that the caret is on and off. 0 = steady on.
899 void SetCaretPeriod(int periodMilliseconds
);
901 // Set the set of characters making up words for when moving or selecting
903 void SetWordChars(const wxString
& characters
);
905 // Start a sequence of actions that is undone and redone as a unit.
907 void BeginUndoAction();
909 // End a sequence of actions that is undone and redone as a unit.
910 void EndUndoAction();
912 // Set an indicator to plain, squiggle or TT.
913 void IndicatorSetStyle(int indic
, int style
);
915 // Retrieve the style of an indicator.
916 int IndicatorGetStyle(int indic
);
918 // Set the foreground colour of an indicator.
919 void IndicatorSetForeground(int indic
, const wxColour
& fore
);
921 // Retrieve the foreground colour of an indicator.
922 wxColour
IndicatorGetForeground(int indic
);
924 // Divide each styling byte into lexical class bits (default:5) and indicator
925 // bits (default:3). If a lexer requires more than 32 lexical states, then this
926 // is used to expand the possible states.
927 void SetStyleBits(int bits
);
929 // Retrieve number of bits in style bytes used to hold the lexical state.
932 // Used to hold extra styling information for each line.
933 void SetLineState(int line
, int state
);
935 // Retrieve the extra styling information for a line.
936 int GetLineState(int line
);
938 // Retrieve the last line number that has line state.
939 int GetMaxLineState();
941 // Is the background of the line containing the caret in a different colour?
942 bool GetCaretLineVisible();
944 // Display the background of the line containing the caret in a different colour.
945 void SetCaretLineVisible(bool show
);
947 // Get the colour of the background of the line containing the caret.
948 wxColour
GetCaretLineBack();
950 // Set the colour of the background of the line containing the caret.
951 void SetCaretLineBack(const wxColour
& back
);
953 // Display a auto-completion list.
954 // The lenEntered parameter indicates how many characters before
955 // the caret should be used to provide context.
956 void AutoCompShow(int lenEntered
, const wxString
& itemList
);
958 // Remove the auto-completion list from the screen.
959 void AutoCompCancel();
961 // Is there an auto-completion list visible?
962 bool AutoCompActive();
964 // Retrieve the position of the caret when the auto-completion list was
966 int AutoCompPosStart();
968 // User has selected an item so remove the list and insert the selection.
969 void AutoCompComplete();
971 // Define a set of character that when typed cancel the auto-completion list.
972 void AutoCompStops(const wxString
& characterSet
);
974 // Change the separator character in the string setting up an auto-completion
975 // list. Default is space but can be changed if items contain space.
976 void AutoCompSetSeparator(int separatorCharacter
);
978 // Retrieve the auto-completion list separator character.
979 int AutoCompGetSeparator();
981 // Select the item in the auto-completion list that starts with a string.
982 void AutoCompSelect(const wxString
& text
);
984 // Should the auto-completion list be cancelled if the user backspaces to a
985 // position before where the box was created.
986 void AutoCompSetCancelAtStart(bool cancel
);
988 // Retrieve whether auto-completion cancelled by backspacing before start.
989 bool AutoCompGetCancelAtStart();
991 // Define a set of character that when typed fills up the selected word.
992 void AutoCompSetFillUps(const wxString
& characterSet
);
994 // Should a single item auto-completion list automatically choose the item.
995 void AutoCompSetChooseSingle(bool chooseSingle
);
997 // Retrieve whether a single item auto-completion list automatically choose the item.
998 bool AutoCompGetChooseSingle();
1000 // Set whether case is significant when performing auto-completion searches.
1001 void AutoCompSetIgnoreCase(bool ignoreCase
);
1003 // Retrieve state of ignore case flag.
1004 bool AutoCompGetIgnoreCase();
1006 // Display a list of strings and send notification when user chooses one.
1007 void UserListShow(int listType
, const wxString
& itemList
);
1009 // Set whether or not autocompletion is hidden automatically when nothing matches
1010 void AutoCompSetAutoHide(bool autoHide
);
1012 // Retrieve whether or not autocompletion is hidden automatically when nothing matches
1013 bool AutoCompGetAutoHide();
1015 // Set the number of spaces used for one level of indentation.
1016 void SetIndent(int indentSize
);
1018 // Retrieve indentation size.
1021 // Indentation will only use space characters if useTabs is false, otherwise
1022 // it will use a combination of tabs and spaces.
1023 void SetUseTabs(bool useTabs
);
1025 // Retrieve whether tabs will be used in indentation.
1028 // Change the indentation of a line to a number of columns.
1029 void SetLineIndentation(int line
, int indentSize
);
1031 // Retrieve the number of columns that a line is indented.
1032 int GetLineIndentation(int line
);
1034 // Retrieve the position before the first non indentation character on a line.
1035 int GetLineIndentPosition(int line
);
1037 // Retrieve the column number of a position, taking tab width into account.
1038 int GetColumn(int pos
);
1040 // Show or hide the horizontal scroll bar.
1041 void SetUseHorizontalScrollBar(bool show
);
1043 // Is the horizontal scroll bar visible?
1044 bool GetUseHorizontalScrollBar();
1046 // Show or hide indentation guides.
1047 void SetIndentationGuides(bool show
);
1049 // Are the indentation guides visible?
1050 bool GetIndentationGuides();
1052 // Set the highlighted indentation guide column.
1053 // 0 = no highlighted guide.
1054 void SetHighlightGuide(int column
);
1056 // Get the highlighted indentation guide column.
1057 int GetHighlightGuide();
1059 // Get the position after the last visible characters on a line.
1060 int GetLineEndPosition(int line
);
1062 // Get the code page used to interpret the bytes of the document as characters.
1065 // Get the foreground colour of the caret.
1066 wxColour
GetCaretForeground();
1068 // In read-only mode?
1071 // Sets the position of the caret.
1072 void SetCurrentPos(int pos
);
1074 // Sets the position that starts the selection - this becomes the anchor.
1075 void SetSelectionStart(int pos
);
1077 // Returns the position at the start of the selection.
1078 int GetSelectionStart();
1080 // Sets the position that ends the selection - this becomes the currentPosition.
1081 void SetSelectionEnd(int pos
);
1083 // Returns the position at the end of the selection.
1084 int GetSelectionEnd();
1086 // Sets the print magnification added to the point size of each style for printing.
1087 void SetPrintMagnification(int magnification
);
1089 // Returns the print magnification.
1090 int GetPrintMagnification();
1092 // Modify colours when printing for clearer printed text.
1093 void SetPrintColourMode(int mode
);
1095 // Returns the print colour mode.
1096 int GetPrintColourMode();
1098 // Find some text in the document.
1099 int FindText(int minPos
, int maxPos
,
1100 const wxString
& text
,
1101 bool caseSensitive
, bool wholeWord
);
1103 // On Windows will draw the document into a display context such as a printer.
1104 int FormatRange(bool doDraw
,
1108 wxDC
* target
, // Why does it use two? Can they be the same?
1112 // Retrieve the line at the top of the display.
1113 int GetFirstVisibleLine();
1115 // Retrieve the contents of a line.
1116 wxString
GetLine(int line
);
1118 // Returns the number of lines in the document. There is always at least one.
1121 // Sets the size in pixels of the left margin.
1122 void SetMarginLeft(int pixelWidth
);
1124 // Returns the size in pixels of the left margin.
1125 int GetMarginLeft();
1127 // Sets the size in pixels of the right margin.
1128 void SetMarginRight(int pixelWidth
);
1130 // Returns the size in pixels of the right margin.
1131 int GetMarginRight();
1133 // Is the document different from when it was last saved?
1136 // Select a range of text.
1137 void SetSelection(int start
, int end
);
1139 // Retrieve the selected text.
1140 wxString
GetSelectedText();
1142 // Retrieve a range of text.
1143 wxString
GetTextRange(int startPos
, int endPos
);
1145 // Draw the selection in normal style or with selection highlighted.
1146 void HideSelection(bool normal
);
1148 // Retrieve the line containing a position.
1149 int LineFromPosition(int pos
);
1151 // Retrieve the position at the start of a line.
1152 int PositionFromLine(int line
);
1154 // Scroll horizontally and vertically.
1155 void LineScroll(int columns
, int lines
);
1157 // Ensure the caret is visible.
1158 void EnsureCaretVisible();
1160 // Replace the selected text with the argument text.
1161 void ReplaceSelection(const wxString
& text
);
1163 // Set to read only or read write.
1164 void SetReadOnly(bool readOnly
);
1166 // Will a paste succeed?
1169 // Are there any undoable actions in the undo history.
1172 // Delete the undo history.
1173 void EmptyUndoBuffer();
1175 // Undo one action in the undo history.
1178 // Cut the selection to the clipboard.
1181 // Copy the selection to the clipboard.
1184 // Paste the contents of the clipboard into the document replacing the selection.
1187 // Clear the selection.
1190 // Replace the contents of the document with the argument text.
1191 void SetText(const wxString
& text
);
1193 // Retrieve all the text in the document.
1196 // Retrieve the number of characters in the document.
1197 int GetTextLength();
1199 // Set to overtype (true) or insert mode
1200 void SetOvertype(bool overtype
);
1202 // Returns true if overtype mode is active otherwise false is returned.
1205 // Set the width of the insert mode caret
1206 void SetCaretWidth(int pixelWidth
);
1208 // Returns the width of the insert mode caret
1209 int GetCaretWidth();
1211 // Sets the position that starts the target which is used for updating the
1212 // document without affecting the scroll position.
1213 void SetTargetStart(int pos
);
1215 // Get the position that starts the target.
1216 int GetTargetStart();
1218 // Sets the position that ends the target which is used for updating the
1219 // document without affecting the scroll position.
1220 void SetTargetEnd(int pos
);
1222 // Get the position that ends the target.
1225 // Replace the target text with the argument text.
1226 // Returns the length of the replacement text.
1227 int ReplaceTarget(const wxString
& text
);
1229 // Replace the target text with the argument text after \d processing.
1230 // Looks for \d where d is between 1 and 9 and replaces these with the strings
1231 // matched in the last search operation which were surrounded by \( and \).
1232 // Returns the length of the replacement text including any change
1233 // caused by processing the \d patterns.
1234 int ReplaceTargetRE(const wxString
& text
);
1236 // Search for a counted string in the target and set the target to the found
1238 // Returns length of range or -1 for failure in which case target is not moved.
1239 int SearchInTarget(const wxString
& text
);
1241 // Set the search flags used by SearchInTarget
1242 void SetSearchFlags(int flags
);
1244 // Get the search flags used by SearchInTarget
1245 int GetSearchFlags();
1247 // Show a call tip containing a definition near position pos.
1248 void CallTipShow(int pos
, const wxString
& definition
);
1250 // Remove the call tip from the screen.
1251 void CallTipCancel();
1253 // Is there an active call tip?
1254 bool CallTipActive();
1256 // Retrieve the position where the caret was before displaying the call tip.
1257 int CallTipPosAtStart();
1259 // Highlight a segment of the definition.
1260 void CallTipSetHighlight(int start
, int end
);
1262 // Set the background colour for the call tip.
1263 void CallTipSetBackground(const wxColour
& back
);
1265 // Find the display line of a document line taking hidden lines into account.
1266 int VisibleFromDocLine(int line
);
1268 // Find the document line of a display line taking hidden lines into account.
1269 int DocLineFromVisible(int lineDisplay
);
1271 // Set the fold level of a line.
1272 // This encodes an integer level along with flags indicating whether the
1273 // line is a header and whether it is effectively white space.
1274 void SetFoldLevel(int line
, int level
);
1276 // Retrieve the fold level of a line.
1277 int GetFoldLevel(int line
);
1279 // Find the last child line of a header line.
1280 int GetLastChild(int line
, int level
);
1282 // Find the parent line of a child line.
1283 int GetFoldParent(int line
);
1285 // Make a range of lines visible.
1286 void ShowLines(int lineStart
, int lineEnd
);
1288 // Make a range of lines invisible.
1289 void HideLines(int lineStart
, int lineEnd
);
1291 // Is a line visible?
1292 bool GetLineVisible(int line
);
1294 // Show the children of a header line.
1295 void SetFoldExpanded(int line
, bool expanded
);
1297 // Is a header line expanded?
1298 bool GetFoldExpanded(int line
);
1300 // Switch a header line between expanded and contracted.
1301 void ToggleFold(int line
);
1303 // Ensure a particular line is visible by expanding any header line hiding it.
1304 void EnsureVisible(int line
);
1306 // Set some debugging options for folding
1307 void SetFoldFlags(int flags
);
1309 // Ensure a particular line is visible by expanding any header line hiding it.
1310 // Use the currently set visibility policy to determine which range to display.
1311 void EnsureVisibleEnforcePolicy(int line
);
1313 // Sets whether a tab pressed when caret is within indentation indents
1314 void SetTabIndents(bool tabIndents
);
1316 // Does a tab pressed when caret is within indentation indent?
1317 bool GetTabIndents();
1319 // Sets whether a backspace pressed when caret is within indentation unindents
1320 void SetBackSpaceUnIndents(bool bsUnIndents
);
1322 // Does a backspace pressed when caret is within indentation unindent?
1323 bool GetBackSpaceUnIndents();
1325 // Sets the time the mouse must sit still to generate a mouse dwell event
1326 void SetMouseDwellTime(int periodMilliseconds
);
1328 // Retrieve the time the mouse must sit still to generate a mouse dwell event
1329 int GetMouseDwellTime();
1331 // Move the caret inside current view if it's not there already
1332 void MoveCaretInsideView();
1334 // How many characters are on a line, not including end of line characters.
1335 int LineLength(int line
);
1337 // Highlight the characters at two positions.
1338 void BraceHighlight(int pos1
, int pos2
);
1340 // Highlight the character at a position indicating there is no matching brace.
1341 void BraceBadLight(int pos
);
1343 // Find the position of a matching brace or INVALID_POSITION if no match.
1344 int BraceMatch(int pos
);
1346 // Are the end of line characters visible.
1349 // Make the end of line characters visible or invisible
1350 void SetViewEOL(bool visible
);
1352 // Retrieve a pointer to the document object.
1353 void* GetDocPointer();
1355 // Change the document object used.
1356 void SetDocPointer(void* docPointer
);
1358 // Set which document modification events are sent to the container.
1359 void SetModEventMask(int mask
);
1361 // Retrieve the column number which text should be kept within.
1362 int GetEdgeColumn();
1364 // Set the column number of the edge.
1365 // If text goes past the edge then it is highlighted.
1366 void SetEdgeColumn(int column
);
1368 // Retrieve the edge highlight mode.
1371 // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1372 // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1373 void SetEdgeMode(int mode
);
1375 // Retrieve the colour used in edge indication.
1376 wxColour
GetEdgeColour();
1378 // Change the colour used in edge indication.
1379 void SetEdgeColour(const wxColour
& edgeColour
);
1381 // Sets the current caret position to be the search anchor.
1382 void SearchAnchor();
1384 // Find some text starting at the search anchor.
1385 // Does not ensure the selection is visible.
1386 int SearchNext(int flags
, const wxString
& text
);
1388 // Find some text starting at the search anchor and moving backwards.
1389 // Does not ensure the selection is visible.
1390 int SearchPrev(int flags
, const wxString
& text
);
1392 // Set the way the line the caret is on is kept visible.
1393 void SetCaretPolicy(int caretPolicy
, int caretSlop
);
1395 // Retrieves the number of lines completely visible.
1396 int LinesOnScreen();
1398 // Set whether a pop up menu is displayed automatically when the user presses
1399 // the wrong mouse button.
1400 void UsePopUp(bool allowPopUp
);
1402 // Is the selection a rectangular. The alternative is the more common stream selection.
1403 bool SelectionIsRectangle();
1405 // Set the zoom level. This number of points is added to the size of all fonts.
1406 // It may be positive to magnify or negative to reduce.
1407 void SetZoom(int zoom
);
1409 // Retrieve the zoom level.
1412 // Create a new document object.
1413 // Starts with reference count of 1 and not selected into editor.
1414 void* CreateDocument();
1416 // Extend life of document.
1417 void AddRefDocument(void* docPointer
);
1419 // Release a reference to the document, deleting document if it fades to black.
1420 void ReleaseDocument(void* docPointer
);
1422 // Get which document modification events are sent to the container.
1423 int GetModEventMask();
1425 // Change internal focus flag
1426 void SetSTCFocus(bool focus
);
1428 // Get internal focus flag
1431 // Change error status - 0 = OK
1432 void SetStatus(int statusCode
);
1437 // Set whether the mouse is captured when its button is pressed
1438 void SetMouseDownCaptures(bool captures
);
1440 // Get whether mouse gets captured
1441 bool GetMouseDownCaptures();
1443 // Sets the cursor to one of the SC_CURSOR* values
1444 void SetCursor(int cursorType
);
1449 // Move to the previous change in capitalistion
1450 void WordPartLeft();
1452 // Move to the previous change in capitalistion extending selection to new caret position.
1453 void WordPartLeftExtend();
1455 // Move to the change next in capitalistion
1456 void WordPartRight();
1458 // Move to the next change in capitalistion extending selection to new caret position.
1459 void WordPartRightExtend();
1461 // Set the way the display area is determined when a particular line is to be moved to.
1462 void SetVisiblePolicy(int visiblePolicy
, int visibleSlop
);
1464 // Delete back from the current position to the start of the line
1467 // Delete forwards from the current position to the end of the line
1468 void DelLineRight();
1470 // Start notifying the container of all key presses and commands.
1473 // Stop notifying the container of all key presses and commands.
1476 // Set the lexing language of the document.
1477 void SetLexer(int lexer
);
1479 // Retrieve the lexing language of the document.
1482 // Colourise a segment of the document using the current lexing language.
1483 void Colourise(int start
, int end
);
1485 // Set up a value that may be used by a lexer for some optional feature.
1486 void SetProperty(const wxString
& key
, const wxString
& value
);
1488 // Set up the key words used by the lexer.
1489 void SetKeyWords(int keywordSet
, const wxString
& keyWords
);
1491 // Set the lexing language of the document based on string name.
1492 void SetLexerLanguage(const wxString
& language
);
1494 // END of generated section
1495 //----------------------------------------------------------------------
1499 // Returns the line number of the line with the caret.
1500 int GetCurrentLine();
1502 // Extract style settings from a spec-string which is composed of one or
1503 // more of the following comma separated elements:
1505 // bold turns on bold
1506 // italic turns on italics
1507 // fore:#RRGGBB sets the foreground colour
1508 // back:#RRGGBB sets the background colour
1509 // face:[facename] sets the font face name to use
1510 // size:[num] sets the font size in points
1511 // eol turns on eol filling
1512 // underline turns on underlining
1514 void StyleSetSpec(int styleNum
, const wxString
& spec
);
1518 // Set style size, face, bold, italic, and underline attributes from
1519 // a wxFont's attributes.
1520 void StyleSetFont(int styleNum
, wxFont
& font
);
1524 // Set all font style attributes at once.
1525 void StyleSetFontAttr(int styleNum
, int size
,
1526 const wxString
& faceName
,
1527 bool bold
, bool italic
,
1532 // Perform one of the operations defined by the wxSTC_CMD_* constants.
1533 void CmdKeyExecute(int cmd
);
1537 // Set the left and right margin in the edit area, measured in pixels.
1538 void SetMargins(int left
, int right
);
1541 // Retrieve the start and end positions of the current selection.
1543 void GetSelection(int* OUTPUT
, int* OUTPUT
);
1545 void GetSelection(int* startPos
, int* endPos
);
1548 // Retrieve the point in the window where a position is displayed.
1549 wxPoint
PointFromPosition(int pos
);
1552 // Scroll enough to make the given line visible
1553 void ScrollToLine(int line
);
1556 // Scroll enough to make the given column visible
1557 void ScrollToColumn(int column
);
1560 // Send a message to Scintilla
1561 long SendMsg(int msg
, long wp
=0, long lp
=0);
1563 //----------------------------------------------------------------------
1569 void OnPaint(wxPaintEvent
& evt
);
1570 void OnScrollWin(wxScrollWinEvent
& evt
);
1571 void OnSize(wxSizeEvent
& evt
);
1572 void OnMouseLeftDown(wxMouseEvent
& evt
);
1573 void OnMouseMove(wxMouseEvent
& evt
);
1574 void OnMouseLeftUp(wxMouseEvent
& evt
);
1575 void OnContextMenu(wxContextMenuEvent
& evt
);
1576 void OnMouseWheel(wxMouseEvent
& evt
);
1577 void OnChar(wxKeyEvent
& evt
);
1578 void OnKeyDown(wxKeyEvent
& evt
);
1579 void OnLoseFocus(wxFocusEvent
& evt
);
1580 void OnGainFocus(wxFocusEvent
& evt
);
1581 void OnSysColourChanged(wxSysColourChangedEvent
& evt
);
1582 void OnEraseBackground(wxEraseEvent
& evt
);
1583 void OnMenu(wxCommandEvent
& evt
);
1584 void OnListBox(wxCommandEvent
& evt
);
1587 // Turn notifications from Scintilla into events
1588 void NotifyChange();
1589 void NotifyParent(SCNotification
* scn
);
1592 DECLARE_EVENT_TABLE()
1593 DECLARE_CLASS(wxStyledTextCtrl
)
1596 wxStopWatch m_stopWatch
;
1598 bool m_lastKeyDownConsumed
;
1600 friend class ScintillaWX
;
1601 friend class Platform
;
1605 //----------------------------------------------------------------------
1607 class wxStyledTextEvent
: public wxCommandEvent
{
1609 wxStyledTextEvent(wxEventType commandType
=0, int id
=0);
1610 ~wxStyledTextEvent() {}
1612 void SetPosition(int pos
) { m_position
= pos
; }
1613 void SetKey(int k
) { m_key
= k
; }
1614 void SetModifiers(int m
) { m_modifiers
= m
; }
1615 void SetModificationType(int t
) { m_modificationType
= t
; }
1616 void SetText(const char* t
) { m_text
= t
; }
1617 void SetLength(int len
) { m_length
= len
; }
1618 void SetLinesAdded(int num
) { m_linesAdded
= num
; }
1619 void SetLine(int val
) { m_line
= val
; }
1620 void SetFoldLevelNow(int val
) { m_foldLevelNow
= val
; }
1621 void SetFoldLevelPrev(int val
) { m_foldLevelPrev
= val
; }
1622 void SetMargin(int val
) { m_margin
= val
; }
1623 void SetMessage(int val
) { m_message
= val
; }
1624 void SetWParam(int val
) { m_wParam
= val
; }
1625 void SetLParam(int val
) { m_lParam
= val
; }
1626 void SetListType(int val
) { m_listType
= val
; }
1627 void SetX(int val
) { m_x
= val
; }
1628 void SetY(int val
) { m_y
= val
; }
1630 int GetPosition() const { return m_position
; }
1631 int GetKey() const { return m_key
; }
1632 int GetModifiers() const { return m_modifiers
; }
1633 int GetModificationType() const { return m_modificationType
; }
1634 wxString
GetText() const { return m_text
; }
1635 int GetLength() const { return m_length
; }
1636 int GetLinesAdded() const { return m_linesAdded
; }
1637 int GetLine() const { return m_line
; }
1638 int GetFoldLevelNow() const { return m_foldLevelNow
; }
1639 int GetFoldLevelPrev() const { return m_foldLevelPrev
; }
1640 int GetMargin() const { return m_margin
; }
1641 int GetMessage() const { return m_message
; }
1642 int GetWParam() const { return m_wParam
; }
1643 int GetLParam() const { return m_lParam
; }
1644 int GetListType() const { return m_listType
; }
1645 int GetX() const { return m_x
; }
1646 int GetY() const { return m_y
; }
1648 bool GetShift() const;
1649 bool GetControl() const;
1650 bool GetAlt() const;
1652 void CopyObject(wxObject
& obj
) const;
1656 DECLARE_DYNAMIC_CLASS(wxStyledTextEvent
)
1662 int m_modificationType
; // wxEVT_STC_MODIFIED
1668 int m_foldLevelPrev
;
1670 int m_margin
; // wxEVT_STC_MARGINCLICK
1672 int m_message
; // wxEVT_STC_MACRORECORD
1683 BEGIN_DECLARE_EVENT_TYPES()
1684 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE
, 1650)
1685 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED
, 1651)
1686 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED
, 1652)
1687 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED
, 1653)
1688 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT
, 1654)
1689 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT
, 1655)
1690 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY
, 1656)
1691 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK
, 1657)
1692 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI
, 1658)
1693 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED
, 1659)
1694 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD
, 1660)
1695 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK
, 1661)
1696 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN
, 1662)
1697 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED
, 1663)
1698 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_PAINTED
, 1664)
1699 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_USERLISTSELECTION
, 1665)
1700 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED
, 1666)
1701 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART
, 1667)
1702 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND
, 1668)
1703 END_DECLARE_EVENT_TYPES()
1707 wxEVT_STC_STYLENEEDED
,
1708 wxEVT_STC_CHARADDED
,
1709 wxEVT_STC_SAVEPOINTREACHED
,
1710 wxEVT_STC_SAVEPOINTLEFT
,
1711 wxEVT_STC_ROMODIFYATTEMPT
,
1713 wxEVT_STC_DOUBLECLICK
,
1716 wxEVT_STC_MACRORECORD
,
1717 wxEVT_STC_MARGINCLICK
,
1718 wxEVT_STC_NEEDSHOWN
,
1719 wxEVT_STC_POSCHANGED
,
1721 wxEVT_STC_USERLISTSELECTION
,
1722 wxEVT_STC_URIDROPPED
,
1723 wxEVT_STC_DWELLSTART
,
1731 typedef void (wxEvtHandler::*wxStyledTextEventFunction
)(wxStyledTextEvent
&);
1733 #define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1734 #define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1735 #define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1736 #define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1737 #define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1738 #define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1739 #define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1740 #define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1741 #define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1742 #define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1743 #define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1744 #define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1745 #define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1746 #define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1747 #define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1748 #define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1749 #define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1750 #define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1751 #define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1756 //----------------------------------------------------------------------
1757 //----------------------------------------------------------------------