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