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");
635 wxStyledTextCtrl(wxWindow
*parent
, wxWindowID id
,
636 const wxPoint
& pos
= wxDefaultPosition
,
637 const wxSize
& size
= wxDefaultSize
, long style
= 0,
638 const wxString
& name
= wxSTCNameStr
);
646 //----------------------------------------------------------------------
647 // BEGIN generated section. The following code is automatically generated
648 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
652 // Add text to the document
653 void AddText(const wxString
& text
);
655 // Add array of cells to document
656 void AddStyledText(const wxString
& text
);
658 // Insert string at a position
659 void InsertText(int pos
, const wxString
& text
);
661 // Delete all text in the document
664 // Set all style bytes to 0, remove all folding information
665 void ClearDocumentStyle();
667 // The number of characters in the document
670 // Returns the character byte at the position
671 int GetCharAt(int pos
);
673 // Returns the position of the caret
676 // Returns the position of the opposite end of the selection to the caret
679 // Returns the style byte at the position
680 int GetStyleAt(int pos
);
682 // Redoes the next action on the undo history
685 // Choose between collecting actions into the undo
686 // history and discarding them.
687 void SetUndoCollection(bool collectUndo
);
689 // Select all the text in the document.
692 // Remember the current position in the undo history as the position
693 // at which the document was saved.
696 // Retrieve a buffer of cells.
697 wxString
GetStyledText(int startPos
, int endPos
);
699 // Are there any redoable actions in the undo history.
702 // Retrieve the line number at which a particular marker is located
703 int MarkerLineFromHandle(int handle
);
706 void MarkerDeleteHandle(int handle
);
708 // Is undo history being collected?
709 bool GetUndoCollection();
711 // Are white space characters currently visible?
712 // Returns one of SCWS_* constants.
713 int GetViewWhiteSpace();
715 // Make white space characters invisible, always visible or visible outside indentation.
716 void SetViewWhiteSpace(int viewWS
);
718 // Find the position from a point within the window.
719 int PositionFromPoint(wxPoint pt
);
721 // Find the position from a point within the window but return
722 // INVALID_POSITION if not close to text.
723 int PositionFromPointClose(int x
, int y
);
725 // Set caret to start of a line and ensure it is visible.
726 void GotoLine(int line
);
728 // Set caret to a position and ensure it is visible.
729 void GotoPos(int pos
);
731 // Set the selection anchor to a position. The anchor is the opposite
732 // end of the selection from the caret.
733 void SetAnchor(int posAnchor
);
735 // Retrieve the text of the line containing the caret.
736 // Returns the index of the caret on the line.
737 wxString
GetCurLine(int* OUTPUT
=NULL
);
739 // Retrieve the position of the last correctly styled character.
742 // Convert all line endings in the document to one mode.
743 void ConvertEOLs(int eolMode
);
745 // Retrieve the current end of line mode - one of CRLF, CR, or LF.
748 // Set the current end of line mode.
749 void SetEOLMode(int eolMode
);
751 // Set the current styling position to pos and the styling mask to mask.
752 // The styling mask can be used to protect some bits in each styling byte from
754 void StartStyling(int pos
, int mask
);
756 // Change style from current styling position for length characters to a style
757 // and move the current styling position to after this newly styled segment.
758 void SetStyling(int length
, int style
);
760 // Is drawing done first into a buffer or direct to the screen.
761 bool GetBufferedDraw();
763 // If drawing is buffered then each line of text is drawn into a bitmap buffer
764 // before drawing it to the screen to avoid flicker.
765 void SetBufferedDraw(bool buffered
);
767 // Change the visible size of a tab to be a multiple of the width of a space
769 void SetTabWidth(int tabWidth
);
771 // Retrieve the visible size of a tab.
774 // Set the code page used to interpret the bytes of the document as characters.
775 // The SC_CP_UTF8 value can be used to enter Unicode mode.
776 void SetCodePage(int codePage
);
778 // Set the symbol used for a particular marker number,
779 // and optionally the for and background colours.
780 void MarkerDefine(int markerNumber
, int markerSymbol
,
781 const wxColour
& foreground
= wxNullColour
,
782 const wxColour
& background
= wxNullColour
);
784 // Set the foreground colour used for a particular marker number.
785 void MarkerSetForeground(int markerNumber
, const wxColour
& fore
);
787 // Set the background colour used for a particular marker number.
788 void MarkerSetBackground(int markerNumber
, const wxColour
& back
);
790 // Add a marker to a line.
791 void MarkerAdd(int line
, int markerNumber
);
793 // Delete a marker from a line
794 void MarkerDelete(int line
, int markerNumber
);
796 // Delete all markers with a particular number from all lines
797 void MarkerDeleteAll(int markerNumber
);
799 // Get a bit mask of all the markers set on a line.
800 int MarkerGet(int line
);
802 // Find the next line after lineStart that includes a marker in mask.
803 int MarkerNext(int lineStart
, int markerMask
);
805 // Find the previous line before lineStart that includes a marker in mask.
806 int MarkerPrevious(int lineStart
, int markerMask
);
808 // Set a margin to be either numeric or symbolic.
809 void SetMarginType(int margin
, int marginType
);
811 // Retrieve the type of a margin.
812 int GetMarginType(int margin
);
814 // Set the width of a margin to a width expressed in pixels.
815 void SetMarginWidth(int margin
, int pixelWidth
);
817 // Retrieve the width of a margin in pixels.
818 int GetMarginWidth(int margin
);
820 // Set a mask that determines which markers are displayed in a margin.
821 void SetMarginMask(int margin
, int mask
);
823 // Retrieve the marker mask of a margin.
824 int GetMarginMask(int margin
);
826 // Make a margin sensitive or insensitive to mouse clicks.
827 void SetMarginSensitive(int margin
, bool sensitive
);
829 // Retrieve the mouse click sensitivity of a margin.
830 bool GetMarginSensitive(int margin
);
832 // Clear all the styles and make equivalent to the global default style.
833 void StyleClearAll();
835 // Set the foreground colour of a style.
836 void StyleSetForeground(int style
, const wxColour
& fore
);
838 // Set the background colour of a style.
839 void StyleSetBackground(int style
, const wxColour
& back
);
841 // Set a style to be bold or not.
842 void StyleSetBold(int style
, bool bold
);
844 // Set a style to be italic or not.
845 void StyleSetItalic(int style
, bool italic
);
847 // Set the size of characters of a style.
848 void StyleSetSize(int style
, int sizePoints
);
850 // Set the font of a style.
851 void StyleSetFaceName(int style
, const wxString
& fontName
);
853 // Set a style to have its end of line filled or not.
854 void StyleSetEOLFilled(int style
, bool filled
);
856 // Reset the default style to its state at startup
857 void StyleResetDefault();
859 // Set a style to be underlined or not.
860 void StyleSetUnderline(int style
, bool underline
);
862 // Set a style to be mixed case, or to force upper or lower case.
863 void StyleSetCase(int style
, int caseForce
);
865 // Set the foreground colour of the selection and whether to use this setting.
866 void SetSelForeground(bool useSetting
, const wxColour
& fore
);
868 // Set the background colour of the selection and whether to use this setting.
869 void SetSelBackground(bool useSetting
, const wxColour
& back
);
871 // Set the foreground colour of the caret.
872 void SetCaretForeground(const wxColour
& fore
);
874 // When key+modifier combination km is pressed perform msg.
875 void CmdKeyAssign(int key
, int modifiers
, int cmd
);
877 // When key+modifier combination km do nothing.
878 void CmdKeyClear(int key
, int modifiers
);
880 // Drop all key mappings.
881 void CmdKeyClearAll();
883 // Set the styles for a segment of the document.
884 void SetStyleBytes(int length
, char* styleBytes
);
886 // Set a style to be visible or not.
887 void StyleSetVisible(int style
, bool visible
);
889 // Get the time in milliseconds that the caret is on and off.
890 int GetCaretPeriod();
892 // Get the time in milliseconds that the caret is on and off. 0 = steady on.
893 void SetCaretPeriod(int periodMilliseconds
);
895 // Set the set of characters making up words for when moving or selecting
897 void SetWordChars(const wxString
& characters
);
899 // Start a sequence of actions that is undone and redone as a unit.
901 void BeginUndoAction();
903 // End a sequence of actions that is undone and redone as a unit.
904 void EndUndoAction();
906 // Set an indicator to plain, squiggle or TT.
907 void IndicatorSetStyle(int indic
, int style
);
909 // Retrieve the style of an indicator.
910 int IndicatorGetStyle(int indic
);
912 // Set the foreground colour of an indicator.
913 void IndicatorSetForeground(int indic
, const wxColour
& fore
);
915 // Retrieve the foreground colour of an indicator.
916 wxColour
IndicatorGetForeground(int indic
);
918 // Divide each styling byte into lexical class bits (default:5) and indicator
919 // bits (default:3). If a lexer requires more than 32 lexical states, then this
920 // is used to expand the possible states.
921 void SetStyleBits(int bits
);
923 // Retrieve number of bits in style bytes used to hold the lexical state.
926 // Used to hold extra styling information for each line.
927 void SetLineState(int line
, int state
);
929 // Retrieve the extra styling information for a line.
930 int GetLineState(int line
);
932 // Retrieve the last line number that has line state.
933 int GetMaxLineState();
935 // Is the background of the line containing the caret in a different colour?
936 bool GetCaretLineVisible();
938 // Display the background of the line containing the caret in a different colour.
939 void SetCaretLineVisible(bool show
);
941 // Get the colour of the background of the line containing the caret.
942 wxColour
GetCaretLineBack();
944 // Set the colour of the background of the line containing the caret.
945 void SetCaretLineBack(const wxColour
& back
);
947 // Display a auto-completion list.
948 // The lenEntered parameter indicates how many characters before
949 // the caret should be used to provide context.
950 void AutoCompShow(int lenEntered
, const wxString
& itemList
);
952 // Remove the auto-completion list from the screen.
953 void AutoCompCancel();
955 // Is there an auto-completion list visible?
956 bool AutoCompActive();
958 // Retrieve the position of the caret when the auto-completion list was
960 int AutoCompPosStart();
962 // User has selected an item so remove the list and insert the selection.
963 void AutoCompComplete();
965 // Define a set of character that when typed cancel the auto-completion list.
966 void AutoCompStops(const wxString
& characterSet
);
968 // Change the separator character in the string setting up an auto-completion
969 // list. Default is space but can be changed if items contain space.
970 void AutoCompSetSeparator(int separatorCharacter
);
972 // Retrieve the auto-completion list separator character.
973 int AutoCompGetSeparator();
975 // Select the item in the auto-completion list that starts with a string.
976 void AutoCompSelect(const wxString
& text
);
978 // Should the auto-completion list be cancelled if the user backspaces to a
979 // position before where the box was created.
980 void AutoCompSetCancelAtStart(bool cancel
);
982 // Retrieve whether auto-completion cancelled by backspacing before start.
983 bool AutoCompGetCancelAtStart();
985 // Define a set of character that when typed fills up the selected word.
986 void AutoCompSetFillUps(const wxString
& characterSet
);
988 // Should a single item auto-completion list automatically choose the item.
989 void AutoCompSetChooseSingle(bool chooseSingle
);
991 // Retrieve whether a single item auto-completion list automatically choose the item.
992 bool AutoCompGetChooseSingle();
994 // Set whether case is significant when performing auto-completion searches.
995 void AutoCompSetIgnoreCase(bool ignoreCase
);
997 // Retrieve state of ignore case flag.
998 bool AutoCompGetIgnoreCase();
1000 // Display a list of strings and send notification when user chooses one.
1001 void UserListShow(int listType
, const wxString
& itemList
);
1003 // Set whether or not autocompletion is hidden automatically when nothing matches
1004 void AutoCompSetAutoHide(bool autoHide
);
1006 // Retrieve whether or not autocompletion is hidden automatically when nothing matches
1007 bool AutoCompGetAutoHide();
1009 // Set the number of spaces used for one level of indentation.
1010 void SetIndent(int indentSize
);
1012 // Retrieve indentation size.
1015 // Indentation will only use space characters if useTabs is false, otherwise
1016 // it will use a combination of tabs and spaces.
1017 void SetUseTabs(bool useTabs
);
1019 // Retrieve whether tabs will be used in indentation.
1022 // Change the indentation of a line to a number of columns.
1023 void SetLineIndentation(int line
, int indentSize
);
1025 // Retrieve the number of columns that a line is indented.
1026 int GetLineIndentation(int line
);
1028 // Retrieve the position before the first non indentation character on a line.
1029 int GetLineIndentPosition(int line
);
1031 // Retrieve the column number of a position, taking tab width into account.
1032 int GetColumn(int pos
);
1034 // Show or hide the horizontal scroll bar.
1035 void SetUseHorizontalScrollBar(bool show
);
1037 // Is the horizontal scroll bar visible?
1038 bool GetUseHorizontalScrollBar();
1040 // Show or hide indentation guides.
1041 void SetIndentationGuides(bool show
);
1043 // Are the indentation guides visible?
1044 bool GetIndentationGuides();
1046 // Set the highlighted indentation guide column.
1047 // 0 = no highlighted guide.
1048 void SetHighlightGuide(int column
);
1050 // Get the highlighted indentation guide column.
1051 int GetHighlightGuide();
1053 // Get the position after the last visible characters on a line.
1054 int GetLineEndPosition(int line
);
1056 // Get the code page used to interpret the bytes of the document as characters.
1059 // Get the foreground colour of the caret.
1060 wxColour
GetCaretForeground();
1062 // In read-only mode?
1065 // Sets the position of the caret.
1066 void SetCurrentPos(int pos
);
1068 // Sets the position that starts the selection - this becomes the anchor.
1069 void SetSelectionStart(int pos
);
1071 // Returns the position at the start of the selection.
1072 int GetSelectionStart();
1074 // Sets the position that ends the selection - this becomes the currentPosition.
1075 void SetSelectionEnd(int pos
);
1077 // Returns the position at the end of the selection.
1078 int GetSelectionEnd();
1080 // Sets the print magnification added to the point size of each style for printing.
1081 void SetPrintMagnification(int magnification
);
1083 // Returns the print magnification.
1084 int GetPrintMagnification();
1086 // Modify colours when printing for clearer printed text.
1087 void SetPrintColourMode(int mode
);
1089 // Returns the print colour mode.
1090 int GetPrintColourMode();
1092 // Find some text in the document.
1093 int FindText(int minPos
, int maxPos
,
1094 const wxString
& text
,
1095 bool caseSensitive
, bool wholeWord
);
1097 // On Windows will draw the document into a display context such as a printer.
1098 int FormatRange(bool doDraw
,
1102 wxDC
* target
, // Why does it use two? Can they be the same?
1106 // Retrieve the line at the top of the display.
1107 int GetFirstVisibleLine();
1109 // Retrieve the contents of a line.
1110 wxString
GetLine(int line
);
1112 // Returns the number of lines in the document. There is always at least one.
1115 // Sets the size in pixels of the left margin.
1116 void SetMarginLeft(int pixelWidth
);
1118 // Returns the size in pixels of the left margin.
1119 int GetMarginLeft();
1121 // Sets the size in pixels of the right margin.
1122 void SetMarginRight(int pixelWidth
);
1124 // Returns the size in pixels of the right margin.
1125 int GetMarginRight();
1127 // Is the document different from when it was last saved?
1130 // Select a range of text.
1131 void SetSelection(int start
, int end
);
1133 // Retrieve the selected text.
1134 wxString
GetSelectedText();
1136 // Retrieve a range of text.
1137 wxString
GetTextRange(int startPos
, int endPos
);
1139 // Draw the selection in normal style or with selection highlighted.
1140 void HideSelection(bool normal
);
1142 // Retrieve the line containing a position.
1143 int LineFromPosition(int pos
);
1145 // Retrieve the position at the start of a line.
1146 int PositionFromLine(int line
);
1148 // Scroll horizontally and vertically.
1149 void LineScroll(int columns
, int lines
);
1151 // Ensure the caret is visible.
1152 void EnsureCaretVisible();
1154 // Replace the selected text with the argument text.
1155 void ReplaceSelection(const wxString
& text
);
1157 // Set to read only or read write.
1158 void SetReadOnly(bool readOnly
);
1160 // Will a paste succeed?
1163 // Are there any undoable actions in the undo history.
1166 // Delete the undo history.
1167 void EmptyUndoBuffer();
1169 // Undo one action in the undo history.
1172 // Cut the selection to the clipboard.
1175 // Copy the selection to the clipboard.
1178 // Paste the contents of the clipboard into the document replacing the selection.
1181 // Clear the selection.
1184 // Replace the contents of the document with the argument text.
1185 void SetText(const wxString
& text
);
1187 // Retrieve all the text in the document.
1190 // Retrieve the number of characters in the document.
1191 int GetTextLength();
1193 // Set to overtype (true) or insert mode
1194 void SetOvertype(bool overtype
);
1196 // Returns true if overtype mode is active otherwise false is returned.
1199 // Set the width of the insert mode caret
1200 void SetCaretWidth(int pixelWidth
);
1202 // Returns the width of the insert mode caret
1203 int GetCaretWidth();
1205 // Sets the position that starts the target which is used for updating the
1206 // document without affecting the scroll position.
1207 void SetTargetStart(int pos
);
1209 // Get the position that starts the target.
1210 int GetTargetStart();
1212 // Sets the position that ends the target which is used for updating the
1213 // document without affecting the scroll position.
1214 void SetTargetEnd(int pos
);
1216 // Get the position that ends the target.
1219 // Replace the target text with the argument text.
1220 // Returns the length of the replacement text.
1221 int ReplaceTarget(const wxString
& text
);
1223 // Replace the target text with the argument text after \d processing.
1224 // Looks for \d where d is between 1 and 9 and replaces these with the strings
1225 // matched in the last search operation which were surrounded by \( and \).
1226 // Returns the length of the replacement text including any change
1227 // caused by processing the \d patterns.
1228 int ReplaceTargetRE(const wxString
& text
);
1230 // Search for a counted string in the target and set the target to the found
1232 // Returns length of range or -1 for failure in which case target is not moved.
1233 int SearchInTarget(const wxString
& text
);
1235 // Set the search flags used by SearchInTarget
1236 void SetSearchFlags(int flags
);
1238 // Get the search flags used by SearchInTarget
1239 int GetSearchFlags();
1241 // Show a call tip containing a definition near position pos.
1242 void CallTipShow(int pos
, const wxString
& definition
);
1244 // Remove the call tip from the screen.
1245 void CallTipCancel();
1247 // Is there an active call tip?
1248 bool CallTipActive();
1250 // Retrieve the position where the caret was before displaying the call tip.
1251 int CallTipPosAtStart();
1253 // Highlight a segment of the definition.
1254 void CallTipSetHighlight(int start
, int end
);
1256 // Set the background colour for the call tip.
1257 void CallTipSetBackground(const wxColour
& back
);
1259 // Find the display line of a document line taking hidden lines into account.
1260 int VisibleFromDocLine(int line
);
1262 // Find the document line of a display line taking hidden lines into account.
1263 int DocLineFromVisible(int lineDisplay
);
1265 // Set the fold level of a line.
1266 // This encodes an integer level along with flags indicating whether the
1267 // line is a header and whether it is effectively white space.
1268 void SetFoldLevel(int line
, int level
);
1270 // Retrieve the fold level of a line.
1271 int GetFoldLevel(int line
);
1273 // Find the last child line of a header line.
1274 int GetLastChild(int line
, int level
);
1276 // Find the parent line of a child line.
1277 int GetFoldParent(int line
);
1279 // Make a range of lines visible.
1280 void ShowLines(int lineStart
, int lineEnd
);
1282 // Make a range of lines invisible.
1283 void HideLines(int lineStart
, int lineEnd
);
1285 // Is a line visible?
1286 bool GetLineVisible(int line
);
1288 // Show the children of a header line.
1289 void SetFoldExpanded(int line
, bool expanded
);
1291 // Is a header line expanded?
1292 bool GetFoldExpanded(int line
);
1294 // Switch a header line between expanded and contracted.
1295 void ToggleFold(int line
);
1297 // Ensure a particular line is visible by expanding any header line hiding it.
1298 void EnsureVisible(int line
);
1300 // Set some debugging options for folding
1301 void SetFoldFlags(int flags
);
1303 // Ensure a particular line is visible by expanding any header line hiding it.
1304 // Use the currently set visibility policy to determine which range to display.
1305 void EnsureVisibleEnforcePolicy(int line
);
1307 // Sets whether a tab pressed when caret is within indentation indents
1308 void SetTabIndents(bool tabIndents
);
1310 // Does a tab pressed when caret is within indentation indent?
1311 bool GetTabIndents();
1313 // Sets whether a backspace pressed when caret is within indentation unindents
1314 void SetBackSpaceUnIndents(bool bsUnIndents
);
1316 // Does a backspace pressed when caret is within indentation unindent?
1317 bool GetBackSpaceUnIndents();
1319 // Sets the time the mouse must sit still to generate a mouse dwell event
1320 void SetMouseDwellTime(int periodMilliseconds
);
1322 // Retrieve the time the mouse must sit still to generate a mouse dwell event
1323 int GetMouseDwellTime();
1325 // Move the caret inside current view if it's not there already
1326 void MoveCaretInsideView();
1328 // How many characters are on a line, not including end of line characters.
1329 int LineLength(int line
);
1331 // Highlight the characters at two positions.
1332 void BraceHighlight(int pos1
, int pos2
);
1334 // Highlight the character at a position indicating there is no matching brace.
1335 void BraceBadLight(int pos
);
1337 // Find the position of a matching brace or INVALID_POSITION if no match.
1338 int BraceMatch(int pos
);
1340 // Are the end of line characters visible.
1343 // Make the end of line characters visible or invisible
1344 void SetViewEOL(bool visible
);
1346 // Retrieve a pointer to the document object.
1347 void* GetDocPointer();
1349 // Change the document object used.
1350 void SetDocPointer(void* docPointer
);
1352 // Set which document modification events are sent to the container.
1353 void SetModEventMask(int mask
);
1355 // Retrieve the column number which text should be kept within.
1356 int GetEdgeColumn();
1358 // Set the column number of the edge.
1359 // If text goes past the edge then it is highlighted.
1360 void SetEdgeColumn(int column
);
1362 // Retrieve the edge highlight mode.
1365 // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1366 // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1367 void SetEdgeMode(int mode
);
1369 // Retrieve the colour used in edge indication.
1370 wxColour
GetEdgeColour();
1372 // Change the colour used in edge indication.
1373 void SetEdgeColour(const wxColour
& edgeColour
);
1375 // Sets the current caret position to be the search anchor.
1376 void SearchAnchor();
1378 // Find some text starting at the search anchor.
1379 // Does not ensure the selection is visible.
1380 int SearchNext(int flags
, const wxString
& text
);
1382 // Find some text starting at the search anchor and moving backwards.
1383 // Does not ensure the selection is visible.
1384 int SearchPrev(int flags
, const wxString
& text
);
1386 // Set the way the line the caret is on is kept visible.
1387 void SetCaretPolicy(int caretPolicy
, int caretSlop
);
1389 // Retrieves the number of lines completely visible.
1390 int LinesOnScreen();
1392 // Set whether a pop up menu is displayed automatically when the user presses
1393 // the wrong mouse button.
1394 void UsePopUp(bool allowPopUp
);
1396 // Is the selection a rectangular. The alternative is the more common stream selection.
1397 bool SelectionIsRectangle();
1399 // Set the zoom level. This number of points is added to the size of all fonts.
1400 // It may be positive to magnify or negative to reduce.
1401 void SetZoom(int zoom
);
1403 // Retrieve the zoom level.
1406 // Create a new document object.
1407 // Starts with reference count of 1 and not selected into editor.
1408 void* CreateDocument();
1410 // Extend life of document.
1411 void AddRefDocument(void* docPointer
);
1413 // Release a reference to the document, deleting document if it fades to black.
1414 void ReleaseDocument(void* docPointer
);
1416 // Get which document modification events are sent to the container.
1417 int GetModEventMask();
1419 // Change internal focus flag
1420 void SetFocus(bool focus
);
1422 // Get internal focus flag
1425 // Change error status - 0 = OK
1426 void SetStatus(int statusCode
);
1431 // Set whether the mouse is captured when its button is pressed
1432 void SetMouseDownCaptures(bool captures
);
1434 // Get whether mouse gets captured
1435 bool GetMouseDownCaptures();
1437 // Sets the cursor to one of the SC_CURSOR* values
1438 void SetCursor(int cursorType
);
1443 // Move to the previous change in capitalistion
1444 void WordPartLeft();
1446 // Move to the previous change in capitalistion extending selection to new caret position.
1447 void WordPartLeftExtend();
1449 // Move to the change next in capitalistion
1450 void WordPartRight();
1452 // Move to the next change in capitalistion extending selection to new caret position.
1453 void WordPartRightExtend();
1455 // Set the way the display area is determined when a particular line is to be moved to.
1456 void SetVisiblePolicy(int visiblePolicy
, int visibleSlop
);
1458 // Delete back from the current position to the start of the line
1461 // Delete forwards from the current position to the end of the line
1462 void DelLineRight();
1464 // Start notifying the container of all key presses and commands.
1467 // Stop notifying the container of all key presses and commands.
1470 // Set the lexing language of the document.
1471 void SetLexer(int lexer
);
1473 // Retrieve the lexing language of the document.
1476 // Colourise a segment of the document using the current lexing language.
1477 void Colourise(int start
, int end
);
1479 // Set up a value that may be used by a lexer for some optional feature.
1480 void SetProperty(const wxString
& key
, const wxString
& value
);
1482 // Set up the key words used by the lexer.
1483 void SetKeyWords(int keywordSet
, const wxString
& keyWords
);
1485 // Set the lexing language of the document based on string name.
1486 void SetLexerLanguage(const wxString
& language
);
1488 // END of generated section
1489 //----------------------------------------------------------------------
1493 // Returns the line number of the line with the caret.
1494 int GetCurrentLine();
1496 // Extract style settings from a spec-string which is composed of one or
1497 // more of the following comma separated elements:
1499 // bold turns on bold
1500 // italic turns on italics
1501 // fore:#RRGGBB sets the foreground colour
1502 // back:#RRGGBB sets the background colour
1503 // face:[facename] sets the font face name to use
1504 // size:[num] sets the font size in points
1505 // eol turns on eol filling
1506 // underline turns on underlining
1508 void StyleSetSpec(int styleNum
, const wxString
& spec
);
1512 // Set style size, face, bold, italic, and underline attributes from
1513 // a wxFont's attributes.
1514 void StyleSetFont(int styleNum
, wxFont
& font
);
1518 // Set all font style attributes at once.
1519 void StyleSetFontAttr(int styleNum
, int size
,
1520 const wxString
& faceName
,
1521 bool bold
, bool italic
,
1526 // Perform one of the operations defined by the wxSTC_CMD_* constants.
1527 void CmdKeyExecute(int cmd
);
1531 // Set the left and right margin in the edit area, measured in pixels.
1532 void SetMargins(int left
, int right
);
1535 // Retrieve the start and end positions of the current selection.
1537 void GetSelection(int* OUTPUT
, int* OUTPUT
);
1539 void GetSelection(int* startPos
, int* endPos
);
1542 // Retrieve the point in the window where a position is displayed.
1543 wxPoint
PointFromPosition(int pos
);
1546 // Scroll enough to make the given line visible
1547 void ScrollToLine(int line
);
1550 // Scroll enough to make the given column visible
1551 void ScrollToColumn(int column
);
1554 // Send a message to Scintilla
1555 long SendMsg(int msg
, long wp
=0, long lp
=0);
1557 //----------------------------------------------------------------------
1563 void OnPaint(wxPaintEvent
& evt
);
1564 void OnScrollWin(wxScrollWinEvent
& evt
);
1565 void OnSize(wxSizeEvent
& evt
);
1566 void OnMouseLeftDown(wxMouseEvent
& evt
);
1567 void OnMouseMove(wxMouseEvent
& evt
);
1568 void OnMouseLeftUp(wxMouseEvent
& evt
);
1569 void OnContextMenu(wxContextMenuEvent
& evt
);
1570 void OnMouseWheel(wxMouseEvent
& evt
);
1571 void OnChar(wxKeyEvent
& evt
);
1572 void OnKeyDown(wxKeyEvent
& evt
);
1573 void OnLoseFocus(wxFocusEvent
& evt
);
1574 void OnGainFocus(wxFocusEvent
& evt
);
1575 void OnSysColourChanged(wxSysColourChangedEvent
& evt
);
1576 void OnEraseBackground(wxEraseEvent
& evt
);
1577 void OnMenu(wxCommandEvent
& evt
);
1578 void OnListBox(wxCommandEvent
& evt
);
1581 // Turn notifications from Scintilla into events
1582 void NotifyChange();
1583 void NotifyParent(SCNotification
* scn
);
1586 DECLARE_EVENT_TABLE()
1587 DECLARE_CLASS(wxStyledTextCtrl
)
1590 wxStopWatch m_stopWatch
;
1593 friend class ScintillaWX
;
1594 friend class Platform
;
1598 //----------------------------------------------------------------------
1600 class wxStyledTextEvent
: public wxCommandEvent
{
1602 wxStyledTextEvent(wxEventType commandType
=0, int id
=0);
1603 ~wxStyledTextEvent() {}
1605 void SetPosition(int pos
) { m_position
= pos
; }
1606 void SetKey(int k
) { m_key
= k
; }
1607 void SetModifiers(int m
) { m_modifiers
= m
; }
1608 void SetModificationType(int t
) { m_modificationType
= t
; }
1609 void SetText(const char* t
) { m_text
= t
; }
1610 void SetLength(int len
) { m_length
= len
; }
1611 void SetLinesAdded(int num
) { m_linesAdded
= num
; }
1612 void SetLine(int val
) { m_line
= val
; }
1613 void SetFoldLevelNow(int val
) { m_foldLevelNow
= val
; }
1614 void SetFoldLevelPrev(int val
) { m_foldLevelPrev
= val
; }
1615 void SetMargin(int val
) { m_margin
= val
; }
1616 void SetMessage(int val
) { m_message
= val
; }
1617 void SetWParam(int val
) { m_wParam
= val
; }
1618 void SetLParam(int val
) { m_lParam
= val
; }
1619 void SetListType(int val
) { m_listType
= val
; }
1620 void SetX(int val
) { m_x
= val
; }
1621 void SetY(int val
) { m_y
= val
; }
1623 int GetPosition() const { return m_position
; }
1624 int GetKey() const { return m_key
; }
1625 int GetModifiers() const { return m_modifiers
; }
1626 int GetModificationType() const { return m_modificationType
; }
1627 wxString
GetText() const { return m_text
; }
1628 int GetLength() const { return m_length
; }
1629 int GetLinesAdded() const { return m_linesAdded
; }
1630 int GetLine() const { return m_line
; }
1631 int GetFoldLevelNow() const { return m_foldLevelNow
; }
1632 int GetFoldLevelPrev() const { return m_foldLevelPrev
; }
1633 int GetMargin() const { return m_margin
; }
1634 int GetMessage() const { return m_message
; }
1635 int GetWParam() const { return m_wParam
; }
1636 int GetLParam() const { return m_lParam
; }
1637 int GetListType() const { return m_listType
; }
1638 int GetX() const { return m_x
; }
1639 int GetY() const { return m_y
; }
1641 bool GetShift() const;
1642 bool GetControl() const;
1643 bool GetAlt() const;
1645 void CopyObject(wxObject
& obj
) const;
1649 DECLARE_DYNAMIC_CLASS(wxStyledTextEvent
)
1655 int m_modificationType
; // wxEVT_STC_MODIFIED
1661 int m_foldLevelPrev
;
1663 int m_margin
; // wxEVT_STC_MARGINCLICK
1665 int m_message
; // wxEVT_STC_MACRORECORD
1676 BEGIN_DECLARE_EVENT_TYPES()
1677 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE
, 1650)
1678 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED
, 1651)
1679 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED
, 1652)
1680 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED
, 1653)
1681 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT
, 1654)
1682 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT
, 1655)
1683 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY
, 1656)
1684 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK
, 1657)
1685 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI
, 1658)
1686 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED
, 1659)
1687 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD
, 1660)
1688 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK
, 1661)
1689 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN
, 1662)
1690 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED
, 1663)
1691 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_PAINTED
, 1664)
1692 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_USERLISTSELECTION
, 1665)
1693 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED
, 1666)
1694 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART
, 1667)
1695 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND
, 1668)
1696 END_DECLARE_EVENT_TYPES()
1700 wxEVT_STC_STYLENEEDED
,
1701 wxEVT_STC_CHARADDED
,
1702 wxEVT_STC_SAVEPOINTREACHED
,
1703 wxEVT_STC_SAVEPOINTLEFT
,
1704 wxEVT_STC_ROMODIFYATTEMPT
,
1706 wxEVT_STC_DOUBLECLICK
,
1709 wxEVT_STC_MACRORECORD
,
1710 wxEVT_STC_MARGINCLICK
,
1711 wxEVT_STC_NEEDSHOWN
,
1712 wxEVT_STC_POSCHANGED
,
1714 wxEVT_STC_USERLISTSELECTION
,
1715 wxEVT_STC_URIDROPPED
,
1716 wxEVT_STC_DWELLSTART
,
1724 typedef void (wxEvtHandler::*wxStyledTextEventFunction
)(wxStyledTextEvent
&);
1726 #define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1727 #define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1728 #define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1729 #define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1730 #define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1731 #define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1732 #define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1733 #define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1734 #define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1735 #define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1736 #define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1737 #define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1738 #define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1739 #define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1740 #define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1741 #define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1742 #define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1743 #define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1744 #define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1749 //----------------------------------------------------------------------
1750 //----------------------------------------------------------------------