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