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 /////////////////////////////////////////////////////////////////////////////
29 * If we're using wx in Dynamic Library format do we
30 * want wxStyledTextCtrl to be in DLL form as well?
32 #if defined(WXUSINGDLL) && \
33 (defined(WXMAKING_STC_DLL) || defined(WXUSING_STC_DLL))
35 #if defined(WXMAKING_STC_DLL)
36 // When building the DLL WXSTC_DECLSPEC exports classes
37 # define WXSTC_DECLSPEC WXEXPORT
38 #elif defined(WXUSING_STC_DLL)
39 // When using the DLL WXSTC_DECLSPEC imports classes
40 # define WXSTC_DECLSPEC WXIMPORT
41 #endif // defined(WXBUILD_STC_DLL)
44 // When building the static library nullify the effect of WXSTC_DECLSPEC
45 #define WXSTC_DECLSPEC
46 #endif // WXUSINGDLL && (WXMAKING_STC_DLL || WXUSING_STC_DLL)
51 //----------------------------------------------------------------------
53 // Should a wxPopupWindow be used for the call tips and autocomplete windows?
54 #ifndef wxSTC_USE_POPUP
55 #define wxSTC_USE_POPUP 1
58 //----------------------------------------------------------------------
59 // BEGIN generated section. The following code is automatically generated
60 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
63 #define wxSTC_INVALID_POSITION -1
65 // Define start of Scintilla messages to be greater than all edit (EM_*) messages
66 // as many EM_ messages can be used although that use is deprecated.
67 #define wxSTC_START 2000
68 #define wxSTC_OPTIONAL_START 3000
69 #define wxSTC_LEXER_START 4000
70 #define wxSTC_WS_INVISIBLE 0
71 #define wxSTC_WS_VISIBLEALWAYS 1
72 #define wxSTC_WS_VISIBLEAFTERINDENT 2
73 #define wxSTC_EOL_CRLF 0
74 #define wxSTC_EOL_CR 1
75 #define wxSTC_EOL_LF 2
77 // The SC_CP_UTF8 value can be used to enter Unicode mode.
78 // This is the same value as CP_UTF8 in Windows
79 #define wxSTC_CP_UTF8 65001
80 #define wxSTC_MARKER_MAX 31
81 #define wxSTC_MARK_CIRCLE 0
82 #define wxSTC_MARK_ROUNDRECT 1
83 #define wxSTC_MARK_ARROW 2
84 #define wxSTC_MARK_SMALLRECT 3
85 #define wxSTC_MARK_SHORTARROW 4
86 #define wxSTC_MARK_EMPTY 5
87 #define wxSTC_MARK_ARROWDOWN 6
88 #define wxSTC_MARK_MINUS 7
89 #define wxSTC_MARK_PLUS 8
91 // Shapes used for outlining column.
92 #define wxSTC_MARK_VLINE 9
93 #define wxSTC_MARK_LCORNER 10
94 #define wxSTC_MARK_TCORNER 11
95 #define wxSTC_MARK_BOXPLUS 12
96 #define wxSTC_MARK_BOXPLUSCONNECTED 13
97 #define wxSTC_MARK_BOXMINUS 14
98 #define wxSTC_MARK_BOXMINUSCONNECTED 15
99 #define wxSTC_MARK_LCORNERCURVE 16
100 #define wxSTC_MARK_TCORNERCURVE 17
101 #define wxSTC_MARK_CIRCLEPLUS 18
102 #define wxSTC_MARK_CIRCLEPLUSCONNECTED 19
103 #define wxSTC_MARK_CIRCLEMINUS 20
104 #define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
106 // Invisible mark that only sets the line background color.
107 #define wxSTC_MARK_BACKGROUND 22
108 #define wxSTC_MARK_DOTDOTDOT 23
109 #define wxSTC_MARK_ARROWS 24
110 #define wxSTC_MARK_CHARACTER 10000
112 // Markers used for outlining column.
113 #define wxSTC_MARKNUM_FOLDEREND 25
114 #define wxSTC_MARKNUM_FOLDEROPENMID 26
115 #define wxSTC_MARKNUM_FOLDERMIDTAIL 27
116 #define wxSTC_MARKNUM_FOLDERTAIL 28
117 #define wxSTC_MARKNUM_FOLDERSUB 29
118 #define wxSTC_MARKNUM_FOLDER 30
119 #define wxSTC_MARKNUM_FOLDEROPEN 31
120 #define wxSTC_MASK_FOLDERS 0xFE000000
121 #define wxSTC_MARGIN_SYMBOL 0
122 #define wxSTC_MARGIN_NUMBER 1
124 // Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles.
125 // Styles 38 and 39 are for future use.
126 #define wxSTC_STYLE_DEFAULT 32
127 #define wxSTC_STYLE_LINENUMBER 33
128 #define wxSTC_STYLE_BRACELIGHT 34
129 #define wxSTC_STYLE_BRACEBAD 35
130 #define wxSTC_STYLE_CONTROLCHAR 36
131 #define wxSTC_STYLE_INDENTGUIDE 37
132 #define wxSTC_STYLE_LASTPREDEFINED 39
133 #define wxSTC_STYLE_MAX 127
135 // Character set identifiers are used in StyleSetCharacterSet.
136 // The values are the same as the Windows *_CHARSET values.
137 #define wxSTC_CHARSET_ANSI 0
138 #define wxSTC_CHARSET_DEFAULT 1
139 #define wxSTC_CHARSET_BALTIC 186
140 #define wxSTC_CHARSET_CHINESEBIG5 136
141 #define wxSTC_CHARSET_EASTEUROPE 238
142 #define wxSTC_CHARSET_GB2312 134
143 #define wxSTC_CHARSET_GREEK 161
144 #define wxSTC_CHARSET_HANGUL 129
145 #define wxSTC_CHARSET_MAC 77
146 #define wxSTC_CHARSET_OEM 255
147 #define wxSTC_CHARSET_RUSSIAN 204
148 #define wxSTC_CHARSET_SHIFTJIS 128
149 #define wxSTC_CHARSET_SYMBOL 2
150 #define wxSTC_CHARSET_TURKISH 162
151 #define wxSTC_CHARSET_JOHAB 130
152 #define wxSTC_CHARSET_HEBREW 177
153 #define wxSTC_CHARSET_ARABIC 178
154 #define wxSTC_CHARSET_VIETNAMESE 163
155 #define wxSTC_CHARSET_THAI 222
156 #define wxSTC_CASE_MIXED 0
157 #define wxSTC_CASE_UPPER 1
158 #define wxSTC_CASE_LOWER 2
159 #define wxSTC_INDIC_MAX 7
160 #define wxSTC_INDIC_PLAIN 0
161 #define wxSTC_INDIC_SQUIGGLE 1
162 #define wxSTC_INDIC_TT 2
163 #define wxSTC_INDIC_DIAGONAL 3
164 #define wxSTC_INDIC_STRIKE 4
165 #define wxSTC_INDIC0_MASK 0x20
166 #define wxSTC_INDIC1_MASK 0x40
167 #define wxSTC_INDIC2_MASK 0x80
168 #define wxSTC_INDICS_MASK 0xE0
170 // PrintColourMode - use same colours as screen.
171 #define wxSTC_PRINT_NORMAL 0
173 // PrintColourMode - invert the light value of each style for printing.
174 #define wxSTC_PRINT_INVERTLIGHT 1
176 // PrintColourMode - force black text on white background for printing.
177 #define wxSTC_PRINT_BLACKONWHITE 2
179 // PrintColourMode - text stays coloured, but all background is forced to be white for printing.
180 #define wxSTC_PRINT_COLOURONWHITE 3
182 // PrintColourMode - only the default-background is forced to be white for printing.
183 #define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4
184 #define wxSTC_FIND_WHOLEWORD 2
185 #define wxSTC_FIND_MATCHCASE 4
186 #define wxSTC_FIND_WORDSTART 0x00100000
187 #define wxSTC_FIND_REGEXP 0x00200000
188 #define wxSTC_FOLDLEVELBASE 0x400
189 #define wxSTC_FOLDLEVELWHITEFLAG 0x1000
190 #define wxSTC_FOLDLEVELHEADERFLAG 0x2000
191 #define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF
192 #define wxSTC_TIME_FOREVER 10000000
193 #define wxSTC_WRAP_NONE 0
194 #define wxSTC_WRAP_WORD 1
195 #define wxSTC_CACHE_NONE 0
196 #define wxSTC_CACHE_CARET 1
197 #define wxSTC_CACHE_PAGE 2
198 #define wxSTC_CACHE_DOCUMENT 3
199 #define wxSTC_EDGE_NONE 0
200 #define wxSTC_EDGE_LINE 1
201 #define wxSTC_EDGE_BACKGROUND 2
202 #define wxSTC_CURSORNORMAL -1
203 #define wxSTC_CURSORWAIT 3
205 // Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
206 #define wxSTC_VISIBLE_SLOP 0x01
207 #define wxSTC_VISIBLE_STRICT 0x04
209 // Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
210 // If CARET_SLOP is set, we can define a slop value: caretSlop.
211 // This value defines an unwanted zone (UZ) where the caret is... unwanted.
212 // This zone is defined as a number of pixels near the vertical margins,
213 // and as a number of lines near the horizontal margins.
214 // By keeping the caret away from the edges, it is seen within its context,
215 // so it is likely that the identifier that the caret is on can be completely seen,
216 // and that the current line is seen with some of the lines following it which are
217 // often dependent on that line.
218 #define wxSTC_CARET_SLOP 0x01
220 // If CARET_STRICT is set, the policy is enforced... strictly.
221 // The caret is centred on the display if slop is not set,
222 // and cannot go in the UZ if slop is set.
223 #define wxSTC_CARET_STRICT 0x04
225 // If CARET_JUMPS is set, the display is moved more energetically
226 // so the caret can move in the same direction longer before the policy is applied again.
227 #define wxSTC_CARET_JUMPS 0x10
229 // If CARET_EVEN is not set, instead of having symmetrical UZs,
230 // the left and bottom UZs are extended up to right and top UZs respectively.
231 // This way, we favour the displaying of useful information: the begining of lines,
232 // where most code reside, and the lines after the caret, eg. the body of a function.
233 #define wxSTC_CARET_EVEN 0x08
236 // Type of modification and the action which caused the modification.
237 // These are defined as a bit mask to make it easy to specify which notifications are wanted.
238 // One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
239 #define wxSTC_MOD_INSERTTEXT 0x1
240 #define wxSTC_MOD_DELETETEXT 0x2
241 #define wxSTC_MOD_CHANGESTYLE 0x4
242 #define wxSTC_MOD_CHANGEFOLD 0x8
243 #define wxSTC_PERFORMED_USER 0x10
244 #define wxSTC_PERFORMED_UNDO 0x20
245 #define wxSTC_PERFORMED_REDO 0x40
246 #define wxSTC_LASTSTEPINUNDOREDO 0x100
247 #define wxSTC_MOD_CHANGEMARKER 0x200
248 #define wxSTC_MOD_BEFOREINSERT 0x400
249 #define wxSTC_MOD_BEFOREDELETE 0x800
250 #define wxSTC_MODEVENTMASKALL 0xF77
252 // Symbolic key codes and modifier flags.
253 // ASCII and other printable characters below 256.
254 // Extended keys above 300.
255 #define wxSTC_KEY_DOWN 300
256 #define wxSTC_KEY_UP 301
257 #define wxSTC_KEY_LEFT 302
258 #define wxSTC_KEY_RIGHT 303
259 #define wxSTC_KEY_HOME 304
260 #define wxSTC_KEY_END 305
261 #define wxSTC_KEY_PRIOR 306
262 #define wxSTC_KEY_NEXT 307
263 #define wxSTC_KEY_DELETE 308
264 #define wxSTC_KEY_INSERT 309
265 #define wxSTC_KEY_ESCAPE 7
266 #define wxSTC_KEY_BACK 8
267 #define wxSTC_KEY_TAB 9
268 #define wxSTC_KEY_RETURN 13
269 #define wxSTC_KEY_ADD 310
270 #define wxSTC_KEY_SUBTRACT 311
271 #define wxSTC_KEY_DIVIDE 312
272 #define wxSTC_SCMOD_SHIFT 1
273 #define wxSTC_SCMOD_CTRL 2
274 #define wxSTC_SCMOD_ALT 4
277 #define wxSTC_LEX_CONTAINER 0
278 #define wxSTC_LEX_NULL 1
279 #define wxSTC_LEX_PYTHON 2
280 #define wxSTC_LEX_CPP 3
281 #define wxSTC_LEX_HTML 4
282 #define wxSTC_LEX_XML 5
283 #define wxSTC_LEX_PERL 6
284 #define wxSTC_LEX_SQL 7
285 #define wxSTC_LEX_VB 8
286 #define wxSTC_LEX_PROPERTIES 9
287 #define wxSTC_LEX_ERRORLIST 10
288 #define wxSTC_LEX_MAKEFILE 11
289 #define wxSTC_LEX_BATCH 12
290 #define wxSTC_LEX_XCODE 13
291 #define wxSTC_LEX_LATEX 14
292 #define wxSTC_LEX_LUA 15
293 #define wxSTC_LEX_DIFF 16
294 #define wxSTC_LEX_CONF 17
295 #define wxSTC_LEX_PASCAL 18
296 #define wxSTC_LEX_AVE 19
297 #define wxSTC_LEX_ADA 20
298 #define wxSTC_LEX_LISP 21
299 #define wxSTC_LEX_RUBY 22
300 #define wxSTC_LEX_EIFFEL 23
301 #define wxSTC_LEX_EIFFELKW 24
302 #define wxSTC_LEX_TCL 25
303 #define wxSTC_LEX_NNCRONTAB 26
304 #define wxSTC_LEX_BULLANT 27
305 #define wxSTC_LEX_VBSCRIPT 28
306 #define wxSTC_LEX_ASP 29
307 #define wxSTC_LEX_PHP 30
308 #define wxSTC_LEX_BAAN 31
309 #define wxSTC_LEX_MATLAB 32
310 #define wxSTC_LEX_SCRIPTOL 33
312 // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
313 // value assigned in sequence from SCLEX_AUTOMATIC+1.
314 #define wxSTC_LEX_AUTOMATIC 1000
316 // Lexical states for SCLEX_PYTHON
317 #define wxSTC_P_DEFAULT 0
318 #define wxSTC_P_COMMENTLINE 1
319 #define wxSTC_P_NUMBER 2
320 #define wxSTC_P_STRING 3
321 #define wxSTC_P_CHARACTER 4
322 #define wxSTC_P_WORD 5
323 #define wxSTC_P_TRIPLE 6
324 #define wxSTC_P_TRIPLEDOUBLE 7
325 #define wxSTC_P_CLASSNAME 8
326 #define wxSTC_P_DEFNAME 9
327 #define wxSTC_P_OPERATOR 10
328 #define wxSTC_P_IDENTIFIER 11
329 #define wxSTC_P_COMMENTBLOCK 12
330 #define wxSTC_P_STRINGEOL 13
332 // Lexical states for SCLEX_CPP
333 #define wxSTC_C_DEFAULT 0
334 #define wxSTC_C_COMMENT 1
335 #define wxSTC_C_COMMENTLINE 2
336 #define wxSTC_C_COMMENTDOC 3
337 #define wxSTC_C_NUMBER 4
338 #define wxSTC_C_WORD 5
339 #define wxSTC_C_STRING 6
340 #define wxSTC_C_CHARACTER 7
341 #define wxSTC_C_UUID 8
342 #define wxSTC_C_PREPROCESSOR 9
343 #define wxSTC_C_OPERATOR 10
344 #define wxSTC_C_IDENTIFIER 11
345 #define wxSTC_C_STRINGEOL 12
346 #define wxSTC_C_VERBATIM 13
347 #define wxSTC_C_REGEX 14
348 #define wxSTC_C_COMMENTLINEDOC 15
349 #define wxSTC_C_WORD2 16
350 #define wxSTC_C_COMMENTDOCKEYWORD 17
351 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
353 // Lexical states for SCLEX_HTML, SCLEX_XML
354 #define wxSTC_H_DEFAULT 0
355 #define wxSTC_H_TAG 1
356 #define wxSTC_H_TAGUNKNOWN 2
357 #define wxSTC_H_ATTRIBUTE 3
358 #define wxSTC_H_ATTRIBUTEUNKNOWN 4
359 #define wxSTC_H_NUMBER 5
360 #define wxSTC_H_DOUBLESTRING 6
361 #define wxSTC_H_SINGLESTRING 7
362 #define wxSTC_H_OTHER 8
363 #define wxSTC_H_COMMENT 9
364 #define wxSTC_H_ENTITY 10
367 #define wxSTC_H_TAGEND 11
368 #define wxSTC_H_XMLSTART 12
369 #define wxSTC_H_XMLEND 13
370 #define wxSTC_H_SCRIPT 14
371 #define wxSTC_H_ASP 15
372 #define wxSTC_H_ASPAT 16
373 #define wxSTC_H_CDATA 17
374 #define wxSTC_H_QUESTION 18
377 #define wxSTC_H_VALUE 19
380 #define wxSTC_H_XCCOMMENT 20
383 #define wxSTC_H_SGML_DEFAULT 21
384 #define wxSTC_H_SGML_COMMAND 22
385 #define wxSTC_H_SGML_1ST_PARAM 23
386 #define wxSTC_H_SGML_DOUBLESTRING 24
387 #define wxSTC_H_SGML_SIMPLESTRING 25
388 #define wxSTC_H_SGML_ERROR 26
389 #define wxSTC_H_SGML_SPECIAL 27
390 #define wxSTC_H_SGML_ENTITY 28
391 #define wxSTC_H_SGML_COMMENT 29
392 #define wxSTC_H_SGML_1ST_PARAM_COMMENT 30
393 #define wxSTC_H_SGML_BLOCK_DEFAULT 31
395 // Embedded Javascript
396 #define wxSTC_HJ_START 40
397 #define wxSTC_HJ_DEFAULT 41
398 #define wxSTC_HJ_COMMENT 42
399 #define wxSTC_HJ_COMMENTLINE 43
400 #define wxSTC_HJ_COMMENTDOC 44
401 #define wxSTC_HJ_NUMBER 45
402 #define wxSTC_HJ_WORD 46
403 #define wxSTC_HJ_KEYWORD 47
404 #define wxSTC_HJ_DOUBLESTRING 48
405 #define wxSTC_HJ_SINGLESTRING 49
406 #define wxSTC_HJ_SYMBOLS 50
407 #define wxSTC_HJ_STRINGEOL 51
408 #define wxSTC_HJ_REGEX 52
411 #define wxSTC_HJA_START 55
412 #define wxSTC_HJA_DEFAULT 56
413 #define wxSTC_HJA_COMMENT 57
414 #define wxSTC_HJA_COMMENTLINE 58
415 #define wxSTC_HJA_COMMENTDOC 59
416 #define wxSTC_HJA_NUMBER 60
417 #define wxSTC_HJA_WORD 61
418 #define wxSTC_HJA_KEYWORD 62
419 #define wxSTC_HJA_DOUBLESTRING 63
420 #define wxSTC_HJA_SINGLESTRING 64
421 #define wxSTC_HJA_SYMBOLS 65
422 #define wxSTC_HJA_STRINGEOL 66
423 #define wxSTC_HJA_REGEX 67
426 #define wxSTC_HB_START 70
427 #define wxSTC_HB_DEFAULT 71
428 #define wxSTC_HB_COMMENTLINE 72
429 #define wxSTC_HB_NUMBER 73
430 #define wxSTC_HB_WORD 74
431 #define wxSTC_HB_STRING 75
432 #define wxSTC_HB_IDENTIFIER 76
433 #define wxSTC_HB_STRINGEOL 77
436 #define wxSTC_HBA_START 80
437 #define wxSTC_HBA_DEFAULT 81
438 #define wxSTC_HBA_COMMENTLINE 82
439 #define wxSTC_HBA_NUMBER 83
440 #define wxSTC_HBA_WORD 84
441 #define wxSTC_HBA_STRING 85
442 #define wxSTC_HBA_IDENTIFIER 86
443 #define wxSTC_HBA_STRINGEOL 87
446 #define wxSTC_HP_START 90
447 #define wxSTC_HP_DEFAULT 91
448 #define wxSTC_HP_COMMENTLINE 92
449 #define wxSTC_HP_NUMBER 93
450 #define wxSTC_HP_STRING 94
451 #define wxSTC_HP_CHARACTER 95
452 #define wxSTC_HP_WORD 96
453 #define wxSTC_HP_TRIPLE 97
454 #define wxSTC_HP_TRIPLEDOUBLE 98
455 #define wxSTC_HP_CLASSNAME 99
456 #define wxSTC_HP_DEFNAME 100
457 #define wxSTC_HP_OPERATOR 101
458 #define wxSTC_HP_IDENTIFIER 102
461 #define wxSTC_HPA_START 105
462 #define wxSTC_HPA_DEFAULT 106
463 #define wxSTC_HPA_COMMENTLINE 107
464 #define wxSTC_HPA_NUMBER 108
465 #define wxSTC_HPA_STRING 109
466 #define wxSTC_HPA_CHARACTER 110
467 #define wxSTC_HPA_WORD 111
468 #define wxSTC_HPA_TRIPLE 112
469 #define wxSTC_HPA_TRIPLEDOUBLE 113
470 #define wxSTC_HPA_CLASSNAME 114
471 #define wxSTC_HPA_DEFNAME 115
472 #define wxSTC_HPA_OPERATOR 116
473 #define wxSTC_HPA_IDENTIFIER 117
476 #define wxSTC_HPHP_DEFAULT 118
477 #define wxSTC_HPHP_HSTRING 119
478 #define wxSTC_HPHP_SIMPLESTRING 120
479 #define wxSTC_HPHP_WORD 121
480 #define wxSTC_HPHP_NUMBER 122
481 #define wxSTC_HPHP_VARIABLE 123
482 #define wxSTC_HPHP_COMMENT 124
483 #define wxSTC_HPHP_COMMENTLINE 125
484 #define wxSTC_HPHP_HSTRING_VARIABLE 126
485 #define wxSTC_HPHP_OPERATOR 127
487 // Lexical states for SCLEX_PERL
488 #define wxSTC_PL_DEFAULT 0
489 #define wxSTC_PL_ERROR 1
490 #define wxSTC_PL_COMMENTLINE 2
491 #define wxSTC_PL_POD 3
492 #define wxSTC_PL_NUMBER 4
493 #define wxSTC_PL_WORD 5
494 #define wxSTC_PL_STRING 6
495 #define wxSTC_PL_CHARACTER 7
496 #define wxSTC_PL_PUNCTUATION 8
497 #define wxSTC_PL_PREPROCESSOR 9
498 #define wxSTC_PL_OPERATOR 10
499 #define wxSTC_PL_IDENTIFIER 11
500 #define wxSTC_PL_SCALAR 12
501 #define wxSTC_PL_ARRAY 13
502 #define wxSTC_PL_HASH 14
503 #define wxSTC_PL_SYMBOLTABLE 15
504 #define wxSTC_PL_REGEX 17
505 #define wxSTC_PL_REGSUBST 18
506 #define wxSTC_PL_LONGQUOTE 19
507 #define wxSTC_PL_BACKTICKS 20
508 #define wxSTC_PL_DATASECTION 21
509 #define wxSTC_PL_HERE_DELIM 22
510 #define wxSTC_PL_HERE_Q 23
511 #define wxSTC_PL_HERE_QQ 24
512 #define wxSTC_PL_HERE_QX 25
513 #define wxSTC_PL_STRING_Q 26
514 #define wxSTC_PL_STRING_QQ 27
515 #define wxSTC_PL_STRING_QX 28
516 #define wxSTC_PL_STRING_QR 29
517 #define wxSTC_PL_STRING_QW 30
519 // Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
520 #define wxSTC_B_DEFAULT 0
521 #define wxSTC_B_COMMENT 1
522 #define wxSTC_B_NUMBER 2
523 #define wxSTC_B_KEYWORD 3
524 #define wxSTC_B_STRING 4
525 #define wxSTC_B_PREPROCESSOR 5
526 #define wxSTC_B_OPERATOR 6
527 #define wxSTC_B_IDENTIFIER 7
528 #define wxSTC_B_DATE 8
530 // Lexical states for SCLEX_PROPERTIES
531 #define wxSTC_PROPS_DEFAULT 0
532 #define wxSTC_PROPS_COMMENT 1
533 #define wxSTC_PROPS_SECTION 2
534 #define wxSTC_PROPS_ASSIGNMENT 3
535 #define wxSTC_PROPS_DEFVAL 4
537 // Lexical states for SCLEX_LATEX
538 #define wxSTC_L_DEFAULT 0
539 #define wxSTC_L_COMMAND 1
540 #define wxSTC_L_TAG 2
541 #define wxSTC_L_MATH 3
542 #define wxSTC_L_COMMENT 4
544 // Lexical states for SCLEX_LUA
545 #define wxSTC_LUA_DEFAULT 0
546 #define wxSTC_LUA_COMMENT 1
547 #define wxSTC_LUA_COMMENTLINE 2
548 #define wxSTC_LUA_COMMENTDOC 3
549 #define wxSTC_LUA_NUMBER 4
550 #define wxSTC_LUA_WORD 5
551 #define wxSTC_LUA_STRING 6
552 #define wxSTC_LUA_CHARACTER 7
553 #define wxSTC_LUA_LITERALSTRING 8
554 #define wxSTC_LUA_PREPROCESSOR 9
555 #define wxSTC_LUA_OPERATOR 10
556 #define wxSTC_LUA_IDENTIFIER 11
557 #define wxSTC_LUA_STRINGEOL 12
558 #define wxSTC_LUA_WORD2 13
559 #define wxSTC_LUA_WORD3 14
560 #define wxSTC_LUA_WORD4 15
561 #define wxSTC_LUA_WORD5 16
562 #define wxSTC_LUA_WORD6 17
564 // Lexical states for SCLEX_ERRORLIST
565 #define wxSTC_ERR_DEFAULT 0
566 #define wxSTC_ERR_PYTHON 1
567 #define wxSTC_ERR_GCC 2
568 #define wxSTC_ERR_MS 3
569 #define wxSTC_ERR_CMD 4
570 #define wxSTC_ERR_BORLAND 5
571 #define wxSTC_ERR_PERL 6
572 #define wxSTC_ERR_NET 7
573 #define wxSTC_ERR_LUA 8
574 #define wxSTC_ERR_CTAG 9
575 #define wxSTC_ERR_DIFF_CHANGED 10
576 #define wxSTC_ERR_DIFF_ADDITION 11
577 #define wxSTC_ERR_DIFF_DELETION 12
578 #define wxSTC_ERR_DIFF_MESSAGE 13
580 // Lexical states for SCLEX_BATCH
581 #define wxSTC_BAT_DEFAULT 0
582 #define wxSTC_BAT_COMMENT 1
583 #define wxSTC_BAT_WORD 2
584 #define wxSTC_BAT_LABEL 3
585 #define wxSTC_BAT_HIDE 4
586 #define wxSTC_BAT_COMMAND 5
587 #define wxSTC_BAT_IDENTIFIER 6
588 #define wxSTC_BAT_OPERATOR 7
590 // Lexical states for SCLEX_MAKEFILE
591 #define wxSTC_MAKE_DEFAULT 0
592 #define wxSTC_MAKE_COMMENT 1
593 #define wxSTC_MAKE_PREPROCESSOR 2
594 #define wxSTC_MAKE_IDENTIFIER 3
595 #define wxSTC_MAKE_OPERATOR 4
596 #define wxSTC_MAKE_TARGET 5
597 #define wxSTC_MAKE_IDEOL 9
599 // Lexical states for SCLEX_DIFF
600 #define wxSTC_DIFF_DEFAULT 0
601 #define wxSTC_DIFF_COMMENT 1
602 #define wxSTC_DIFF_COMMAND 2
603 #define wxSTC_DIFF_HEADER 3
604 #define wxSTC_DIFF_POSITION 4
605 #define wxSTC_DIFF_DELETED 5
606 #define wxSTC_DIFF_ADDED 6
608 // Lexical states for SCLEX_CONF (Apache Configuration Files Lexer)
609 #define wxSTC_CONF_DEFAULT 0
610 #define wxSTC_CONF_COMMENT 1
611 #define wxSTC_CONF_NUMBER 2
612 #define wxSTC_CONF_IDENTIFIER 3
613 #define wxSTC_CONF_EXTENSION 4
614 #define wxSTC_CONF_PARAMETER 5
615 #define wxSTC_CONF_STRING 6
616 #define wxSTC_CONF_OPERATOR 7
617 #define wxSTC_CONF_IP 8
618 #define wxSTC_CONF_DIRECTIVE 9
620 // Lexical states for SCLEX_AVE, Avenue
621 #define wxSTC_AVE_DEFAULT 0
622 #define wxSTC_AVE_COMMENT 1
623 #define wxSTC_AVE_NUMBER 2
624 #define wxSTC_AVE_WORD 3
625 #define wxSTC_AVE_KEYWORD 4
626 #define wxSTC_AVE_STATEMENT 5
627 #define wxSTC_AVE_STRING 6
628 #define wxSTC_AVE_ENUM 7
629 #define wxSTC_AVE_STRINGEOL 8
630 #define wxSTC_AVE_IDENTIFIER 9
631 #define wxSTC_AVE_OPERATOR 10
633 // Lexical states for SCLEX_ADA
634 #define wxSTC_ADA_DEFAULT 0
635 #define wxSTC_ADA_COMMENT 1
636 #define wxSTC_ADA_NUMBER 2
637 #define wxSTC_ADA_WORD 3
638 #define wxSTC_ADA_STRING 4
639 #define wxSTC_ADA_CHARACTER 5
640 #define wxSTC_ADA_OPERATOR 6
641 #define wxSTC_ADA_IDENTIFIER 7
642 #define wxSTC_ADA_STRINGEOL 8
644 // Lexical states for SCLEX_BAAN
645 #define wxSTC_BAAN_DEFAULT 0
646 #define wxSTC_BAAN_COMMENT 1
647 #define wxSTC_BAAN_COMMENTDOC 2
648 #define wxSTC_BAAN_NUMBER 3
649 #define wxSTC_BAAN_WORD 4
650 #define wxSTC_BAAN_STRING 5
651 #define wxSTC_BAAN_PREPROCESSOR 6
652 #define wxSTC_BAAN_OPERATOR 7
653 #define wxSTC_BAAN_IDENTIFIER 8
654 #define wxSTC_BAAN_STRINGEOL 9
655 #define wxSTC_BAAN_WORD2 10
657 // Lexical states for SCLEX_LISP
658 #define wxSTC_LISP_DEFAULT 0
659 #define wxSTC_LISP_COMMENT 1
660 #define wxSTC_LISP_NUMBER 2
661 #define wxSTC_LISP_KEYWORD 3
662 #define wxSTC_LISP_STRING 6
663 #define wxSTC_LISP_STRINGEOL 8
664 #define wxSTC_LISP_IDENTIFIER 9
665 #define wxSTC_LISP_OPERATOR 10
667 // Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW
668 #define wxSTC_EIFFEL_DEFAULT 0
669 #define wxSTC_EIFFEL_COMMENTLINE 1
670 #define wxSTC_EIFFEL_NUMBER 2
671 #define wxSTC_EIFFEL_WORD 3
672 #define wxSTC_EIFFEL_STRING 4
673 #define wxSTC_EIFFEL_CHARACTER 5
674 #define wxSTC_EIFFEL_OPERATOR 6
675 #define wxSTC_EIFFEL_IDENTIFIER 7
676 #define wxSTC_EIFFEL_STRINGEOL 8
678 // Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer)
679 #define wxSTC_NNCRONTAB_DEFAULT 0
680 #define wxSTC_NNCRONTAB_COMMENT 1
681 #define wxSTC_NNCRONTAB_TASK 2
682 #define wxSTC_NNCRONTAB_SECTION 3
683 #define wxSTC_NNCRONTAB_KEYWORD 4
684 #define wxSTC_NNCRONTAB_MODIFIER 5
685 #define wxSTC_NNCRONTAB_ASTERISK 6
686 #define wxSTC_NNCRONTAB_NUMBER 7
687 #define wxSTC_NNCRONTAB_STRING 8
688 #define wxSTC_NNCRONTAB_ENVIRONMENT 9
689 #define wxSTC_NNCRONTAB_IDENTIFIER 10
691 // Lexical states for SCLEX_MATLAB
692 #define wxSTC_MATLAB_DEFAULT 0
693 #define wxSTC_MATLAB_COMMENT 1
694 #define wxSTC_MATLAB_COMMAND 2
695 #define wxSTC_MATLAB_NUMBER 3
696 #define wxSTC_MATLAB_KEYWORD 4
697 #define wxSTC_MATLAB_STRING 5
698 #define wxSTC_MATLAB_OPERATOR 6
699 #define wxSTC_MATLAB_IDENTIFIER 7
701 // Lexical states for SCLEX_SCRIPTOL
702 #define wxSTC_SCRIPTOL_DEFAULT 0
703 #define wxSTC_SCRIPTOL_COMMENT 1
704 #define wxSTC_SCRIPTOL_COMMENTLINE 2
705 #define wxSTC_SCRIPTOL_COMMENTDOC 3
706 #define wxSTC_SCRIPTOL_NUMBER 4
707 #define wxSTC_SCRIPTOL_WORD 5
708 #define wxSTC_SCRIPTOL_STRING 6
709 #define wxSTC_SCRIPTOL_CHARACTER 7
710 #define wxSTC_SCRIPTOL_UUID 8
711 #define wxSTC_SCRIPTOL_PREPROCESSOR 9
712 #define wxSTC_SCRIPTOL_OPERATOR 10
713 #define wxSTC_SCRIPTOL_IDENTIFIER 11
714 #define wxSTC_SCRIPTOL_STRINGEOL 12
715 #define wxSTC_SCRIPTOL_VERBATIM 13
716 #define wxSTC_SCRIPTOL_REGEX 14
717 #define wxSTC_SCRIPTOL_COMMENTLINEDOC 15
718 #define wxSTC_SCRIPTOL_WORD2 16
719 #define wxSTC_SCRIPTOL_COMMENTDOCKEYWORD 17
720 #define wxSTC_SCRIPTOL_COMMENTDOCKEYWORDERROR 18
721 #define wxSTC_SCRIPTOL_COMMENTBASIC 19
724 //-----------------------------------------
725 // Commands that can be bound to keystrokes
727 // Redoes the next action on the undo history.
728 #define wxSTC_CMD_REDO 2011
730 // Select all the text in the document.
731 #define wxSTC_CMD_SELECTALL 2013
733 // Undo one action in the undo history.
734 #define wxSTC_CMD_UNDO 2176
736 // Cut the selection to the clipboard.
737 #define wxSTC_CMD_CUT 2177
739 // Copy the selection to the clipboard.
740 #define wxSTC_CMD_COPY 2178
742 // Paste the contents of the clipboard into the document replacing the selection.
743 #define wxSTC_CMD_PASTE 2179
745 // Clear the selection.
746 #define wxSTC_CMD_CLEAR 2180
748 // Move caret down one line.
749 #define wxSTC_CMD_LINEDOWN 2300
751 // Move caret down one line extending selection to new caret position.
752 #define wxSTC_CMD_LINEDOWNEXTEND 2301
754 // Move caret up one line.
755 #define wxSTC_CMD_LINEUP 2302
757 // Move caret up one line extending selection to new caret position.
758 #define wxSTC_CMD_LINEUPEXTEND 2303
760 // Move caret left one character.
761 #define wxSTC_CMD_CHARLEFT 2304
763 // Move caret left one character extending selection to new caret position.
764 #define wxSTC_CMD_CHARLEFTEXTEND 2305
766 // Move caret right one character.
767 #define wxSTC_CMD_CHARRIGHT 2306
769 // Move caret right one character extending selection to new caret position.
770 #define wxSTC_CMD_CHARRIGHTEXTEND 2307
772 // Move caret left one word.
773 #define wxSTC_CMD_WORDLEFT 2308
775 // Move caret left one word extending selection to new caret position.
776 #define wxSTC_CMD_WORDLEFTEXTEND 2309
778 // Move caret right one word.
779 #define wxSTC_CMD_WORDRIGHT 2310
781 // Move caret right one word extending selection to new caret position.
782 #define wxSTC_CMD_WORDRIGHTEXTEND 2311
784 // Move caret to first position on line.
785 #define wxSTC_CMD_HOME 2312
787 // Move caret to first position on line extending selection to new caret position.
788 #define wxSTC_CMD_HOMEEXTEND 2313
790 // Move caret to last position on line.
791 #define wxSTC_CMD_LINEEND 2314
793 // Move caret to last position on line extending selection to new caret position.
794 #define wxSTC_CMD_LINEENDEXTEND 2315
796 // Move caret to first position in document.
797 #define wxSTC_CMD_DOCUMENTSTART 2316
799 // Move caret to first position in document extending selection to new caret position.
800 #define wxSTC_CMD_DOCUMENTSTARTEXTEND 2317
802 // Move caret to last position in document.
803 #define wxSTC_CMD_DOCUMENTEND 2318
805 // Move caret to last position in document extending selection to new caret position.
806 #define wxSTC_CMD_DOCUMENTENDEXTEND 2319
808 // Move caret one page up.
809 #define wxSTC_CMD_PAGEUP 2320
811 // Move caret one page up extending selection to new caret position.
812 #define wxSTC_CMD_PAGEUPEXTEND 2321
814 // Move caret one page down.
815 #define wxSTC_CMD_PAGEDOWN 2322
817 // Move caret one page down extending selection to new caret position.
818 #define wxSTC_CMD_PAGEDOWNEXTEND 2323
820 // Switch from insert to overtype mode or the reverse.
821 #define wxSTC_CMD_EDITTOGGLEOVERTYPE 2324
823 // Cancel any modes such as call tip or auto-completion list display.
824 #define wxSTC_CMD_CANCEL 2325
826 // Delete the selection or if no selection, the character before the caret.
827 #define wxSTC_CMD_DELETEBACK 2326
829 // If selection is empty or all on one line replace the selection with a tab character.
830 // If more than one line selected, indent the lines.
831 #define wxSTC_CMD_TAB 2327
833 // Dedent the selected lines.
834 #define wxSTC_CMD_BACKTAB 2328
836 // Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
837 #define wxSTC_CMD_NEWLINE 2329
839 // Insert a Form Feed character.
840 #define wxSTC_CMD_FORMFEED 2330
842 // Move caret to before first visible character on line.
843 // If already there move to first character on line.
844 #define wxSTC_CMD_VCHOME 2331
846 // Like VCHome but extending selection to new caret position.
847 #define wxSTC_CMD_VCHOMEEXTEND 2332
849 // Magnify the displayed text by increasing the sizes by 1 point.
850 #define wxSTC_CMD_ZOOMIN 2333
852 // Make the displayed text smaller by decreasing the sizes by 1 point.
853 #define wxSTC_CMD_ZOOMOUT 2334
855 // Delete the word to the left of the caret.
856 #define wxSTC_CMD_DELWORDLEFT 2335
858 // Delete the word to the right of the caret.
859 #define wxSTC_CMD_DELWORDRIGHT 2336
861 // Cut the line containing the caret.
862 #define wxSTC_CMD_LINECUT 2337
864 // Delete the line containing the caret.
865 #define wxSTC_CMD_LINEDELETE 2338
867 // Switch the current line with the previous.
868 #define wxSTC_CMD_LINETRANSPOSE 2339
870 // Transform the selection to lower case.
871 #define wxSTC_CMD_LOWERCASE 2340
873 // Transform the selection to upper case.
874 #define wxSTC_CMD_UPPERCASE 2341
876 // Scroll the document down, keeping the caret visible.
877 #define wxSTC_CMD_LINESCROLLDOWN 2342
879 // Scroll the document up, keeping the caret visible.
880 #define wxSTC_CMD_LINESCROLLUP 2343
882 // Delete the selection or if no selection, the character before the caret.
883 // Will not delete the character before at the start of a line.
884 #define wxSTC_CMD_DELETEBACKNOTLINE 2344
886 // Move caret to first position on display line.
887 #define wxSTC_CMD_HOMEDISPLAY 2345
889 // Move caret to first position on display line extending selection to
890 // new caret position.
891 #define wxSTC_CMD_HOMEDISPLAYEXTEND 2346
893 // Move caret to last position on display line.
894 #define wxSTC_CMD_LINEENDDISPLAY 2347
896 // Move caret to last position on display line extending selection to new
898 #define wxSTC_CMD_LINEENDDISPLAYEXTEND 2348
900 // Move to the previous change in capitalisation.
901 #define wxSTC_CMD_WORDPARTLEFT 2390
903 // Move to the previous change in capitalisation extending selection
904 // to new caret position.
905 #define wxSTC_CMD_WORDPARTLEFTEXTEND 2391
907 // Move to the change next in capitalisation.
908 #define wxSTC_CMD_WORDPARTRIGHT 2392
910 // Move to the next change in capitalisation extending selection
911 // to new caret position.
912 #define wxSTC_CMD_WORDPARTRIGHTEXTEND 2393
914 // Delete back from the current position to the start of the line.
915 #define wxSTC_CMD_DELLINELEFT 2395
917 // Delete forwards from the current position to the end of the line.
918 #define wxSTC_CMD_DELLINERIGHT 2396
921 // END of generated section
922 //----------------------------------------------------------------------
924 class ScintillaWX
; // forward declare
926 struct SCNotification
;
929 extern WXSTC_DECLSPEC
const wxChar
* wxSTCNameStr
;
930 class WXSTC_DECLSPEC wxStyledTextCtrl
;
931 class WXSTC_DECLSPEC wxStyledTextEvent
;
934 //----------------------------------------------------------------------
936 class wxStyledTextCtrl
: public wxControl
{
940 wxStyledTextCtrl(wxWindow
*parent
, wxWindowID id
,
941 const wxPoint
& pos
= wxDefaultPosition
,
942 const wxSize
& size
= wxDefaultSize
, long style
= 0,
943 const wxString
& name
= wxPySTCNameStr
);
944 %pragma
(python
) addtomethod
= "__init__:self._setOORInfo(self)"
947 wxStyledTextCtrl(wxWindow
*parent
, wxWindowID id
,
948 const wxPoint
& pos
= wxDefaultPosition
,
949 const wxSize
& size
= wxDefaultSize
, long style
= 0,
950 const wxString
& name
= wxSTCNameStr
);
958 //----------------------------------------------------------------------
959 // BEGIN generated section. The following code is automatically generated
960 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
964 // Add text to the document.
965 void AddText(const wxString
& text
);
967 // Add array of cells to document.
968 void AddStyledText(const wxMemoryBuffer
& data
);
970 // Insert string at a position.
971 void InsertText(int pos
, const wxString
& text
);
973 // Delete all text in the document.
976 // Set all style bytes to 0, remove all folding information.
977 void ClearDocumentStyle();
979 // The number of characters in the document.
982 // Returns the character byte at the position.
983 int GetCharAt(int pos
);
985 // Returns the position of the caret.
988 // Returns the position of the opposite end of the selection to the caret.
991 // Returns the style byte at the position.
992 int GetStyleAt(int pos
);
994 // Redoes the next action on the undo history.
997 // Choose between collecting actions into the undo
998 // history and discarding them.
999 void SetUndoCollection(bool collectUndo
);
1001 // Select all the text in the document.
1004 // Remember the current position in the undo history as the position
1005 // at which the document was saved.
1006 void SetSavePoint();
1008 // Retrieve a buffer of cells.
1009 wxMemoryBuffer
GetStyledText(int startPos
, int endPos
);
1011 // Are there any redoable actions in the undo history?
1014 // Retrieve the line number at which a particular marker is located.
1015 int MarkerLineFromHandle(int handle
);
1018 void MarkerDeleteHandle(int handle
);
1020 // Is undo history being collected?
1021 bool GetUndoCollection();
1023 // Are white space characters currently visible?
1024 // Returns one of SCWS_* constants.
1025 int GetViewWhiteSpace();
1027 // Make white space characters invisible, always visible or visible outside indentation.
1028 void SetViewWhiteSpace(int viewWS
);
1030 // Find the position from a point within the window.
1031 int PositionFromPoint(wxPoint pt
);
1033 // Find the position from a point within the window but return
1034 // INVALID_POSITION if not close to text.
1035 int PositionFromPointClose(int x
, int y
);
1037 // Set caret to start of a line and ensure it is visible.
1038 void GotoLine(int line
);
1040 // Set caret to a position and ensure it is visible.
1041 void GotoPos(int pos
);
1043 // Set the selection anchor to a position. The anchor is the opposite
1044 // end of the selection from the caret.
1045 void SetAnchor(int posAnchor
);
1047 // Retrieve the text of the line containing the caret.
1048 // Returns the index of the caret on the line.
1050 wxString
GetCurLine(int* OUTPUT
);
1052 wxString
GetCurLine(int* linePos
=NULL
);
1055 // Retrieve the position of the last correctly styled character.
1058 // Convert all line endings in the document to one mode.
1059 void ConvertEOLs(int eolMode
);
1061 // Retrieve the current end of line mode - one of CRLF, CR, or LF.
1064 // Set the current end of line mode.
1065 void SetEOLMode(int eolMode
);
1067 // Set the current styling position to pos and the styling mask to mask.
1068 // The styling mask can be used to protect some bits in each styling byte from modification.
1069 void StartStyling(int pos
, int mask
);
1071 // Change style from current styling position for length characters to a style
1072 // and move the current styling position to after this newly styled segment.
1073 void SetStyling(int length
, int style
);
1075 // Is drawing done first into a buffer or direct to the screen?
1076 bool GetBufferedDraw();
1078 // If drawing is buffered then each line of text is drawn into a bitmap buffer
1079 // before drawing it to the screen to avoid flicker.
1080 void SetBufferedDraw(bool buffered
);
1082 // Change the visible size of a tab to be a multiple of the width of a space character.
1083 void SetTabWidth(int tabWidth
);
1085 // Retrieve the visible size of a tab.
1088 // Set the code page used to interpret the bytes of the document as characters.
1089 void SetCodePage(int codePage
);
1091 // Set the symbol used for a particular marker number,
1092 // and optionally the fore and background colours.
1093 void MarkerDefine(int markerNumber
, int markerSymbol
,
1094 const wxColour
& foreground
= wxNullColour
,
1095 const wxColour
& background
= wxNullColour
);
1097 // Set the foreground colour used for a particular marker number.
1098 void MarkerSetForeground(int markerNumber
, const wxColour
& fore
);
1100 // Set the background colour used for a particular marker number.
1101 void MarkerSetBackground(int markerNumber
, const wxColour
& back
);
1103 // Add a marker to a line, returning an ID which can be used to find or delete the marker.
1104 int MarkerAdd(int line
, int markerNumber
);
1106 // Delete a marker from a line.
1107 void MarkerDelete(int line
, int markerNumber
);
1109 // Delete all markers with a particular number from all lines.
1110 void MarkerDeleteAll(int markerNumber
);
1112 // Get a bit mask of all the markers set on a line.
1113 int MarkerGet(int line
);
1115 // Find the next line after lineStart that includes a marker in mask.
1116 int MarkerNext(int lineStart
, int markerMask
);
1118 // Find the previous line before lineStart that includes a marker in mask.
1119 int MarkerPrevious(int lineStart
, int markerMask
);
1121 // Set a margin to be either numeric or symbolic.
1122 void SetMarginType(int margin
, int marginType
);
1124 // Retrieve the type of a margin.
1125 int GetMarginType(int margin
);
1127 // Set the width of a margin to a width expressed in pixels.
1128 void SetMarginWidth(int margin
, int pixelWidth
);
1130 // Retrieve the width of a margin in pixels.
1131 int GetMarginWidth(int margin
);
1133 // Set a mask that determines which markers are displayed in a margin.
1134 void SetMarginMask(int margin
, int mask
);
1136 // Retrieve the marker mask of a margin.
1137 int GetMarginMask(int margin
);
1139 // Make a margin sensitive or insensitive to mouse clicks.
1140 void SetMarginSensitive(int margin
, bool sensitive
);
1142 // Retrieve the mouse click sensitivity of a margin.
1143 bool GetMarginSensitive(int margin
);
1145 // Clear all the styles and make equivalent to the global default style.
1146 void StyleClearAll();
1148 // Set the foreground colour of a style.
1149 void StyleSetForeground(int style
, const wxColour
& fore
);
1151 // Set the background colour of a style.
1152 void StyleSetBackground(int style
, const wxColour
& back
);
1154 // Set a style to be bold or not.
1155 void StyleSetBold(int style
, bool bold
);
1157 // Set a style to be italic or not.
1158 void StyleSetItalic(int style
, bool italic
);
1160 // Set the size of characters of a style.
1161 void StyleSetSize(int style
, int sizePoints
);
1163 // Set the font of a style.
1164 void StyleSetFaceName(int style
, const wxString
& fontName
);
1166 // Set a style to have its end of line filled or not.
1167 void StyleSetEOLFilled(int style
, bool filled
);
1169 // Reset the default style to its state at startup
1170 void StyleResetDefault();
1172 // Set a style to be underlined or not.
1173 void StyleSetUnderline(int style
, bool underline
);
1175 // Set a style to be mixed case, or to force upper or lower case.
1176 void StyleSetCase(int style
, int caseForce
);
1178 // Set the character set of the font in a style.
1179 void StyleSetCharacterSet(int style
, int characterSet
);
1181 // Set the foreground colour of the selection and whether to use this setting.
1182 void SetSelForeground(bool useSetting
, const wxColour
& fore
);
1184 // Set the background colour of the selection and whether to use this setting.
1185 void SetSelBackground(bool useSetting
, const wxColour
& back
);
1187 // Set the foreground colour of the caret.
1188 void SetCaretForeground(const wxColour
& fore
);
1190 // When key+modifier combination km is pressed perform msg.
1191 void CmdKeyAssign(int key
, int modifiers
, int cmd
);
1193 // When key+modifier combination km do nothing.
1194 void CmdKeyClear(int key
, int modifiers
);
1196 // Drop all key mappings.
1197 void CmdKeyClearAll();
1199 // Set the styles for a segment of the document.
1200 void SetStyleBytes(int length
, char* styleBytes
);
1202 // Set a style to be visible or not.
1203 void StyleSetVisible(int style
, bool visible
);
1205 // Get the time in milliseconds that the caret is on and off.
1206 int GetCaretPeriod();
1208 // Get the time in milliseconds that the caret is on and off. 0 = steady on.
1209 void SetCaretPeriod(int periodMilliseconds
);
1211 // Set the set of characters making up words for when moving or selecting by word.
1212 void SetWordChars(const wxString
& characters
);
1214 // Start a sequence of actions that is undone and redone as a unit.
1216 void BeginUndoAction();
1218 // End a sequence of actions that is undone and redone as a unit.
1219 void EndUndoAction();
1221 // Set an indicator to plain, squiggle or TT.
1222 void IndicatorSetStyle(int indic
, int style
);
1224 // Retrieve the style of an indicator.
1225 int IndicatorGetStyle(int indic
);
1227 // Set the foreground colour of an indicator.
1228 void IndicatorSetForeground(int indic
, const wxColour
& fore
);
1230 // Retrieve the foreground colour of an indicator.
1231 wxColour
IndicatorGetForeground(int indic
);
1233 // Set the foreground colour of all whitespace and whether to use this setting.
1234 void SetWhitespaceForeground(bool useSetting
, const wxColour
& fore
);
1236 // Set the background colour of all whitespace and whether to use this setting.
1237 void SetWhitespaceBackground(bool useSetting
, const wxColour
& back
);
1239 // Divide each styling byte into lexical class bits (default: 5) and indicator
1240 // bits (default: 3). If a lexer requires more than 32 lexical states, then this
1241 // is used to expand the possible states.
1242 void SetStyleBits(int bits
);
1244 // Retrieve number of bits in style bytes used to hold the lexical state.
1247 // Used to hold extra styling information for each line.
1248 void SetLineState(int line
, int state
);
1250 // Retrieve the extra styling information for a line.
1251 int GetLineState(int line
);
1253 // Retrieve the last line number that has line state.
1254 int GetMaxLineState();
1256 // Is the background of the line containing the caret in a different colour?
1257 bool GetCaretLineVisible();
1259 // Display the background of the line containing the caret in a different colour.
1260 void SetCaretLineVisible(bool show
);
1262 // Get the colour of the background of the line containing the caret.
1263 wxColour
GetCaretLineBack();
1265 // Set the colour of the background of the line containing the caret.
1266 void SetCaretLineBack(const wxColour
& back
);
1268 // Set a style to be changeable or not (read only).
1269 // Experimental feature, currently buggy.
1270 void StyleSetChangeable(int style
, bool changeable
);
1272 // Display a auto-completion list.
1273 // The lenEntered parameter indicates how many characters before
1274 // the caret should be used to provide context.
1275 void AutoCompShow(int lenEntered
, const wxString
& itemList
);
1277 // Remove the auto-completion list from the screen.
1278 void AutoCompCancel();
1280 // Is there an auto-completion list visible?
1281 bool AutoCompActive();
1283 // Retrieve the position of the caret when the auto-completion list was displayed.
1284 int AutoCompPosStart();
1286 // User has selected an item so remove the list and insert the selection.
1287 void AutoCompComplete();
1289 // Define a set of character that when typed cancel the auto-completion list.
1290 void AutoCompStops(const wxString
& characterSet
);
1292 // Change the separator character in the string setting up an auto-completion list.
1293 // Default is space but can be changed if items contain space.
1294 void AutoCompSetSeparator(int separatorCharacter
);
1296 // Retrieve the auto-completion list separator character.
1297 int AutoCompGetSeparator();
1299 // Select the item in the auto-completion list that starts with a string.
1300 void AutoCompSelect(const wxString
& text
);
1302 // Should the auto-completion list be cancelled if the user backspaces to a
1303 // position before where the box was created.
1304 void AutoCompSetCancelAtStart(bool cancel
);
1306 // Retrieve whether auto-completion cancelled by backspacing before start.
1307 bool AutoCompGetCancelAtStart();
1309 // Define a set of characters that when typed will cause the autocompletion to
1310 // choose the selected item.
1311 void AutoCompSetFillUps(const wxString
& characterSet
);
1313 // Should a single item auto-completion list automatically choose the item.
1314 void AutoCompSetChooseSingle(bool chooseSingle
);
1316 // Retrieve whether a single item auto-completion list automatically choose the item.
1317 bool AutoCompGetChooseSingle();
1319 // Set whether case is significant when performing auto-completion searches.
1320 void AutoCompSetIgnoreCase(bool ignoreCase
);
1322 // Retrieve state of ignore case flag.
1323 bool AutoCompGetIgnoreCase();
1325 // Display a list of strings and send notification when user chooses one.
1326 void UserListShow(int listType
, const wxString
& itemList
);
1328 // Set whether or not autocompletion is hidden automatically when nothing matches.
1329 void AutoCompSetAutoHide(bool autoHide
);
1331 // Retrieve whether or not autocompletion is hidden automatically when nothing matches.
1332 bool AutoCompGetAutoHide();
1334 // Set whether or not autocompletion deletes any word characters
1335 // after the inserted text upon completion.
1336 void AutoCompSetDropRestOfWord(bool dropRestOfWord
);
1338 // Retrieve whether or not autocompletion deletes any word characters
1339 // after the inserted text upon completion.
1340 bool AutoCompGetDropRestOfWord();
1342 // Set the number of spaces used for one level of indentation.
1343 void SetIndent(int indentSize
);
1345 // Retrieve indentation size.
1348 // Indentation will only use space characters if useTabs is false, otherwise
1349 // it will use a combination of tabs and spaces.
1350 void SetUseTabs(bool useTabs
);
1352 // Retrieve whether tabs will be used in indentation.
1355 // Change the indentation of a line to a number of columns.
1356 void SetLineIndentation(int line
, int indentSize
);
1358 // Retrieve the number of columns that a line is indented.
1359 int GetLineIndentation(int line
);
1361 // Retrieve the position before the first non indentation character on a line.
1362 int GetLineIndentPosition(int line
);
1364 // Retrieve the column number of a position, taking tab width into account.
1365 int GetColumn(int pos
);
1367 // Show or hide the horizontal scroll bar.
1368 void SetUseHorizontalScrollBar(bool show
);
1370 // Is the horizontal scroll bar visible?
1371 bool GetUseHorizontalScrollBar();
1373 // Show or hide indentation guides.
1374 void SetIndentationGuides(bool show
);
1376 // Are the indentation guides visible?
1377 bool GetIndentationGuides();
1379 // Set the highlighted indentation guide column.
1380 // 0 = no highlighted guide.
1381 void SetHighlightGuide(int column
);
1383 // Get the highlighted indentation guide column.
1384 int GetHighlightGuide();
1386 // Get the position after the last visible characters on a line.
1387 int GetLineEndPosition(int line
);
1389 // Get the code page used to interpret the bytes of the document as characters.
1392 // Get the foreground colour of the caret.
1393 wxColour
GetCaretForeground();
1395 // In read-only mode?
1398 // Sets the position of the caret.
1399 void SetCurrentPos(int pos
);
1401 // Sets the position that starts the selection - this becomes the anchor.
1402 void SetSelectionStart(int pos
);
1404 // Returns the position at the start of the selection.
1405 int GetSelectionStart();
1407 // Sets the position that ends the selection - this becomes the currentPosition.
1408 void SetSelectionEnd(int pos
);
1410 // Returns the position at the end of the selection.
1411 int GetSelectionEnd();
1413 // Sets the print magnification added to the point size of each style for printing.
1414 void SetPrintMagnification(int magnification
);
1416 // Returns the print magnification.
1417 int GetPrintMagnification();
1419 // Modify colours when printing for clearer printed text.
1420 void SetPrintColourMode(int mode
);
1422 // Returns the print colour mode.
1423 int GetPrintColourMode();
1425 // Find some text in the document.
1426 int FindText(int minPos
, int maxPos
, const wxString
& text
, int flags
=0);
1428 // On Windows, will draw the document into a display context such as a printer.
1429 int FormatRange(bool doDraw
,
1433 wxDC
* target
, // Why does it use two? Can they be the same?
1437 // Retrieve the line at the top of the display.
1438 int GetFirstVisibleLine();
1440 // Retrieve the contents of a line.
1441 wxString
GetLine(int line
);
1443 // Returns the number of lines in the document. There is always at least one.
1446 // Sets the size in pixels of the left margin.
1447 void SetMarginLeft(int pixelWidth
);
1449 // Returns the size in pixels of the left margin.
1450 int GetMarginLeft();
1452 // Sets the size in pixels of the right margin.
1453 void SetMarginRight(int pixelWidth
);
1455 // Returns the size in pixels of the right margin.
1456 int GetMarginRight();
1458 // Is the document different from when it was last saved?
1461 // Select a range of text.
1462 void SetSelection(int start
, int end
);
1464 // Retrieve the selected text.
1465 wxString
GetSelectedText();
1467 // Retrieve a range of text.
1468 wxString
GetTextRange(int startPos
, int endPos
);
1470 // Draw the selection in normal style or with selection highlighted.
1471 void HideSelection(bool normal
);
1473 // Retrieve the line containing a position.
1474 int LineFromPosition(int pos
);
1476 // Retrieve the position at the start of a line.
1477 int PositionFromLine(int line
);
1479 // Scroll horizontally and vertically.
1480 void LineScroll(int columns
, int lines
);
1482 // Ensure the caret is visible.
1483 void EnsureCaretVisible();
1485 // Replace the selected text with the argument text.
1486 void ReplaceSelection(const wxString
& text
);
1488 // Set to read only or read write.
1489 void SetReadOnly(bool readOnly
);
1491 // Will a paste succeed?
1494 // Are there any undoable actions in the undo history?
1497 // Delete the undo history.
1498 void EmptyUndoBuffer();
1500 // Undo one action in the undo history.
1503 // Cut the selection to the clipboard.
1506 // Copy the selection to the clipboard.
1509 // Paste the contents of the clipboard into the document replacing the selection.
1512 // Clear the selection.
1515 // Replace the contents of the document with the argument text.
1516 void SetText(const wxString
& text
);
1518 // Retrieve all the text in the document.
1521 // Retrieve the number of characters in the document.
1522 int GetTextLength();
1524 // Set to overtype (true) or insert mode.
1525 void SetOvertype(bool overtype
);
1527 // Returns true if overtype mode is active otherwise false is returned.
1530 // Set the width of the insert mode caret.
1531 void SetCaretWidth(int pixelWidth
);
1533 // Returns the width of the insert mode caret.
1534 int GetCaretWidth();
1536 // Sets the position that starts the target which is used for updating the
1537 // document without affecting the scroll position.
1538 void SetTargetStart(int pos
);
1540 // Get the position that starts the target.
1541 int GetTargetStart();
1543 // Sets the position that ends the target which is used for updating the
1544 // document without affecting the scroll position.
1545 void SetTargetEnd(int pos
);
1547 // Get the position that ends the target.
1550 // Replace the target text with the argument text.
1551 // Text is counted so it can contain nulls.
1552 // Returns the length of the replacement text.
1553 int ReplaceTarget(const wxString
& text
);
1555 // Replace the target text with the argument text after \d processing.
1556 // Text is counted so it can contain nulls.
1557 // Looks for \d where d is between 1 and 9 and replaces these with the strings
1558 // matched in the last search operation which were surrounded by \( and \).
1559 // Returns the length of the replacement text including any change
1560 // caused by processing the \d patterns.
1561 int ReplaceTargetRE(const wxString
& text
);
1563 // Search for a counted string in the target and set the target to the found
1564 // range. Text is counted so it can contain nulls.
1565 // Returns length of range or -1 for failure in which case target is not moved.
1566 int SearchInTarget(const wxString
& text
);
1568 // Set the search flags used by SearchInTarget.
1569 void SetSearchFlags(int flags
);
1571 // Get the search flags used by SearchInTarget.
1572 int GetSearchFlags();
1574 // Show a call tip containing a definition near position pos.
1575 void CallTipShow(int pos
, const wxString
& definition
);
1577 // Remove the call tip from the screen.
1578 void CallTipCancel();
1580 // Is there an active call tip?
1581 bool CallTipActive();
1583 // Retrieve the position where the caret was before displaying the call tip.
1584 int CallTipPosAtStart();
1586 // Highlight a segment of the definition.
1587 void CallTipSetHighlight(int start
, int end
);
1589 // Set the background colour for the call tip.
1590 void CallTipSetBackground(const wxColour
& back
);
1592 // Find the display line of a document line taking hidden lines into account.
1593 int VisibleFromDocLine(int line
);
1595 // Find the document line of a display line taking hidden lines into account.
1596 int DocLineFromVisible(int lineDisplay
);
1598 // Set the fold level of a line.
1599 // This encodes an integer level along with flags indicating whether the
1600 // line is a header and whether it is effectively white space.
1601 void SetFoldLevel(int line
, int level
);
1603 // Retrieve the fold level of a line.
1604 int GetFoldLevel(int line
);
1606 // Find the last child line of a header line.
1607 int GetLastChild(int line
, int level
);
1609 // Find the parent line of a child line.
1610 int GetFoldParent(int line
);
1612 // Make a range of lines visible.
1613 void ShowLines(int lineStart
, int lineEnd
);
1615 // Make a range of lines invisible.
1616 void HideLines(int lineStart
, int lineEnd
);
1618 // Is a line visible?
1619 bool GetLineVisible(int line
);
1621 // Show the children of a header line.
1622 void SetFoldExpanded(int line
, bool expanded
);
1624 // Is a header line expanded?
1625 bool GetFoldExpanded(int line
);
1627 // Switch a header line between expanded and contracted.
1628 void ToggleFold(int line
);
1630 // Ensure a particular line is visible by expanding any header line hiding it.
1631 void EnsureVisible(int line
);
1633 // Set some debugging options for folding.
1634 void SetFoldFlags(int flags
);
1636 // Ensure a particular line is visible by expanding any header line hiding it.
1637 // Use the currently set visibility policy to determine which range to display.
1638 void EnsureVisibleEnforcePolicy(int line
);
1640 // Sets whether a tab pressed when caret is within indentation indents.
1641 void SetTabIndents(bool tabIndents
);
1643 // Does a tab pressed when caret is within indentation indent?
1644 bool GetTabIndents();
1646 // Sets whether a backspace pressed when caret is within indentation unindents.
1647 void SetBackSpaceUnIndents(bool bsUnIndents
);
1649 // Does a backspace pressed when caret is within indentation unindent?
1650 bool GetBackSpaceUnIndents();
1652 // Sets the time the mouse must sit still to generate a mouse dwell event.
1653 void SetMouseDwellTime(int periodMilliseconds
);
1655 // Retrieve the time the mouse must sit still to generate a mouse dwell event.
1656 int GetMouseDwellTime();
1658 // Get position of start of word.
1659 int WordStartPosition(int pos
, bool onlyWordCharacters
);
1661 // Get position of end of word.
1662 int WordEndPosition(int pos
, bool onlyWordCharacters
);
1664 // Sets whether text is word wrapped.
1665 void SetWrapMode(int mode
);
1667 // Retrieve whether text is word wrapped.
1670 // Sets the degree of caching of layout information.
1671 void SetLayoutCache(int mode
);
1673 // Retrieve the degree of caching of layout information.
1674 int GetLayoutCache();
1676 // Sets the document width assumed for scrolling.
1677 void SetScrollWidth(int pixelWidth
);
1679 // Retrieve the document width assumed for scrolling.
1680 int GetScrollWidth();
1682 // Measure the pixel width of some text in a particular style.
1683 // Nul terminated text argument.
1684 // Does not handle tab or control characters.
1685 int TextWidth(int style
, const wxString
& text
);
1687 // Sets the scroll range so that maximum scroll position has
1688 // the last line at the bottom of the view (default).
1689 // Setting this to false allows scrolling one page below the last line.
1690 void SetEndAtLastLine(bool endAtLastLine
);
1692 // Retrieve whether the maximum scroll position has the last
1693 // line at the bottom of the view.
1694 int GetEndAtLastLine();
1696 // Retrieve the height of a particular line of text in pixels.
1697 int TextHeight(int line
);
1699 // Move caret to first position on display line.
1702 // Move caret to first position on display line extending selection to
1703 // new caret position.
1704 void HomeDisplayExtend();
1706 // Move caret to last position on display line.
1707 void LineEndDisplay();
1709 // Move caret to last position on display line extending selection to new
1711 void LineEndDisplayExtend();
1713 // Move the caret inside current view if it's not there already.
1714 void MoveCaretInsideView();
1716 // How many characters are on a line, not including end of line characters?
1717 int LineLength(int line
);
1719 // Highlight the characters at two positions.
1720 void BraceHighlight(int pos1
, int pos2
);
1722 // Highlight the character at a position indicating there is no matching brace.
1723 void BraceBadLight(int pos
);
1725 // Find the position of a matching brace or INVALID_POSITION if no match.
1726 int BraceMatch(int pos
);
1728 // Are the end of line characters visible?
1731 // Make the end of line characters visible or invisible.
1732 void SetViewEOL(bool visible
);
1734 // Retrieve a pointer to the document object.
1735 void* GetDocPointer();
1737 // Change the document object used.
1738 void SetDocPointer(void* docPointer
);
1740 // Set which document modification events are sent to the container.
1741 void SetModEventMask(int mask
);
1743 // Retrieve the column number which text should be kept within.
1744 int GetEdgeColumn();
1746 // Set the column number of the edge.
1747 // If text goes past the edge then it is highlighted.
1748 void SetEdgeColumn(int column
);
1750 // Retrieve the edge highlight mode.
1753 // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1754 // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1755 void SetEdgeMode(int mode
);
1757 // Retrieve the colour used in edge indication.
1758 wxColour
GetEdgeColour();
1760 // Change the colour used in edge indication.
1761 void SetEdgeColour(const wxColour
& edgeColour
);
1763 // Sets the current caret position to be the search anchor.
1764 void SearchAnchor();
1766 // Find some text starting at the search anchor.
1767 // Does not ensure the selection is visible.
1768 int SearchNext(int flags
, const wxString
& text
);
1770 // Find some text starting at the search anchor and moving backwards.
1771 // Does not ensure the selection is visible.
1772 int SearchPrev(int flags
, const wxString
& text
);
1774 // Retrieves the number of lines completely visible.
1775 int LinesOnScreen();
1777 // Set whether a pop up menu is displayed automatically when the user presses
1778 // the wrong mouse button.
1779 void UsePopUp(bool allowPopUp
);
1781 // Is the selection rectangular? The alternative is the more common stream selection.
1782 bool SelectionIsRectangle();
1784 // Set the zoom level. This number of points is added to the size of all fonts.
1785 // It may be positive to magnify or negative to reduce.
1786 void SetZoom(int zoom
);
1788 // Retrieve the zoom level.
1791 // Create a new document object.
1792 // Starts with reference count of 1 and not selected into editor.
1793 void* CreateDocument();
1795 // Extend life of document.
1796 void AddRefDocument(void* docPointer
);
1798 // Release a reference to the document, deleting document if it fades to black.
1799 void ReleaseDocument(void* docPointer
);
1801 // Get which document modification events are sent to the container.
1802 int GetModEventMask();
1804 // Change internal focus flag.
1805 void SetSTCFocus(bool focus
);
1807 // Get internal focus flag.
1810 // Change error status - 0 = OK.
1811 void SetStatus(int statusCode
);
1813 // Get error status.
1816 // Set whether the mouse is captured when its button is pressed.
1817 void SetMouseDownCaptures(bool captures
);
1819 // Get whether mouse gets captured.
1820 bool GetMouseDownCaptures();
1822 // Sets the cursor to one of the SC_CURSOR* values.
1823 void SetCursor(int cursorType
);
1828 // Change the way control characters are displayed:
1829 // If symbol is < 32, keep the drawn way, else, use the given character.
1830 void SetControlCharSymbol(int symbol
);
1832 // Get the way control characters are displayed.
1833 int GetControlCharSymbol();
1835 // Move to the previous change in capitalisation.
1836 void WordPartLeft();
1838 // Move to the previous change in capitalisation extending selection
1839 // to new caret position.
1840 void WordPartLeftExtend();
1842 // Move to the change next in capitalisation.
1843 void WordPartRight();
1845 // Move to the next change in capitalisation extending selection
1846 // to new caret position.
1847 void WordPartRightExtend();
1849 // Set the way the display area is determined when a particular line
1850 // is to be moved to by Find, FindNext, GotoLine, etc.
1851 void SetVisiblePolicy(int visiblePolicy
, int visibleSlop
);
1853 // Delete back from the current position to the start of the line.
1856 // Delete forwards from the current position to the end of the line.
1857 void DelLineRight();
1859 // Get and Set the xOffset (ie, horizonal scroll position).
1860 void SetXOffset(int newOffset
);
1863 // Set the way the caret is kept visible when going sideway.
1864 // The exclusion zone is given in pixels.
1865 void SetXCaretPolicy(int caretPolicy
, int caretSlop
);
1867 // Set the way the line the caret is on is kept visible.
1868 // The exclusion zone is given in lines.
1869 void SetYCaretPolicy(int caretPolicy
, int caretSlop
);
1871 // Start notifying the container of all key presses and commands.
1874 // Stop notifying the container of all key presses and commands.
1877 // Set the lexing language of the document.
1878 void SetLexer(int lexer
);
1880 // Retrieve the lexing language of the document.
1883 // Colourise a segment of the document using the current lexing language.
1884 void Colourise(int start
, int end
);
1886 // Set up a value that may be used by a lexer for some optional feature.
1887 void SetProperty(const wxString
& key
, const wxString
& value
);
1889 // Set up the key words used by the lexer.
1890 void SetKeyWords(int keywordSet
, const wxString
& keyWords
);
1892 // Set the lexing language of the document based on string name.
1893 void SetLexerLanguage(const wxString
& language
);
1895 // END of generated section
1896 //----------------------------------------------------------------------
1900 // Returns the line number of the line with the caret.
1901 int GetCurrentLine();
1903 // Extract style settings from a spec-string which is composed of one or
1904 // more of the following comma separated elements:
1906 // bold turns on bold
1907 // italic turns on italics
1908 // fore:#RRGGBB sets the foreground colour
1909 // back:#RRGGBB sets the background colour
1910 // face:[facename] sets the font face name to use
1911 // size:[num] sets the font size in points
1912 // eol turns on eol filling
1913 // underline turns on underlining
1915 void StyleSetSpec(int styleNum
, const wxString
& spec
);
1919 // Set style size, face, bold, italic, and underline attributes from
1920 // a wxFont's attributes.
1921 void StyleSetFont(int styleNum
, wxFont
& font
);
1925 // Set all font style attributes at once.
1926 void StyleSetFontAttr(int styleNum
, int size
,
1927 const wxString
& faceName
,
1928 bool bold
, bool italic
,
1933 // Perform one of the operations defined by the wxSTC_CMD_* constants.
1934 void CmdKeyExecute(int cmd
);
1938 // Set the left and right margin in the edit area, measured in pixels.
1939 void SetMargins(int left
, int right
);
1942 // Retrieve the start and end positions of the current selection.
1944 void GetSelection(int* OUTPUT
, int* OUTPUT
);
1946 void GetSelection(int* startPos
, int* endPos
);
1949 // Retrieve the point in the window where a position is displayed.
1950 wxPoint
PointFromPosition(int pos
);
1953 // Scroll enough to make the given line visible
1954 void ScrollToLine(int line
);
1957 // Scroll enough to make the given column visible
1958 void ScrollToColumn(int column
);
1961 // Send a message to Scintilla
1962 long SendMsg(int msg
, long wp
=0, long lp
=0);
1965 // Set the vertical scrollbar to use instead of the ont that's built-in.
1966 void SetVScrollBar(wxScrollBar
* bar
) { m_vScrollBar
= bar
; }
1969 // Set the horizontal scrollbar to use instead of the ont that's built-in.
1970 void SetHScrollBar(wxScrollBar
* bar
) { m_hScrollBar
= bar
; }
1972 // Can be used to prevent the EVT_CHAR handler from adding the char
1973 bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed
; }
1974 void SetLastKeydownProcessed(bool val
) { m_lastKeyDownConsumed
= val
; }
1977 //----------------------------------------------------------------------
1983 void OnPaint(wxPaintEvent
& evt
);
1984 void OnScrollWin(wxScrollWinEvent
& evt
);
1985 void OnScroll(wxScrollEvent
& evt
);
1986 void OnSize(wxSizeEvent
& evt
);
1987 void OnMouseLeftDown(wxMouseEvent
& evt
);
1988 void OnMouseMove(wxMouseEvent
& evt
);
1989 void OnMouseLeftUp(wxMouseEvent
& evt
);
1990 void OnMouseRightUp(wxMouseEvent
& evt
);
1991 void OnMouseMiddleUp(wxMouseEvent
& evt
);
1992 void OnContextMenu(wxContextMenuEvent
& evt
);
1993 void OnMouseWheel(wxMouseEvent
& evt
);
1994 void OnChar(wxKeyEvent
& evt
);
1995 void OnKeyDown(wxKeyEvent
& evt
);
1996 void OnLoseFocus(wxFocusEvent
& evt
);
1997 void OnGainFocus(wxFocusEvent
& evt
);
1998 void OnSysColourChanged(wxSysColourChangedEvent
& evt
);
1999 void OnEraseBackground(wxEraseEvent
& evt
);
2000 void OnMenu(wxCommandEvent
& evt
);
2001 void OnListBox(wxCommandEvent
& evt
);
2004 // Turn notifications from Scintilla into events
2005 void NotifyChange();
2006 void NotifyParent(SCNotification
* scn
);
2010 DECLARE_EVENT_TABLE()
2011 DECLARE_CLASS(wxStyledTextCtrl
)
2014 wxStopWatch m_stopWatch
;
2015 wxScrollBar
* m_vScrollBar
;
2016 wxScrollBar
* m_hScrollBar
;
2018 bool m_lastKeyDownConsumed
;
2020 friend class ScintillaWX
;
2021 friend class Platform
;
2025 //----------------------------------------------------------------------
2027 // SWIG can't handle "#if" type of conditionals, only "#ifdef"
2029 #define STC_USE_DND 1
2031 #if wxUSE_DRAG_AND_DROP
2032 #define STC_USE_DND 1
2036 class wxStyledTextEvent
: public wxCommandEvent
{
2038 wxStyledTextEvent(wxEventType commandType
=0, int id
=0);
2040 wxStyledTextEvent(const wxStyledTextEvent
& event
);
2042 ~wxStyledTextEvent() {}
2044 void SetPosition(int pos
) { m_position
= pos
; }
2045 void SetKey(int k
) { m_key
= k
; }
2046 void SetModifiers(int m
) { m_modifiers
= m
; }
2047 void SetModificationType(int t
) { m_modificationType
= t
; }
2048 void SetText(const wxString
& t
) { m_text
= t
; }
2049 void SetLength(int len
) { m_length
= len
; }
2050 void SetLinesAdded(int num
) { m_linesAdded
= num
; }
2051 void SetLine(int val
) { m_line
= val
; }
2052 void SetFoldLevelNow(int val
) { m_foldLevelNow
= val
; }
2053 void SetFoldLevelPrev(int val
) { m_foldLevelPrev
= val
; }
2054 void SetMargin(int val
) { m_margin
= val
; }
2055 void SetMessage(int val
) { m_message
= val
; }
2056 void SetWParam(int val
) { m_wParam
= val
; }
2057 void SetLParam(int val
) { m_lParam
= val
; }
2058 void SetListType(int val
) { m_listType
= val
; }
2059 void SetX(int val
) { m_x
= val
; }
2060 void SetY(int val
) { m_y
= val
; }
2061 void SetDragText(const wxString
& val
) { m_dragText
= val
; }
2062 void SetDragAllowMove(bool val
) { m_dragAllowMove
= val
; }
2064 void SetDragResult(wxDragResult val
) { m_dragResult
= val
; }
2067 int GetPosition() const { return m_position
; }
2068 int GetKey() const { return m_key
; }
2069 int GetModifiers() const { return m_modifiers
; }
2070 int GetModificationType() const { return m_modificationType
; }
2071 wxString
GetText() const { return m_text
; }
2072 int GetLength() const { return m_length
; }
2073 int GetLinesAdded() const { return m_linesAdded
; }
2074 int GetLine() const { return m_line
; }
2075 int GetFoldLevelNow() const { return m_foldLevelNow
; }
2076 int GetFoldLevelPrev() const { return m_foldLevelPrev
; }
2077 int GetMargin() const { return m_margin
; }
2078 int GetMessage() const { return m_message
; }
2079 int GetWParam() const { return m_wParam
; }
2080 int GetLParam() const { return m_lParam
; }
2081 int GetListType() const { return m_listType
; }
2082 int GetX() const { return m_x
; }
2083 int GetY() const { return m_y
; }
2084 wxString
GetDragText() { return m_dragText
; }
2085 bool GetDragAllowMove() { return m_dragAllowMove
; }
2087 wxDragResult
GetDragResult() { return m_dragResult
; }
2090 bool GetShift() const;
2091 bool GetControl() const;
2092 bool GetAlt() const;
2094 virtual wxEvent
* Clone() const { return new wxStyledTextEvent(*this); }
2098 DECLARE_DYNAMIC_CLASS(wxStyledTextEvent
)
2104 int m_modificationType
; // wxEVT_STC_MODIFIED
2110 int m_foldLevelPrev
;
2112 int m_margin
; // wxEVT_STC_MARGINCLICK
2114 int m_message
; // wxEVT_STC_MACRORECORD
2122 wxString m_dragText
; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
2123 bool m_dragAllowMove
; // wxEVT_STC_START_DRAG
2125 #if wxUSE_DRAG_AND_DROP
2126 wxDragResult m_dragResult
; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
2132 BEGIN_DECLARE_EVENT_TYPES()
2133 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE
, 1650)
2134 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED
, 1651)
2135 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED
, 1652)
2136 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED
, 1653)
2137 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT
, 1654)
2138 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT
, 1655)
2139 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY
, 1656)
2140 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK
, 1657)
2141 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI
, 1658)
2142 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED
, 1659)
2143 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD
, 1660)
2144 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK
, 1661)
2145 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN
, 1662)
2146 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED
, 1663)
2147 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_PAINTED
, 1664)
2148 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_USERLISTSELECTION
, 1665)
2149 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED
, 1666)
2150 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART
, 1667)
2151 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND
, 1668)
2152 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG
, 1669)
2153 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER
, 1670)
2154 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP
, 1671)
2155 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM
, 1672)
2156 END_DECLARE_EVENT_TYPES()
2160 wxEVT_STC_STYLENEEDED
,
2161 wxEVT_STC_CHARADDED
,
2162 wxEVT_STC_SAVEPOINTREACHED
,
2163 wxEVT_STC_SAVEPOINTLEFT
,
2164 wxEVT_STC_ROMODIFYATTEMPT
,
2166 wxEVT_STC_DOUBLECLICK
,
2169 wxEVT_STC_MACRORECORD
,
2170 wxEVT_STC_MARGINCLICK
,
2171 wxEVT_STC_NEEDSHOWN
,
2172 wxEVT_STC_POSCHANGED
,
2174 wxEVT_STC_USERLISTSELECTION
,
2175 wxEVT_STC_URIDROPPED
,
2176 wxEVT_STC_DWELLSTART
,
2178 wxEVT_STC_START_DRAG
,
2179 wxEVT_STC_DRAG_OVER
,
2188 typedef void (wxEvtHandler::*wxStyledTextEventFunction
)(wxStyledTextEvent
&);
2190 #define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2191 #define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2192 #define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2193 #define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2194 #define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2195 #define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2196 #define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2197 #define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2198 #define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2199 #define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2200 #define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2201 #define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2202 #define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2203 #define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2204 #define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2205 #define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2206 #define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2207 #define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2208 #define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2209 #define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2210 #define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2211 #define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2212 #define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2215 //----------------------------------------------------------------------
2216 // Utility functions used within wxSTC
2220 inline wxString
stc2wx(const char* str
) {
2222 return wxString(str
, wxConvUTF8
);
2224 return wxString(str
);
2228 inline wxString
stc2wx(const char* str
, size_t len
) {
2230 return wxString(str
, wxConvUTF8
, len
);
2232 return wxString(str
, len
);
2237 inline const wxWX2MBbuf
wx2stc(const wxString
& str
) {
2238 return str
.mb_str(wxConvUTF8
);
2241 inline const wxWX2MBbuf
wx2stc(const wxString
& str
) {
2242 return str
.mbc_str();
2249 //----------------------------------------------------------------------