1
////////////////////////////////////////////////////////////////////////////
3
// Purpose: A wxWidgets implementation of Scintilla. This class is the
4
// one meant to be used directly by wx applications. It does not
5
// derive directly from the Scintilla classes, and in fact there
6
// is no mention of Scintilla classes at all in this header.
7
// This class delegates all method calls and events to the
8
// Scintilla objects and so forth. This allows the use of
9
// Scintilla without polluting the namespace with all the
10
// classes and itentifiers from Scintilla.
14
// Created: 13-Jan-2000
15
// Copyright: (c) 2000 by Total Control Software
16
// Licence: wxWindows license
17
/////////////////////////////////////////////////////////////////////////////
27
#ifdef WXMAKINGDLL_STC
28
#define WXDLLIMPEXP_STC WXEXPORT
29
#elif defined(WXUSINGDLL)
30
#define WXDLLIMPEXP_STC WXIMPORT
31
#else // not making nor using DLL
32
#define WXDLLIMPEXP_STC
36
// SWIG can't handle "#if" type of conditionals, only "#ifdef"
40
#if wxUSE_DRAG_AND_DROP
45
//----------------------------------------------------------------------
47
// Should a wxPopupWindow be used for the call tips and autocomplete windows?
48
#ifndef wxSTC_USE_POPUP
49
#define wxSTC_USE_POPUP 1
52
//----------------------------------------------------------------------
53
// BEGIN generated section. The following code is automatically generated
54
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
57
#define wxSTC_INVALID_POSITION -1
59
// Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages
60
// as many EM_ messages can be used although that use is deprecated.
61
#define wxSTC_START 2000
62
#define wxSTC_OPTIONAL_START 3000
63
#define wxSTC_LEXER_START 4000
64
#define wxSTC_WS_INVISIBLE 0
65
#define wxSTC_WS_VISIBLEALWAYS 1
66
#define wxSTC_WS_VISIBLEAFTERINDENT 2
67
#define wxSTC_EOL_CRLF 0
68
#define wxSTC_EOL_CR 1
69
#define wxSTC_EOL_LF 2
71
// The SC_CP_UTF8 value can be used to enter Unicode mode.
72
// This is the same value as CP_UTF8 in Windows
73
#define wxSTC_CP_UTF8 65001
75
// The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+.
76
#define wxSTC_CP_DBCS 1
77
#define wxSTC_MARKER_MAX 31
78
#define wxSTC_MARK_CIRCLE 0
79
#define wxSTC_MARK_ROUNDRECT 1
80
#define wxSTC_MARK_ARROW 2
81
#define wxSTC_MARK_SMALLRECT 3
82
#define wxSTC_MARK_SHORTARROW 4
83
#define wxSTC_MARK_EMPTY 5
84
#define wxSTC_MARK_ARROWDOWN 6
85
#define wxSTC_MARK_MINUS 7
86
#define wxSTC_MARK_PLUS 8
88
// Shapes used for outlining column.
89
#define wxSTC_MARK_VLINE 9
90
#define wxSTC_MARK_LCORNER 10
91
#define wxSTC_MARK_TCORNER 11
92
#define wxSTC_MARK_BOXPLUS 12
93
#define wxSTC_MARK_BOXPLUSCONNECTED 13
94
#define wxSTC_MARK_BOXMINUS 14
95
#define wxSTC_MARK_BOXMINUSCONNECTED 15
96
#define wxSTC_MARK_LCORNERCURVE 16
97
#define wxSTC_MARK_TCORNERCURVE 17
98
#define wxSTC_MARK_CIRCLEPLUS 18
99
#define wxSTC_MARK_CIRCLEPLUSCONNECTED 19
100
#define wxSTC_MARK_CIRCLEMINUS 20
101
#define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
103
// Invisible mark that only sets the line background color.
104
#define wxSTC_MARK_BACKGROUND 22
105
#define wxSTC_MARK_DOTDOTDOT 23
106
#define wxSTC_MARK_ARROWS 24
107
#define wxSTC_MARK_PIXMAP 25
108
#define wxSTC_MARK_FULLRECT 26
109
#define wxSTC_MARK_CHARACTER 10000
111
// Markers used for outlining column.
112
#define wxSTC_MARKNUM_FOLDEREND 25
113
#define wxSTC_MARKNUM_FOLDEROPENMID 26
114
#define wxSTC_MARKNUM_FOLDERMIDTAIL 27
115
#define wxSTC_MARKNUM_FOLDERTAIL 28
116
#define wxSTC_MARKNUM_FOLDERSUB 29
117
#define wxSTC_MARKNUM_FOLDER 30
118
#define wxSTC_MARKNUM_FOLDEROPEN 31
119
#define wxSTC_MASK_FOLDERS 0xFE000000
120
#define wxSTC_MARGIN_SYMBOL 0
121
#define wxSTC_MARGIN_NUMBER 1
123
// Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles.
124
// Styles 38 and 39 are for future use.
125
#define wxSTC_STYLE_DEFAULT 32
126
#define wxSTC_STYLE_LINENUMBER 33
127
#define wxSTC_STYLE_BRACELIGHT 34
128
#define wxSTC_STYLE_BRACEBAD 35
129
#define wxSTC_STYLE_CONTROLCHAR 36
130
#define wxSTC_STYLE_INDENTGUIDE 37
131
#define wxSTC_STYLE_LASTPREDEFINED 39
132
#define wxSTC_STYLE_MAX 127
134
// Character set identifiers are used in StyleSetCharacterSet.
135
// The values are the same as the Windows *_CHARSET values.
136
#define wxSTC_CHARSET_ANSI 0
137
#define wxSTC_CHARSET_DEFAULT 1
138
#define wxSTC_CHARSET_BALTIC 186
139
#define wxSTC_CHARSET_CHINESEBIG5 136
140
#define wxSTC_CHARSET_EASTEUROPE 238
141
#define wxSTC_CHARSET_GB2312 134
142
#define wxSTC_CHARSET_GREEK 161
143
#define wxSTC_CHARSET_HANGUL 129
144
#define wxSTC_CHARSET_MAC 77
145
#define wxSTC_CHARSET_OEM 255
146
#define wxSTC_CHARSET_RUSSIAN 204
147
#define wxSTC_CHARSET_CYRILLIC 1251
148
#define wxSTC_CHARSET_SHIFTJIS 128
149
#define wxSTC_CHARSET_SYMBOL 2
150
#define wxSTC_CHARSET_TURKISH 162
151
#define wxSTC_CHARSET_JOHAB 130
152
#define wxSTC_CHARSET_HEBREW 177
153
#define wxSTC_CHARSET_ARABIC 178
154
#define wxSTC_CHARSET_VIETNAMESE 163
155
#define wxSTC_CHARSET_THAI 222
156
#define wxSTC_CHARSET_8859_15 1000
157
#define wxSTC_CASE_MIXED 0
158
#define wxSTC_CASE_UPPER 1
159
#define wxSTC_CASE_LOWER 2
160
#define wxSTC_INDIC_MAX 7
161
#define wxSTC_INDIC_PLAIN 0
162
#define wxSTC_INDIC_SQUIGGLE 1
163
#define wxSTC_INDIC_TT 2
164
#define wxSTC_INDIC_DIAGONAL 3
165
#define wxSTC_INDIC_STRIKE 4
166
#define wxSTC_INDIC_HIDDEN 5
167
#define wxSTC_INDIC_BOX 6
168
#define wxSTC_INDIC0_MASK 0x20
169
#define wxSTC_INDIC1_MASK 0x40
170
#define wxSTC_INDIC2_MASK 0x80
171
#define wxSTC_INDICS_MASK 0xE0
173
// PrintColourMode - use same colours as screen.
174
#define wxSTC_PRINT_NORMAL 0
176
// PrintColourMode - invert the light value of each style for printing.
177
#define wxSTC_PRINT_INVERTLIGHT 1
179
// PrintColourMode - force black text on white background for printing.
180
#define wxSTC_PRINT_BLACKONWHITE 2
182
// PrintColourMode - text stays coloured, but all background is forced to be white for printing.
183
#define wxSTC_PRINT_COLOURONWHITE 3
185
// PrintColourMode - only the default-background is forced to be white for printing.
186
#define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4
187
#define wxSTC_FIND_WHOLEWORD 2
188
#define wxSTC_FIND_MATCHCASE 4
189
#define wxSTC_FIND_WORDSTART 0x00100000
190
#define wxSTC_FIND_REGEXP 0x00200000
191
#define wxSTC_FIND_POSIX 0x00400000
192
#define wxSTC_FOLDLEVELBASE 0x400
193
#define wxSTC_FOLDLEVELWHITEFLAG 0x1000
194
#define wxSTC_FOLDLEVELHEADERFLAG 0x2000
195
#define wxSTC_FOLDLEVELBOXHEADERFLAG 0x4000
196
#define wxSTC_FOLDLEVELBOXFOOTERFLAG 0x8000
197
#define wxSTC_FOLDLEVELCONTRACTED 0x10000
198
#define wxSTC_FOLDLEVELUNINDENT 0x20000
199
#define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF
200
#define wxSTC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002
201
#define wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004
202
#define wxSTC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008
203
#define wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010
204
#define wxSTC_FOLDFLAG_LEVELNUMBERS 0x0040
205
#define wxSTC_FOLDFLAG_BOX 0x0001
206
#define wxSTC_TIME_FOREVER 10000000
207
#define wxSTC_WRAP_NONE 0
208
#define wxSTC_WRAP_WORD 1
209
#define wxSTC_WRAP_CHAR 2
210
#define wxSTC_WRAPVISUALFLAG_NONE 0x0000
211
#define wxSTC_WRAPVISUALFLAG_END 0x0001
212
#define wxSTC_WRAPVISUALFLAG_START 0x0002
213
#define wxSTC_WRAPVISUALFLAGLOC_DEFAULT 0x0000
214
#define wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001
215
#define wxSTC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002
216
#define wxSTC_CACHE_NONE 0
217
#define wxSTC_CACHE_CARET 1
218
#define wxSTC_CACHE_PAGE 2
219
#define wxSTC_CACHE_DOCUMENT 3
220
#define wxSTC_EDGE_NONE 0
221
#define wxSTC_EDGE_LINE 1
222
#define wxSTC_EDGE_BACKGROUND 2
223
#define wxSTC_CURSORNORMAL -1
224
#define wxSTC_CURSORWAIT 4
226
// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
227
#define wxSTC_VISIBLE_SLOP 0x01
228
#define wxSTC_VISIBLE_STRICT 0x04
230
// Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
231
// If CARET_SLOP is set, we can define a slop value: caretSlop.
232
// This value defines an unwanted zone (UZ) where the caret is... unwanted.
233
// This zone is defined as a number of pixels near the vertical margins,
234
// and as a number of lines near the horizontal margins.
235
// By keeping the caret away from the edges, it is seen within its context,
236
// so it is likely that the identifier that the caret is on can be completely seen,
237
// and that the current line is seen with some of the lines following it which are
238
// often dependent on that line.
239
#define wxSTC_CARET_SLOP 0x01
241
// If CARET_STRICT is set, the policy is enforced... strictly.
242
// The caret is centred on the display if slop is not set,
243
// and cannot go in the UZ if slop is set.
244
#define wxSTC_CARET_STRICT 0x04
246
// If CARET_JUMPS is set, the display is moved more energetically
247
// so the caret can move in the same direction longer before the policy is applied again.
248
#define wxSTC_CARET_JUMPS 0x10
250
// If CARET_EVEN is not set, instead of having symmetrical UZs,
251
// the left and bottom UZs are extended up to right and top UZs respectively.
252
// This way, we favour the displaying of useful information: the begining of lines,
253
// where most code reside, and the lines after the caret, eg. the body of a function.
254
#define wxSTC_CARET_EVEN 0x08
257
#define wxSTC_SEL_STREAM 0
258
#define wxSTC_SEL_RECTANGLE 1
259
#define wxSTC_SEL_LINES 2
261
// Maximum value of keywordSet parameter of SetKeyWords.
262
#define wxSTC_KEYWORDSET_MAX 8
265
// Type of modification and the action which caused the modification.
266
// These are defined as a bit mask to make it easy to specify which notifications are wanted.
267
// One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
268
#define wxSTC_MOD_INSERTTEXT 0x1
269
#define wxSTC_MOD_DELETETEXT 0x2
270
#define wxSTC_MOD_CHANGESTYLE 0x4
271
#define wxSTC_MOD_CHANGEFOLD 0x8
272
#define wxSTC_PERFORMED_USER 0x10
273
#define wxSTC_PERFORMED_UNDO 0x20
274
#define wxSTC_PERFORMED_REDO 0x40
275
#define wxSTC_MULTISTEPUNDOREDO 0x80
276
#define wxSTC_LASTSTEPINUNDOREDO 0x100
277
#define wxSTC_MOD_CHANGEMARKER 0x200
278
#define wxSTC_MOD_BEFOREINSERT 0x400
279
#define wxSTC_MOD_BEFOREDELETE 0x800
280
#define wxSTC_MULTILINEUNDOREDO 0x1000
281
#define wxSTC_MODEVENTMASKALL 0x1FFF
283
// Symbolic key codes and modifier flags.
284
// ASCII and other printable characters below 256.
285
// Extended keys above 300.
286
#define wxSTC_KEY_DOWN 300
287
#define wxSTC_KEY_UP 301
288
#define wxSTC_KEY_LEFT 302
289
#define wxSTC_KEY_RIGHT 303
290
#define wxSTC_KEY_HOME 304
291
#define wxSTC_KEY_END 305
292
#define wxSTC_KEY_PRIOR 306
293
#define wxSTC_KEY_NEXT 307
294
#define wxSTC_KEY_DELETE 308
295
#define wxSTC_KEY_INSERT 309
296
#define wxSTC_KEY_ESCAPE 7
297
#define wxSTC_KEY_BACK 8
298
#define wxSTC_KEY_TAB 9
299
#define wxSTC_KEY_RETURN 13
300
#define wxSTC_KEY_ADD 310
301
#define wxSTC_KEY_SUBTRACT 311
302
#define wxSTC_KEY_DIVIDE 312
303
#define wxSTC_SCMOD_NORM 0
304
#define wxSTC_SCMOD_SHIFT 1
305
#define wxSTC_SCMOD_CTRL 2
306
#define wxSTC_SCMOD_ALT 4
309
#define wxSTC_LEX_APPARMOR 80
311
// Lexical states for SCLEX_APPARMOR
312
#define wxSTC_APPARMOR_DEFAULT 0
313
#define wxSTC_APPARMOR_COMMENT 1
314
#define wxSTC_APPARMOR_INCLUDE 2
315
#define wxSTC_APPARMOR_PATH 3
316
#define wxSTC_APPARMOR_CAPABILITY 4
317
#define wxSTC_APPARMOR_PATH_TRANSITION 5
318
#define wxSTC_APPARMOR_PERMS 6
320
// Keep this number the same as in ScintillaBase.h
321
#define wxSTC_APPARMOR_OPEN_INCLUDE_MENU_ITEM 4891
322
#define wxSTC_APPARMOR_INSERT_INCLUDE_MENU_ITEM 4892
323
#define wxSTC_APPARMOR_SEARCH_PHRASE_IN_ALL_PROFILES 4893
324
//-----------------------------------------
325
// Commands that can be bound to keystrokes
328
// Redoes the next action on the undo history.
329
#define wxSTC_CMD_REDO 2011
331
// Select all the text in the document.
332
#define wxSTC_CMD_SELECTALL 2013
334
// Undo one action in the undo history.
335
#define wxSTC_CMD_UNDO 2176
337
// Cut the selection to the clipboard.
338
#define wxSTC_CMD_CUT 2177
340
// Copy the selection to the clipboard.
341
#define wxSTC_CMD_COPY 2178
343
// Paste the contents of the clipboard into the document replacing the selection.
344
#define wxSTC_CMD_PASTE 2179
346
// Clear the selection.
347
#define wxSTC_CMD_CLEAR 2180
349
// Move caret down one line.
350
#define wxSTC_CMD_LINEDOWN 2300
352
// Move caret down one line extending selection to new caret position.
353
#define wxSTC_CMD_LINEDOWNEXTEND 2301
355
// Move caret up one line.
356
#define wxSTC_CMD_LINEUP 2302
358
// Move caret up one line extending selection to new caret position.
359
#define wxSTC_CMD_LINEUPEXTEND 2303
361
// Move caret left one character.
362
#define wxSTC_CMD_CHARLEFT 2304
364
// Move caret left one character extending selection to new caret position.
365
#define wxSTC_CMD_CHARLEFTEXTEND 2305
367
// Move caret right one character.
368
#define wxSTC_CMD_CHARRIGHT 2306
370
// Move caret right one character extending selection to new caret position.
371
#define wxSTC_CMD_CHARRIGHTEXTEND 2307
373
// Move caret left one word.
374
#define wxSTC_CMD_WORDLEFT 2308
376
// Move caret left one word extending selection to new caret position.
377
#define wxSTC_CMD_WORDLEFTEXTEND 2309
379
// Move caret right one word.
380
#define wxSTC_CMD_WORDRIGHT 2310
382
// Move caret right one word extending selection to new caret position.
383
#define wxSTC_CMD_WORDRIGHTEXTEND 2311
385
// Move caret to first position on line.
386
#define wxSTC_CMD_HOME 2312
388
// Move caret to first position on line extending selection to new caret position.
389
#define wxSTC_CMD_HOMEEXTEND 2313
391
// Move caret to last position on line.
392
#define wxSTC_CMD_LINEEND 2314
394
// Move caret to last position on line extending selection to new caret position.
395
#define wxSTC_CMD_LINEENDEXTEND 2315
397
// Move caret to first position in document.
398
#define wxSTC_CMD_DOCUMENTSTART 2316
400
// Move caret to first position in document extending selection to new caret position.
401
#define wxSTC_CMD_DOCUMENTSTARTEXTEND 2317
403
// Move caret to last position in document.
404
#define wxSTC_CMD_DOCUMENTEND 2318
406
// Move caret to last position in document extending selection to new caret position.
407
#define wxSTC_CMD_DOCUMENTENDEXTEND 2319
409
// Move caret one page up.
410
#define wxSTC_CMD_PAGEUP 2320
412
// Move caret one page up extending selection to new caret position.
413
#define wxSTC_CMD_PAGEUPEXTEND 2321
415
// Move caret one page down.
416
#define wxSTC_CMD_PAGEDOWN 2322
418
// Move caret one page down extending selection to new caret position.
419
#define wxSTC_CMD_PAGEDOWNEXTEND 2323
421
// Switch from insert to overtype mode or the reverse.
422
#define wxSTC_CMD_EDITTOGGLEOVERTYPE 2324
424
// Cancel any modes such as call tip or auto-completion list display.
425
#define wxSTC_CMD_CANCEL 2325
427
// Delete the selection or if no selection, the character before the caret.
428
#define wxSTC_CMD_DELETEBACK 2326
430
// If selection is empty or all on one line replace the selection with a tab character.
431
// If more than one line selected, indent the lines.
432
#define wxSTC_CMD_TAB 2327
434
// Dedent the selected lines.
435
#define wxSTC_CMD_BACKTAB 2328
437
// Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
438
#define wxSTC_CMD_NEWLINE 2329
440
// Insert a Form Feed character.
441
#define wxSTC_CMD_FORMFEED 2330
443
// Move caret to before first visible character on line.
444
// If already there move to first character on line.
445
#define wxSTC_CMD_VCHOME 2331
447
// Like VCHome but extending selection to new caret position.
448
#define wxSTC_CMD_VCHOMEEXTEND 2332
450
// Magnify the displayed text by increasing the sizes by 1 point.
451
#define wxSTC_CMD_ZOOMIN 2333
453
// Make the displayed text smaller by decreasing the sizes by 1 point.
454
#define wxSTC_CMD_ZOOMOUT 2334
456
// Delete the word to the left of the caret.
457
#define wxSTC_CMD_DELWORDLEFT 2335
459
// Delete the word to the right of the caret.
460
#define wxSTC_CMD_DELWORDRIGHT 2336
462
// Cut the line containing the caret.
463
#define wxSTC_CMD_LINECUT 2337
465
// Delete the line containing the caret.
466
#define wxSTC_CMD_LINEDELETE 2338
468
// Switch the current line with the previous.
469
#define wxSTC_CMD_LINETRANSPOSE 2339
471
// Duplicate the current line.
472
#define wxSTC_CMD_LINEDUPLICATE 2404
474
// Transform the selection to lower case.
475
#define wxSTC_CMD_LOWERCASE 2340
477
// Transform the selection to upper case.
478
#define wxSTC_CMD_UPPERCASE 2341
480
// Scroll the document down, keeping the caret visible.
481
#define wxSTC_CMD_LINESCROLLDOWN 2342
483
// Scroll the document up, keeping the caret visible.
484
#define wxSTC_CMD_LINESCROLLUP 2343
486
// Delete the selection or if no selection, the character before the caret.
487
// Will not delete the character before at the start of a line.
488
#define wxSTC_CMD_DELETEBACKNOTLINE 2344
490
// Move caret to first position on display line.
491
#define wxSTC_CMD_HOMEDISPLAY 2345
493
// Move caret to first position on display line extending selection to
494
// new caret position.
495
#define wxSTC_CMD_HOMEDISPLAYEXTEND 2346
497
// Move caret to last position on display line.
498
#define wxSTC_CMD_LINEENDDISPLAY 2347
500
// Move caret to last position on display line extending selection to new
502
#define wxSTC_CMD_LINEENDDISPLAYEXTEND 2348
504
// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
505
// except they behave differently when word-wrap is enabled:
506
// They go first to the start / end of the display line, like (Home|LineEnd)Display
507
// The difference is that, the cursor is already at the point, it goes on to the start
508
// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
509
#define wxSTC_CMD_HOMEWRAP 2349
510
#define wxSTC_CMD_HOMEWRAPEXTEND 2450
511
#define wxSTC_CMD_LINEENDWRAP 2451
512
#define wxSTC_CMD_LINEENDWRAPEXTEND 2452
513
#define wxSTC_CMD_VCHOMEWRAP 2453
514
#define wxSTC_CMD_VCHOMEWRAPEXTEND 2454
516
// Copy the line containing the caret.
517
#define wxSTC_CMD_LINECOPY 2455
519
// Move to the previous change in capitalisation.
520
#define wxSTC_CMD_WORDPARTLEFT 2390
522
// Move to the previous change in capitalisation extending selection
523
// to new caret position.
524
#define wxSTC_CMD_WORDPARTLEFTEXTEND 2391
526
// Move to the change next in capitalisation.
527
#define wxSTC_CMD_WORDPARTRIGHT 2392
529
// Move to the next change in capitalisation extending selection
530
// to new caret position.
531
#define wxSTC_CMD_WORDPARTRIGHTEXTEND 2393
533
// Delete back from the current position to the start of the line.
534
#define wxSTC_CMD_DELLINELEFT 2395
536
// Delete forwards from the current position to the end of the line.
537
#define wxSTC_CMD_DELLINERIGHT 2396
539
// Move caret between paragraphs (delimited by empty lines).
540
#define wxSTC_CMD_PARADOWN 2413
541
#define wxSTC_CMD_PARADOWNEXTEND 2414
542
#define wxSTC_CMD_PARAUP 2415
543
#define wxSTC_CMD_PARAUPEXTEND 2416
545
// Move caret down one line, extending rectangular selection to new caret position.
546
#define wxSTC_CMD_LINEDOWNRECTEXTEND 2426
548
// Move caret up one line, extending rectangular selection to new caret position.
549
#define wxSTC_CMD_LINEUPRECTEXTEND 2427
551
// Move caret left one character, extending rectangular selection to new caret position.
552
#define wxSTC_CMD_CHARLEFTRECTEXTEND 2428
554
// Move caret right one character, extending rectangular selection to new caret position.
555
#define wxSTC_CMD_CHARRIGHTRECTEXTEND 2429
557
// Move caret to first position on line, extending rectangular selection to new caret position.
558
#define wxSTC_CMD_HOMERECTEXTEND 2430
560
// Move caret to before first visible character on line.
561
// If already there move to first character on line.
562
// In either case, extend rectangular selection to new caret position.
563
#define wxSTC_CMD_VCHOMERECTEXTEND 2431
565
// Move caret to last position on line, extending rectangular selection to new caret position.
566
#define wxSTC_CMD_LINEENDRECTEXTEND 2432
568
// Move caret one page up, extending rectangular selection to new caret position.
569
#define wxSTC_CMD_PAGEUPRECTEXTEND 2433
571
// Move caret one page down, extending rectangular selection to new caret position.
572
#define wxSTC_CMD_PAGEDOWNRECTEXTEND 2434
574
// Move caret to top of page, or one page up if already at top of page.
575
#define wxSTC_CMD_STUTTEREDPAGEUP 2435
577
// Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
578
#define wxSTC_CMD_STUTTEREDPAGEUPEXTEND 2436
580
// Move caret to bottom of page, or one page down if already at bottom of page.
581
#define wxSTC_CMD_STUTTEREDPAGEDOWN 2437
583
// Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
584
#define wxSTC_CMD_STUTTEREDPAGEDOWNEXTEND 2438
586
// Move caret left one word, position cursor at end of word.
587
#define wxSTC_CMD_WORDLEFTEND 2439
589
// Move caret left one word, position cursor at end of word, extending selection to new caret position.
590
#define wxSTC_CMD_WORDLEFTENDEXTEND 2440
592
// Move caret right one word, position cursor at end of word.
593
#define wxSTC_CMD_WORDRIGHTEND 2441
595
// Move caret right one word, position cursor at end of word, extending selection to new caret position.
596
#define wxSTC_CMD_WORDRIGHTENDEXTEND 2442
598
// "Open in a new window" has been selected from the context menu
599
#define wxSTC_CMD_OPEN_INCLUDE_IN_NEW_WINDOW 2443
602
// END of generated section
603
//----------------------------------------------------------------------
605
class ScintillaWX; // forward declare
607
struct SCNotification;
610
extern WXDLLIMPEXP_STC const wxChar* wxSTCNameStr;
611
class WXDLLIMPEXP_STC wxStyledTextCtrl;
612
class WXDLLIMPEXP_STC wxStyledTextEvent;
615
//----------------------------------------------------------------------
617
class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl {
621
%pythonAppend wxStyledTextCtrl "self._setOORInfo(self)"
622
%pythonAppend wxStyledTextCtrl() ""
624
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
625
const wxPoint& pos = wxDefaultPosition,
626
const wxSize& size = wxDefaultSize, long style = 0,
627
const wxString& name = wxPySTCNameStr);
628
%RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl());
631
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
632
const wxPoint& pos = wxDefaultPosition,
633
const wxSize& size = wxDefaultSize, long style = 0,
634
const wxString& name = wxSTCNameStr);
635
wxStyledTextCtrl() { m_swx = NULL; }
640
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY,
641
const wxPoint& pos = wxDefaultPosition,
642
const wxSize& size = wxDefaultSize, long style = 0,
643
const wxString& name = wxSTCNameStr);
646
//----------------------------------------------------------------------
647
// BEGIN generated section. The following code is automatically generated
648
// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
652
// Add text to the document at current position.
653
void AddText(const wxString& text);
655
// Add array of cells to document.
656
void AddStyledText(const wxMemoryBuffer& data);
658
// Insert string at a position.
659
void InsertText(int pos, const wxString& text);
661
// Delete all text in the document.
664
// Set all style bytes to 0, remove all folding information.
665
void ClearDocumentStyle();
667
// Returns the number of characters in the document.
670
// Returns the character byte at the position.
671
int GetCharAt(int pos);
673
// Returns the position of the caret.
676
// Returns the position of the opposite end of the selection to the caret.
679
// Returns the style byte at the position.
680
int GetStyleAt(int pos);
682
// Redoes the next action on the undo history.
685
// Choose between collecting actions into the undo
686
// history and discarding them.
687
void SetUndoCollection(bool collectUndo);
689
// Select all the text in the document.
692
// Remember the current position in the undo history as the position
693
// at which the document was saved.
696
// Retrieve a buffer of cells.
697
wxMemoryBuffer GetStyledText(int startPos, int endPos);
699
// Are there any redoable actions in the undo history?
702
// Retrieve the line number at which a particular marker is located.
703
int MarkerLineFromHandle(int handle);
706
void MarkerDeleteHandle(int handle);
708
// Is undo history being collected?
709
bool GetUndoCollection();
711
// Are white space characters currently visible?
712
// Returns one of SCWS_* constants.
713
int GetViewWhiteSpace();
715
// Make white space characters invisible, always visible or visible outside indentation.
716
void SetViewWhiteSpace(int viewWS);
718
// Find the position from a point within the window.
719
int PositionFromPoint(wxPoint pt);
721
// Find the position from a point within the window but return
722
// INVALID_POSITION if not close to text.
723
int PositionFromPointClose(int x, int y);
725
// Set caret to start of a line and ensure it is visible.
726
void GotoLine(int line);
728
// Set caret to a position and ensure it is visible.
729
void GotoPos(int pos);
731
// Set the selection anchor to a position. The anchor is the opposite
732
// end of the selection from the caret.
733
void SetAnchor(int posAnchor);
735
// Retrieve the text of the line containing the caret.
736
// Returns the index of the caret on the line.
738
wxString GetCurLine(int* OUTPUT);
740
wxString GetCurLine(int* linePos=NULL);
743
// Retrieve the position of the last correctly styled character.
746
// Convert all line endings in the document to one mode.
747
void ConvertEOLs(int eolMode);
749
// Retrieve the current end of line mode - one of CRLF, CR, or LF.
752
// Set the current end of line mode.
753
void SetEOLMode(int eolMode);
755
// Set the current styling position to pos and the styling mask to mask.
756
// The styling mask can be used to protect some bits in each styling byte from modification.
757
void StartStyling(int pos, int mask);
759
// Change style from current styling position for length characters to a style
760
// and move the current styling position to after this newly styled segment.
761
void SetStyling(int length, int style);
763
// Is drawing done first into a buffer or direct to the screen?
764
bool GetBufferedDraw();
766
// If drawing is buffered then each line of text is drawn into a bitmap buffer
767
// before drawing it to the screen to avoid flicker.
768
void SetBufferedDraw(bool buffered);
770
// Change the visible size of a tab to be a multiple of the width of a space character.
771
void SetTabWidth(int tabWidth);
773
// Retrieve the visible size of a tab.
776
// Set the code page used to interpret the bytes of the document as characters.
777
void SetCodePage(int codePage);
779
// Set the symbol used for a particular marker number,
780
// and optionally the fore and background colours.
781
void MarkerDefine(int markerNumber, int markerSymbol,
782
const wxColour& foreground = wxNullColour,
783
const wxColour& background = wxNullColour);
785
// Set the foreground colour used for a particular marker number.
786
void MarkerSetForeground(int markerNumber, const wxColour& fore);
788
// Set the background colour used for a particular marker number.
789
void MarkerSetBackground(int markerNumber, const wxColour& back);
791
// Add a marker to a line, returning an ID which can be used to find or delete the marker.
792
int MarkerAdd(int line, int markerNumber);
794
// Delete a marker from a line.
795
void MarkerDelete(int line, int markerNumber);
797
// Delete all markers with a particular number from all lines.
798
void MarkerDeleteAll(int markerNumber);
800
// Get a bit mask of all the markers set on a line.
801
int MarkerGet(int line);
803
// Find the next line after lineStart that includes a marker in mask.
804
int MarkerNext(int lineStart, int markerMask);
806
// Find the previous line before lineStart that includes a marker in mask.
807
int MarkerPrevious(int lineStart, int markerMask);
809
// Define a marker from a bitmap
810
void MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp);
812
// Add a set of markers to a line.
813
void MarkerAddSet(int line, int set);
815
// Set a margin to be either numeric or symbolic.
816
void SetMarginType(int margin, int marginType);
818
// Retrieve the type of a margin.
819
int GetMarginType(int margin);
821
// Set the width of a margin to a width expressed in pixels.
822
void SetMarginWidth(int margin, int pixelWidth);
824
// Retrieve the width of a margin in pixels.
825
int GetMarginWidth(int margin);
827
// Set a mask that determines which markers are displayed in a margin.
828
void SetMarginMask(int margin, int mask);
830
// Retrieve the marker mask of a margin.
831
int GetMarginMask(int margin);
833
// Make a margin sensitive or insensitive to mouse clicks.
834
void SetMarginSensitive(int margin, bool sensitive);
836
// Retrieve the mouse click sensitivity of a margin.
837
bool GetMarginSensitive(int margin);
839
// Clear all the styles and make equivalent to the global default style.
840
void StyleClearAll();
842
// Set the foreground colour of a style.
843
void StyleSetForeground(int style, const wxColour& fore);
845
// Set the background colour of a style.
846
void StyleSetBackground(int style, const wxColour& back);
848
// Set a style to be bold or not.
849
void StyleSetBold(int style, bool bold);
851
// Set a style to be italic or not.
852
void StyleSetItalic(int style, bool italic);
854
// Set the size of characters of a style.
855
void StyleSetSize(int style, int sizePoints);
857
// Set the font of a style.
858
void StyleSetFaceName(int style, const wxString& fontName);
860
// Set a style to have its end of line filled or not.
861
void StyleSetEOLFilled(int style, bool filled);
863
// Reset the default style to its state at startup
864
void StyleResetDefault();
866
// Set a style to be underlined or not.
867
void StyleSetUnderline(int style, bool underline);
869
// Set a style to be mixed case, or to force upper or lower case.
870
void StyleSetCase(int style, int caseForce);
872
// Set a style to be a hotspot or not.
873
void StyleSetHotSpot(int style, bool hotspot);
875
// Set the foreground colour of the selection and whether to use this setting.
876
void SetSelForeground(bool useSetting, const wxColour& fore);
878
// Set the background colour of the selection and whether to use this setting.
879
void SetSelBackground(bool useSetting, const wxColour& back);
881
// Set the foreground colour of the caret.
882
void SetCaretForeground(const wxColour& fore);
884
// When key+modifier combination km is pressed perform msg.
885
void CmdKeyAssign(int key, int modifiers, int cmd);
887
// When key+modifier combination km is pressed do nothing.
888
void CmdKeyClear(int key, int modifiers);
890
// Drop all key mappings.
891
void CmdKeyClearAll();
893
// Set the styles for a segment of the document.
894
void SetStyleBytes(int length, char* styleBytes);
896
// Set a style to be visible or not.
897
void StyleSetVisible(int style, bool visible);
899
// Get the time in milliseconds that the caret is on and off.
900
int GetCaretPeriod();
902
// Get the time in milliseconds that the caret is on and off. 0 = steady on.
903
void SetCaretPeriod(int periodMilliseconds);
905
// Set the set of characters making up words for when moving or selecting by word.
906
// First sets deaults like SetCharsDefault.
907
void SetWordChars(const wxString& characters);
909
// Start a sequence of actions that is undone and redone as a unit.
911
void BeginUndoAction();
913
// End a sequence of actions that is undone and redone as a unit.
914
void EndUndoAction();
916
// Set an indicator to plain, squiggle or TT.
917
void IndicatorSetStyle(int indic, int style);
919
// Retrieve the style of an indicator.
920
int IndicatorGetStyle(int indic);
922
// Set the foreground colour of an indicator.
923
void IndicatorSetForeground(int indic, const wxColour& fore);
925
// Retrieve the foreground colour of an indicator.
926
wxColour IndicatorGetForeground(int indic);
928
// Set the foreground colour of all whitespace and whether to use this setting.
929
void SetWhitespaceForeground(bool useSetting, const wxColour& fore);
931
// Set the background colour of all whitespace and whether to use this setting.
932
void SetWhitespaceBackground(bool useSetting, const wxColour& back);
934
// Divide each styling byte into lexical class bits (default: 5) and indicator
935
// bits (default: 3). If a lexer requires more than 32 lexical states, then this
936
// is used to expand the possible states.
937
void SetStyleBits(int bits);
939
// Retrieve number of bits in style bytes used to hold the lexical state.
942
// Used to hold extra styling information for each line.
943
void SetLineState(int line, int state);
945
// Retrieve the extra styling information for a line.
946
int GetLineState(int line);
948
// Retrieve the last line number that has line state.
949
int GetMaxLineState();
951
// Is the background of the line containing the caret in a different colour?
952
bool GetCaretLineVisible();
954
// Display the background of the line containing the caret in a different colour.
955
void SetCaretLineVisible(bool show);
957
// Get the colour of the background of the line containing the caret.
958
wxColour GetCaretLineBack();
960
// Set the colour of the background of the line containing the caret.
961
void SetCaretLineBack(const wxColour& back);
963
// Set a style to be changeable or not (read only).
964
// Experimental feature, currently buggy.
965
void StyleSetChangeable(int style, bool changeable);
967
// Display a auto-completion list.
968
// The lenEntered parameter indicates how many characters before
969
// the caret should be used to provide context.
970
void AutoCompShow(int lenEntered, const wxString& itemList);
972
// Remove the auto-completion list from the screen.
973
void AutoCompCancel();
975
// Is there an auto-completion list visible?
976
bool AutoCompActive();
978
// Retrieve the position of the caret when the auto-completion list was displayed.
979
int AutoCompPosStart();
981
// User has selected an item so remove the list and insert the selection.
982
void AutoCompComplete();
984
// Define a set of character that when typed cancel the auto-completion list.
985
void AutoCompStops(const wxString& characterSet);
987
// Change the separator character in the string setting up an auto-completion list.
988
// Default is space but can be changed if items contain space.
989
void AutoCompSetSeparator(int separatorCharacter);
991
// Retrieve the auto-completion list separator character.
992
int AutoCompGetSeparator();
994
// Select the item in the auto-completion list that starts with a string.
995
void AutoCompSelect(const wxString& text);
997
// Should the auto-completion list be cancelled if the user backspaces to a
998
// position before where the box was created.
999
void AutoCompSetCancelAtStart(bool cancel);
1001
// Retrieve whether auto-completion cancelled by backspacing before start.
1002
bool AutoCompGetCancelAtStart();
1004
// Define a set of characters that when typed will cause the autocompletion to
1005
// choose the selected item.
1006
void AutoCompSetFillUps(const wxString& characterSet);
1008
// Should a single item auto-completion list automatically choose the item.
1009
void AutoCompSetChooseSingle(bool chooseSingle);
1011
// Retrieve whether a single item auto-completion list automatically choose the item.
1012
bool AutoCompGetChooseSingle();
1014
// Set whether case is significant when performing auto-completion searches.
1015
void AutoCompSetIgnoreCase(bool ignoreCase);
1017
// Retrieve state of ignore case flag.
1018
bool AutoCompGetIgnoreCase();
1020
// Display a list of strings and send notification when user chooses one.
1021
void UserListShow(int listType, const wxString& itemList);
1023
// Set whether or not autocompletion is hidden automatically when nothing matches.
1024
void AutoCompSetAutoHide(bool autoHide);
1026
// Retrieve whether or not autocompletion is hidden automatically when nothing matches.
1027
bool AutoCompGetAutoHide();
1029
// Set whether or not autocompletion deletes any word characters
1030
// after the inserted text upon completion.
1031
void AutoCompSetDropRestOfWord(bool dropRestOfWord);
1033
// Retrieve whether or not autocompletion deletes any word characters
1034
// after the inserted text upon completion.
1035
bool AutoCompGetDropRestOfWord();
1037
// Register an image for use in autocompletion lists.
1038
void RegisterImage(int type, const wxBitmap& bmp);
1040
// Clear all the registered images.
1041
void ClearRegisteredImages();
1043
// Retrieve the auto-completion list type-separator character.
1044
int AutoCompGetTypeSeparator();
1046
// Change the type-separator character in the string setting up an auto-completion list.
1047
// Default is '?' but can be changed if items contain '?'.
1048
void AutoCompSetTypeSeparator(int separatorCharacter);
1050
// Set the maximum width, in characters, of auto-completion and user lists.
1051
// Set to 0 to autosize to fit longest item, which is the default.
1052
void AutoCompSetMaxWidth(int characterCount);
1054
// Get the maximum width, in characters, of auto-completion and user lists.
1055
int AutoCompGetMaxWidth();
1057
// Set the maximum height, in rows, of auto-completion and user lists.
1058
// The default is 5 rows.
1059
void AutoCompSetMaxHeight(int rowCount);
1061
// Set the maximum height, in rows, of auto-completion and user lists.
1062
int AutoCompGetMaxHeight();
1064
// Set the number of spaces used for one level of indentation.
1065
void SetIndent(int indentSize);
1067
// Retrieve indentation size.
1070
// Indentation will only use space characters if useTabs is false, otherwise
1071
// it will use a combination of tabs and spaces.
1072
void SetUseTabs(bool useTabs);
1074
// Retrieve whether tabs will be used in indentation.
1077
// Change the indentation of a line to a number of columns.
1078
void SetLineIndentation(int line, int indentSize);
1080
// Retrieve the number of columns that a line is indented.
1081
int GetLineIndentation(int line);
1083
// Retrieve the position before the first non indentation character on a line.
1084
int GetLineIndentPosition(int line);
1086
// Retrieve the column number of a position, taking tab width into account.
1087
int GetColumn(int pos);
1089
// Show or hide the horizontal scroll bar.
1090
void SetUseHorizontalScrollBar(bool show);
1092
// Is the horizontal scroll bar visible?
1093
bool GetUseHorizontalScrollBar();
1095
// Show or hide indentation guides.
1096
void SetIndentationGuides(bool show);
1098
// Are the indentation guides visible?
1099
bool GetIndentationGuides();
1101
// Set the highlighted indentation guide column.
1102
// 0 = no highlighted guide.
1103
void SetHighlightGuide(int column);
1105
// Get the highlighted indentation guide column.
1106
int GetHighlightGuide();
1108
// Get the position after the last visible characters on a line.
1109
int GetLineEndPosition(int line);
1111
// Get the code page used to interpret the bytes of the document as characters.
1114
// Get the foreground colour of the caret.
1115
wxColour GetCaretForeground();
1117
// In read-only mode?
1120
// Sets the position of the caret.
1121
void SetCurrentPos(int pos);
1123
// Sets the position that starts the selection - this becomes the anchor.
1124
void SetSelectionStart(int pos);
1126
// Returns the position at the start of the selection.
1127
int GetSelectionStart();
1129
// Sets the position that ends the selection - this becomes the currentPosition.
1130
void SetSelectionEnd(int pos);
1132
// Returns the position at the end of the selection.
1133
int GetSelectionEnd();
1135
// Sets the print magnification added to the point size of each style for printing.
1136
void SetPrintMagnification(int magnification);
1138
// Returns the print magnification.
1139
int GetPrintMagnification();
1141
// Modify colours when printing for clearer printed text.
1142
void SetPrintColourMode(int mode);
1144
// Returns the print colour mode.
1145
int GetPrintColourMode();
1147
// Find some text in the document.
1148
int FindText(int minPos, int maxPos, const wxString& text, int flags=0);
1150
// On Windows, will draw the document into a display context such as a printer.
1151
int FormatRange(bool doDraw,
1159
// Retrieve the display line at the top of the display.
1160
int GetFirstVisibleLine();
1162
// Retrieve the contents of a line.
1163
wxString GetLine(int line);
1165
// Returns the number of lines in the document. There is always at least one.
1168
// Sets the size in pixels of the left margin.
1169
void SetMarginLeft(int pixelWidth);
1171
// Returns the size in pixels of the left margin.
1172
int GetMarginLeft();
1174
// Sets the size in pixels of the right margin.
1175
void SetMarginRight(int pixelWidth);
1177
// Returns the size in pixels of the right margin.
1178
int GetMarginRight();
1180
// Is the document different from when it was last saved?
1183
// Select a range of text.
1184
void SetSelection(int start, int end);
1186
// Retrieve the selected text.
1187
wxString GetSelectedText();
1189
// Retrieve a range of text.
1190
wxString GetTextRange(int startPos, int endPos);
1192
// Draw the selection in normal style or with selection highlighted.
1193
void HideSelection(bool normal);
1195
// Retrieve the line containing a position.
1196
int LineFromPosition(int pos);
1198
// Retrieve the position at the start of a line.
1199
int PositionFromLine(int line);
1201
// Scroll horizontally and vertically.
1202
void LineScroll(int columns, int lines);
1204
// Ensure the caret is visible.
1205
void EnsureCaretVisible();
1207
// Replace the selected text with the argument text.
1208
void ReplaceSelection(const wxString& text);
1210
// Set to read only or read write.
1211
void SetReadOnly(bool readOnly);
1213
// Will a paste succeed?
1216
// Are there any undoable actions in the undo history?
1219
// Delete the undo history.
1220
void EmptyUndoBuffer();
1222
// Undo one action in the undo history.
1225
// Cut the selection to the clipboard.
1228
// Copy the selection to the clipboard.
1231
// Paste the contents of the clipboard into the document replacing the selection.
1234
// Clear the selection.
1237
// Replace the contents of the document with the argument text.
1238
void SetText(const wxString& text);
1240
// Retrieve all the text in the document.
1243
// Retrieve the number of characters in the document.
1244
int GetTextLength();
1246
// Set to overtype (true) or insert mode.
1247
void SetOvertype(bool overtype);
1249
// Returns true if overtype mode is active otherwise false is returned.
1252
// Set the width of the insert mode caret.
1253
void SetCaretWidth(int pixelWidth);
1255
// Returns the width of the insert mode caret.
1256
int GetCaretWidth();
1258
// Sets the position that starts the target which is used for updating the
1259
// document without affecting the scroll position.
1260
void SetTargetStart(int pos);
1262
// Get the position that starts the target.
1263
int GetTargetStart();
1265
// Sets the position that ends the target which is used for updating the
1266
// document without affecting the scroll position.
1267
void SetTargetEnd(int pos);
1269
// Get the position that ends the target.
1272
// Replace the target text with the argument text.
1273
// Text is counted so it can contain NULs.
1274
// Returns the length of the replacement text.
1275
int ReplaceTarget(const wxString& text);
1277
// Replace the target text with the argument text after \d processing.
1278
// Text is counted so it can contain NULs.
1279
// Looks for \d where d is between 1 and 9 and replaces these with the strings
1280
// matched in the last search operation which were surrounded by \( and \).
1281
// Returns the length of the replacement text including any change
1282
// caused by processing the \d patterns.
1283
int ReplaceTargetRE(const wxString& text);
1285
// Search for a counted string in the target and set the target to the found
1286
// range. Text is counted so it can contain NULs.
1287
// Returns length of range or -1 for failure in which case target is not moved.
1288
int SearchInTarget(const wxString& text);
1290
// Set the search flags used by SearchInTarget.
1291
void SetSearchFlags(int flags);
1293
// Get the search flags used by SearchInTarget.
1294
int GetSearchFlags();
1296
// Show a call tip containing a definition near position pos.
1297
void CallTipShow(int pos, const wxString& definition);
1299
// Remove the call tip from the screen.
1300
void CallTipCancel();
1302
// Is there an active call tip?
1303
bool CallTipActive();
1305
// Retrieve the position where the caret was before displaying the call tip.
1306
int CallTipPosAtStart();
1308
// Highlight a segment of the definition.
1309
void CallTipSetHighlight(int start, int end);
1311
// Set the background colour for the call tip.
1312
void CallTipSetBackground(const wxColour& back);
1314
// Set the foreground colour for the call tip.
1315
void CallTipSetForeground(const wxColour& fore);
1317
// Set the foreground colour for the highlighted part of the call tip.
1318
void CallTipSetForegroundHighlight(const wxColour& fore);
1320
// Find the display line of a document line taking hidden lines into account.
1321
int VisibleFromDocLine(int line);
1323
// Find the document line of a display line taking hidden lines into account.
1324
int DocLineFromVisible(int lineDisplay);
1326
// The number of display lines needed to wrap a document line
1327
int WrapCount(int line);
1329
// Set the fold level of a line.
1330
// This encodes an integer level along with flags indicating whether the
1331
// line is a header and whether it is effectively white space.
1332
void SetFoldLevel(int line, int level);
1334
// Retrieve the fold level of a line.
1335
int GetFoldLevel(int line);
1337
// Find the last child line of a header line.
1338
int GetLastChild(int line, int level);
1340
// Find the parent line of a child line.
1341
int GetFoldParent(int line);
1343
// Make a range of lines visible.
1344
void ShowLines(int lineStart, int lineEnd);
1346
// Make a range of lines invisible.
1347
void HideLines(int lineStart, int lineEnd);
1349
// Is a line visible?
1350
bool GetLineVisible(int line);
1352
// Show the children of a header line.
1353
void SetFoldExpanded(int line, bool expanded);
1355
// Is a header line expanded?
1356
bool GetFoldExpanded(int line);
1358
// Switch a header line between expanded and contracted.
1359
void ToggleFold(int line);
1361
// Ensure a particular line is visible by expanding any header line hiding it.
1362
void EnsureVisible(int line);
1364
// Set some style options for folding.
1365
void SetFoldFlags(int flags);
1367
// Ensure a particular line is visible by expanding any header line hiding it.
1368
// Use the currently set visibility policy to determine which range to display.
1369
void EnsureVisibleEnforcePolicy(int line);
1371
// Sets whether a tab pressed when caret is within indentation indents.
1372
void SetTabIndents(bool tabIndents);
1374
// Does a tab pressed when caret is within indentation indent?
1375
bool GetTabIndents();
1377
// Sets whether a backspace pressed when caret is within indentation unindents.
1378
void SetBackSpaceUnIndents(bool bsUnIndents);
1380
// Does a backspace pressed when caret is within indentation unindent?
1381
bool GetBackSpaceUnIndents();
1383
// Sets the time the mouse must sit still to generate a mouse dwell event.
1384
void SetMouseDwellTime(int periodMilliseconds);
1386
// Retrieve the time the mouse must sit still to generate a mouse dwell event.
1387
int GetMouseDwellTime();
1389
// Get position of start of word.
1390
int WordStartPosition(int pos, bool onlyWordCharacters);
1392
// Get position of end of word.
1393
int WordEndPosition(int pos, bool onlyWordCharacters);
1395
// Sets whether text is word wrapped.
1396
void SetWrapMode(int mode);
1398
// Retrieve whether text is word wrapped.
1401
// Set the display mode of visual flags for wrapped lines.
1402
void SetWrapVisualFlags(int wrapVisualFlags);
1404
// Retrive the display mode of visual flags for wrapped lines.
1405
int GetWrapVisualFlags();
1407
// Set the location of visual flags for wrapped lines.
1408
void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation);
1410
// Retrive the location of visual flags for wrapped lines.
1411
int GetWrapVisualFlagsLocation();
1413
// Set the start indent for wrapped lines.
1414
void SetWrapStartIndent(int indent);
1416
// Retrive the start indent for wrapped lines.
1417
int GetWrapStartIndent();
1419
// Sets the degree of caching of layout information.
1420
void SetLayoutCache(int mode);
1422
// Retrieve the degree of caching of layout information.
1423
int GetLayoutCache();
1425
// Sets the document width assumed for scrolling.
1426
void SetScrollWidth(int pixelWidth);
1428
// Retrieve the document width assumed for scrolling.
1429
int GetScrollWidth();
1431
// Measure the pixel width of some text in a particular style.
1432
// NUL terminated text argument.
1433
// Does not handle tab or control characters.
1434
int TextWidth(int style, const wxString& text);
1436
// Sets the scroll range so that maximum scroll position has
1437
// the last line at the bottom of the view (default).
1438
// Setting this to false allows scrolling one page below the last line.
1439
void SetEndAtLastLine(bool endAtLastLine);
1441
// Retrieve whether the maximum scroll position has the last
1442
// line at the bottom of the view.
1443
bool GetEndAtLastLine();
1445
// Retrieve the height of a particular line of text in pixels.
1446
int TextHeight(int line);
1448
// Show or hide the vertical scroll bar.
1449
void SetUseVerticalScrollBar(bool show);
1451
// Is the vertical scroll bar visible?
1452
bool GetUseVerticalScrollBar();
1454
// Append a string to the end of the document without changing the selection.
1455
void AppendText(const wxString& text);
1457
// Is drawing done in two phases with backgrounds drawn before foregrounds?
1458
bool GetTwoPhaseDraw();
1460
// In twoPhaseDraw mode, drawing is performed in two phases, first the background
1461
// and then the foreground. This avoids chopping off characters that overlap the next run.
1462
void SetTwoPhaseDraw(bool twoPhase);
1464
// Make the target range start and end be the same as the selection range start and end.
1465
void TargetFromSelection();
1467
// Join the lines in the target.
1470
// Split the lines in the target into lines that are less wide than pixelWidth
1472
void LinesSplit(int pixelWidth);
1474
// Set the colours used as a chequerboard pattern in the fold margin
1475
void SetFoldMarginColour(bool useSetting, const wxColour& back);
1476
void SetFoldMarginHiColour(bool useSetting, const wxColour& fore);
1478
// Move caret down one line.
1481
// Move caret down one line extending selection to new caret position.
1482
void LineDownExtend();
1484
// Move caret up one line.
1487
// Move caret up one line extending selection to new caret position.
1488
void LineUpExtend();
1490
// Move caret left one character.
1493
// Move caret left one character extending selection to new caret position.
1494
void CharLeftExtend();
1496
// Move caret right one character.
1499
// Move caret right one character extending selection to new caret position.
1500
void CharRightExtend();
1502
// Move caret left one word.
1505
// Move caret left one word extending selection to new caret position.
1506
void WordLeftExtend();
1508
// Move caret right one word.
1511
// Move caret right one word extending selection to new caret position.
1512
void WordRightExtend();
1514
// Move caret to first position on line.
1517
// Move caret to first position on line extending selection to new caret position.
1520
// Move caret to last position on line.
1523
// Move caret to last position on line extending selection to new caret position.
1524
void LineEndExtend();
1526
// Move caret to first position in document.
1527
void DocumentStart();
1529
// Move caret to first position in document extending selection to new caret position.
1530
void DocumentStartExtend();
1532
// Move caret to last position in document.
1535
// Move caret to last position in document extending selection to new caret position.
1536
void DocumentEndExtend();
1538
// Move caret one page up.
1541
// Move caret one page up extending selection to new caret position.
1542
void PageUpExtend();
1544
// Move caret one page down.
1547
// Move caret one page down extending selection to new caret position.
1548
void PageDownExtend();
1550
// Switch from insert to overtype mode or the reverse.
1551
void EditToggleOvertype();
1553
// Cancel any modes such as call tip or auto-completion list display.
1556
// Delete the selection or if no selection, the character before the caret.
1559
// If selection is empty or all on one line replace the selection with a tab character.
1560
// If more than one line selected, indent the lines.
1563
// Dedent the selected lines.
1566
// Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
1569
// Insert a Form Feed character.
1572
// Move caret to before first visible character on line.
1573
// If already there move to first character on line.
1576
// Like VCHome but extending selection to new caret position.
1577
void VCHomeExtend();
1579
// Magnify the displayed text by increasing the sizes by 1 point.
1582
// Make the displayed text smaller by decreasing the sizes by 1 point.
1585
// Delete the word to the left of the caret.
1588
// Delete the word to the right of the caret.
1589
void DelWordRight();
1591
// Cut the line containing the caret.
1594
// Delete the line containing the caret.
1597
// Switch the current line with the previous.
1598
void LineTranspose();
1600
// Duplicate the current line.
1601
void LineDuplicate();
1603
// Transform the selection to lower case.
1606
// Transform the selection to upper case.
1609
// Scroll the document down, keeping the caret visible.
1610
void LineScrollDown();
1612
// Scroll the document up, keeping the caret visible.
1613
void LineScrollUp();
1615
// Delete the selection or if no selection, the character before the caret.
1616
// Will not delete the character before at the start of a line.
1617
void DeleteBackNotLine();
1619
// Move caret to first position on display line.
1622
// Move caret to first position on display line extending selection to
1623
// new caret position.
1624
void HomeDisplayExtend();
1626
// Move caret to last position on display line.
1627
void LineEndDisplay();
1629
// Move caret to last position on display line extending selection to new
1631
void LineEndDisplayExtend();
1633
// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
1634
// except they behave differently when word-wrap is enabled:
1635
// They go first to the start / end of the display line, like (Home|LineEnd)Display
1636
// The difference is that, the cursor is already at the point, it goes on to the start
1637
// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
1639
void HomeWrapExtend();
1641
void LineEndWrapExtend();
1643
void VCHomeWrapExtend();
1645
// Copy the line containing the caret.
1648
// Move the caret inside current view if it's not there already.
1649
void MoveCaretInsideView();
1651
// How many characters are on a line, not including end of line characters?
1652
int LineLength(int line);
1654
// Highlight the characters at two positions.
1655
void BraceHighlight(int pos1, int pos2);
1657
// Highlight the character at a position indicating there is no matching brace.
1658
void BraceBadLight(int pos);
1660
// Find the position of a matching brace or INVALID_POSITION if no match.
1661
int BraceMatch(int pos);
1663
// Are the end of line characters visible?
1666
// Make the end of line characters visible or invisible.
1667
void SetViewEOL(bool visible);
1669
// Retrieve a pointer to the document object.
1670
void* GetDocPointer();
1672
// Change the document object used.
1673
void SetDocPointer(void* docPointer);
1675
// Set which document modification events are sent to the container.
1676
void SetModEventMask(int mask);
1678
// Retrieve the column number which text should be kept within.
1679
int GetEdgeColumn();
1681
// Set the column number of the edge.
1682
// If text goes past the edge then it is highlighted.
1683
void SetEdgeColumn(int column);
1685
// Retrieve the edge highlight mode.
1688
// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1689
// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1690
void SetEdgeMode(int mode);
1692
// Retrieve the colour used in edge indication.
1693
wxColour GetEdgeColour();
1695
// Change the colour used in edge indication.
1696
void SetEdgeColour(const wxColour& edgeColour);
1698
// Sets the current caret position to be the search anchor.
1699
void SearchAnchor();
1701
// Find some text starting at the search anchor.
1702
// Does not ensure the selection is visible.
1703
int SearchNext(int flags, const wxString& text);
1705
// Find some text starting at the search anchor and moving backwards.
1706
// Does not ensure the selection is visible.
1707
int SearchPrev(int flags, const wxString& text);
1709
// Retrieves the number of lines completely visible.
1710
int LinesOnScreen();
1712
// Set whether a pop up menu is displayed automatically when the user presses
1713
// the wrong mouse button.
1714
void UsePopUp(bool allowPopUp);
1716
// Is the selection rectangular? The alternative is the more common stream selection.
1717
bool SelectionIsRectangle();
1719
// Set the zoom level. This number of points is added to the size of all fonts.
1720
// It may be positive to magnify or negative to reduce.
1721
void SetZoom(int zoom);
1723
// Retrieve the zoom level.
1726
// Create a new document object.
1727
// Starts with reference count of 1 and not selected into editor.
1728
void* CreateDocument();
1730
// Extend life of document.
1731
void AddRefDocument(void* docPointer);
1733
// Release a reference to the document, deleting document if it fades to black.
1734
void ReleaseDocument(void* docPointer);
1736
// Get which document modification events are sent to the container.
1737
int GetModEventMask();
1739
// Change internal focus flag.
1740
void SetSTCFocus(bool focus);
1742
// Get internal focus flag.
1745
// Change error status - 0 = OK.
1746
void SetStatus(int statusCode);
1748
// Get error status.
1751
// Set whether the mouse is captured when its button is pressed.
1752
void SetMouseDownCaptures(bool captures);
1754
// Get whether mouse gets captured.
1755
bool GetMouseDownCaptures();
1757
// Sets the cursor to one of the SC_CURSOR* values.
1758
void SetSTCCursor(int cursorType);
1763
// Change the way control characters are displayed:
1764
// If symbol is < 32, keep the drawn way, else, use the given character.
1765
void SetControlCharSymbol(int symbol);
1767
// Get the way control characters are displayed.
1768
int GetControlCharSymbol();
1770
// Move to the previous change in capitalisation.
1771
void WordPartLeft();
1773
// Move to the previous change in capitalisation extending selection
1774
// to new caret position.
1775
void WordPartLeftExtend();
1777
// Move to the change next in capitalisation.
1778
void WordPartRight();
1780
// Move to the next change in capitalisation extending selection
1781
// to new caret position.
1782
void WordPartRightExtend();
1784
// Set the way the display area is determined when a particular line
1785
// is to be moved to by Find, FindNext, GotoLine, etc.
1786
void SetVisiblePolicy(int visiblePolicy, int visibleSlop);
1788
// Delete back from the current position to the start of the line.
1791
// Delete forwards from the current position to the end of the line.
1792
void DelLineRight();
1794
// Get and Set the xOffset (ie, horizonal scroll position).
1795
void SetXOffset(int newOffset);
1798
// Set the last x chosen value to be the caret x position.
1799
void ChooseCaretX();
1801
// Set the way the caret is kept visible when going sideway.
1802
// The exclusion zone is given in pixels.
1803
void SetXCaretPolicy(int caretPolicy, int caretSlop);
1805
// Set the way the line the caret is on is kept visible.
1806
// The exclusion zone is given in lines.
1807
void SetYCaretPolicy(int caretPolicy, int caretSlop);
1809
// Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
1810
void SetPrintWrapMode(int mode);
1812
// Is printing line wrapped?
1813
int GetPrintWrapMode();
1815
// Set a fore colour for active hotspots.
1816
void SetHotspotActiveForeground(bool useSetting, const wxColour& fore);
1818
// Set a back colour for active hotspots.
1819
void SetHotspotActiveBackground(bool useSetting, const wxColour& back);
1821
// Enable / Disable underlining active hotspots.
1822
void SetHotspotActiveUnderline(bool underline);
1824
// Limit hotspots to single line so hotspots on two lines don't merge.
1825
void SetHotspotSingleLine(bool singleLine);
1827
// Move caret between paragraphs (delimited by empty lines).
1829
void ParaDownExtend();
1831
void ParaUpExtend();
1833
// Given a valid document position, return the previous position taking code
1834
// page into account. Returns 0 if passed 0.
1835
int PositionBefore(int pos);
1837
// Given a valid document position, return the next position taking code
1838
// page into account. Maximum value returned is the last position in the document.
1839
int PositionAfter(int pos);
1841
// Copy a range of text to the clipboard. Positions are clipped into the document.
1842
void CopyRange(int start, int end);
1844
// Copy argument text to the clipboard.
1845
void CopyText(int length, const wxString& text);
1847
// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or
1848
// by lines (SC_SEL_LINES).
1849
void SetSelectionMode(int mode);
1851
// Get the mode of the current selection.
1852
int GetSelectionMode();
1854
// Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
1855
int GetLineSelStartPosition(int line);
1857
// Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
1858
int GetLineSelEndPosition(int line);
1860
// Move caret down one line, extending rectangular selection to new caret position.
1861
void LineDownRectExtend();
1863
// Move caret up one line, extending rectangular selection to new caret position.
1864
void LineUpRectExtend();
1866
// Move caret left one character, extending rectangular selection to new caret position.
1867
void CharLeftRectExtend();
1869
// Move caret right one character, extending rectangular selection to new caret position.
1870
void CharRightRectExtend();
1872
// Move caret to first position on line, extending rectangular selection to new caret position.
1873
void HomeRectExtend();
1875
// Move caret to before first visible character on line.
1876
// If already there move to first character on line.
1877
// In either case, extend rectangular selection to new caret position.
1878
void VCHomeRectExtend();
1880
// Move caret to last position on line, extending rectangular selection to new caret position.
1881
void LineEndRectExtend();
1883
// Move caret one page up, extending rectangular selection to new caret position.
1884
void PageUpRectExtend();
1886
// Move caret one page down, extending rectangular selection to new caret position.
1887
void PageDownRectExtend();
1889
// Move caret to top of page, or one page up if already at top of page.
1890
void StutteredPageUp();
1892
// Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
1893
void StutteredPageUpExtend();
1895
// Move caret to bottom of page, or one page down if already at bottom of page.
1896
void StutteredPageDown();
1898
// Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
1899
void StutteredPageDownExtend();
1901
// Move caret left one word, position cursor at end of word.
1904
// Move caret left one word, position cursor at end of word, extending selection to new caret position.
1905
void WordLeftEndExtend();
1907
// Move caret right one word, position cursor at end of word.
1908
void WordRightEnd();
1910
// Move caret right one word, position cursor at end of word, extending selection to new caret position.
1911
void WordRightEndExtend();
1913
// Set the set of characters making up whitespace for when moving or selecting by word.
1914
// Should be called after SetWordChars.
1915
void SetWhitespaceChars(const wxString& characters);
1917
// Reset the set of characters for whitespace and word characters to the defaults.
1918
void SetCharsDefault();
1920
// Get currently selected item position in the auto-completion list
1921
int AutoCompGetCurrent();
1923
// Enlarge the document to a particular size of text bytes.
1924
void Allocate(int bytes);
1926
// Find the position of a column on a line taking into account tabs and
1927
// multi-byte characters. If beyond end of line, return line end position.
1928
int FindColumn(int line, int column);
1930
// Can the caret preferred x position only be changed by explicit movement commands?
1931
bool GetCaretSticky();
1933
// Stop the caret preferred x position changing when the user types.
1934
void SetCaretSticky(bool useCaretStickyBehaviour);
1936
// Switch between sticky and non-sticky: meant to be bound to a key.
1937
void ToggleCaretSticky();
1939
// Enable/Disable convert-on-paste for line endings
1940
void SetPasteConvertEndings(bool convert);
1942
// Get convert-on-paste setting
1943
bool GetPasteConvertEndings();
1945
// Duplicate the selection. If selection empty duplicate the line containing the caret.
1946
void SelectionDuplicate();
1948
// Start notifying the container of all key presses and commands.
1951
// Stop notifying the container of all key presses and commands.
1954
// Set the lexing language of the document.
1955
void SetLexer(int lexer);
1957
// Retrieve the lexing language of the document.
1960
// Colourise a segment of the document using the current lexing language.
1961
void Colourise(int start, int end);
1963
// Set up a value that may be used by a lexer for some optional feature.
1964
void SetProperty(const wxString& key, const wxString& value);
1966
// Set up the key words used by the lexer.
1967
void SetKeyWords(int keywordSet, const wxString& keyWords);
1969
// Set the lexing language of the document based on string name.
1970
void SetLexerLanguage(const wxString& language);
1972
// Retrieve a 'property' value previously set with SetProperty.
1973
wxString GetProperty(const wxString& key);
1975
// Retrieve a 'property' value previously set with SetProperty,
1976
// with '$()' variable replacement on returned buffer.
1977
wxString GetPropertyExpanded(const wxString& key);
1979
// Retrieve a 'property' value previously set with SetProperty,
1980
// interpreted as an int AFTER any '$()' variable replacement.
1981
int GetPropertyInt(const wxString& key);
1983
// Retrieve the number of bits the current lexer needs for styling.
1984
int GetStyleBitsNeeded();
1986
// END of generated section
1987
//----------------------------------------------------------------------
1991
// Returns the line number of the line with the caret.
1992
int GetCurrentLine();
1994
// Extract style settings from a spec-string which is composed of one or
1995
// more of the following comma separated elements:
1997
// bold turns on bold
1998
// italic turns on italics
1999
// fore:[name or #RRGGBB] sets the foreground colour
2000
// back:[name or #RRGGBB] sets the background colour
2001
// face:[facename] sets the font face name to use
2002
// size:[num] sets the font size in points
2003
// eol turns on eol filling
2004
// underline turns on underlining
2006
void StyleSetSpec(int styleNum, const wxString& spec);
2010
// Set style size, face, bold, italic, and underline attributes from
2011
// a wxFont's attributes.
2012
void StyleSetFont(int styleNum, wxFont& font);
2016
// Set all font style attributes at once.
2017
void StyleSetFontAttr(int styleNum, int size,
2018
const wxString& faceName,
2019
bool bold, bool italic,
2021
wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
2024
// Set the character set of the font in a style. Converts the Scintilla
2025
// character set values to a wxFontEncoding.
2026
void StyleSetCharacterSet(int style, int characterSet);
2028
// Set the font encoding to be used by a style.
2029
void StyleSetFontEncoding(int style, wxFontEncoding encoding);
2032
// Perform one of the operations defined by the wxSTC_CMD_* constants.
2033
void CmdKeyExecute(int cmd);
2036
// Set the left and right margin in the edit area, measured in pixels.
2037
void SetMargins(int left, int right);
2040
// Retrieve the start and end positions of the current selection.
2042
void GetSelection(int* OUTPUT, int* OUTPUT);
2044
void GetSelection(int* startPos, int* endPos);
2047
// Retrieve the point in the window where a position is displayed.
2048
wxPoint PointFromPosition(int pos);
2051
// Scroll enough to make the given line visible
2052
void ScrollToLine(int line);
2055
// Scroll enough to make the given column visible
2056
void ScrollToColumn(int column);
2059
// Send a message to Scintilla
2060
long SendMsg(int msg, long wp=0, long lp=0);
2063
// Set the vertical scrollbar to use instead of the ont that's built-in.
2064
void SetVScrollBar(wxScrollBar* bar);
2067
// Set the horizontal scrollbar to use instead of the ont that's built-in.
2068
void SetHScrollBar(wxScrollBar* bar);
2070
// Can be used to prevent the EVT_CHAR handler from adding the char
2071
bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; }
2072
void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; }
2074
// Write the contents of the editor to filename
2075
bool SaveFile(const wxString& filename);
2077
// Load the contents of filename into the editor
2078
bool LoadFile(const wxString& filename);
2081
// Allow for simulating a DnD DragOver
2082
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
2084
// Allow for simulating a DnD DropText
2085
bool DoDropText(long x, long y, const wxString& data);
2088
// Specify whether anti-aliased fonts should be used. Will have no effect
2089
// on some platforms, but on some (wxMac for example) can greatly improve
2091
void SetUseAntiAliasing(bool useAA);
2093
// Returns the current UseAntiAliasing setting.
2094
bool GetUseAntiAliasing();
2098
// The following methods are nearly equivallent to their similarly named
2099
// cousins above. The difference is that these methods bypass wxString
2100
// and always use a char* even if used in a unicode build of wxWidgets.
2101
// In that case the character data will be utf-8 encoded since that is
2102
// what is used internally by Scintilla in unicode builds.
2104
// Add text to the document at current position.
2105
void AddTextRaw(const char* text);
2107
// Insert string at a position.
2108
void InsertTextRaw(int pos, const char* text);
2110
// Retrieve the text of the line containing the caret.
2111
// Returns the index of the caret on the line.
2113
wxCharBuffer GetCurLineRaw(int* OUTPUT);
2115
wxCharBuffer GetCurLineRaw(int* linePos=NULL);
2118
// Retrieve the contents of a line.
2119
wxCharBuffer GetLineRaw(int line);
2121
// Retrieve the selected text.
2122
wxCharBuffer GetSelectedTextRaw();
2124
// Retrieve a range of text.
2125
wxCharBuffer GetTextRangeRaw(int startPos, int endPos);
2127
// Replace the contents of the document with the argument text.
2128
void SetTextRaw(const char* text);
2130
// Retrieve all the text in the document.
2131
wxCharBuffer GetTextRaw();
2133
// Append a string to the end of the document without changing the selection.
2134
void AppendTextRaw(const char* text);
2137
%pythoncode "_stc_utf8_methods.py"
2139
//----------------------------------------------------------------------
2145
void OnPaint(wxPaintEvent& evt);
2146
void OnScrollWin(wxScrollWinEvent& evt);
2147
void OnScroll(wxScrollEvent& evt);
2148
void OnSize(wxSizeEvent& evt);
2149
void OnMouseLeftDown(wxMouseEvent& evt);
2150
void OnMouseMove(wxMouseEvent& evt);
2151
void OnMouseLeftUp(wxMouseEvent& evt);
2152
void OnMouseRightUp(wxMouseEvent& evt);
2153
void OnMouseMiddleUp(wxMouseEvent& evt);
2154
void OnContextMenu(wxContextMenuEvent& evt);
2155
void OnMouseWheel(wxMouseEvent& evt);
2156
void OnChar(wxKeyEvent& evt);
2157
void OnKeyDown(wxKeyEvent& evt);
2158
void OnLoseFocus(wxFocusEvent& evt);
2159
void OnGainFocus(wxFocusEvent& evt);
2160
void OnSysColourChanged(wxSysColourChangedEvent& evt);
2161
void OnEraseBackground(wxEraseEvent& evt);
2162
void OnMenu(wxCommandEvent& evt);
2163
void OnListBox(wxCommandEvent& evt);
2164
void OnIdle(wxIdleEvent& evt);
2165
void OnOpenInclude (wxCommandEvent &event);
2166
virtual wxSize DoGetBestSize() const;
2168
// Turn notifications from Scintilla into events
2169
void NotifyChange();
2170
void NotifyParent(SCNotification* scn);
2173
DECLARE_EVENT_TABLE()
2174
DECLARE_DYNAMIC_CLASS(wxStyledTextCtrl)
2179
wxStopWatch m_stopWatch;
2180
wxScrollBar* m_vScrollBar;
2181
wxScrollBar* m_hScrollBar;
2183
bool m_lastKeyDownConsumed;
2185
friend class ScintillaWX;
2186
friend class Platform;
2190
//----------------------------------------------------------------------
2192
class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent {
2194
wxStyledTextEvent(wxEventType commandType=0, int id=0);
2196
wxStyledTextEvent(const wxStyledTextEvent& event);
2198
~wxStyledTextEvent() {}
2200
void SetPosition(int pos) { m_position = pos; }
2201
void SetKey(int k) { m_key = k; }
2202
void SetModifiers(int m) { m_modifiers = m; }
2203
void SetModificationType(int t) { m_modificationType = t; }
2204
void SetText(const wxString& t) { m_text = t; }
2205
void SetLength(int len) { m_length = len; }
2206
void SetLinesAdded(int num) { m_linesAdded = num; }
2207
void SetLine(int val) { m_line = val; }
2208
void SetFoldLevelNow(int val) { m_foldLevelNow = val; }
2209
void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; }
2210
void SetMargin(int val) { m_margin = val; }
2211
void SetMessage(int val) { m_message = val; }
2212
void SetWParam(int val) { m_wParam = val; }
2213
void SetLParam(int val) { m_lParam = val; }
2214
void SetListType(int val) { m_listType = val; }
2215
void SetX(int val) { m_x = val; }
2216
void SetY(int val) { m_y = val; }
2217
void SetDragText(const wxString& val) { m_dragText = val; }
2218
void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
2220
void SetDragResult(wxDragResult val) { m_dragResult = val; }
2223
int GetPosition() const { return m_position; }
2224
int GetKey() const { return m_key; }
2225
int GetModifiers() const { return m_modifiers; }
2226
int GetModificationType() const { return m_modificationType; }
2227
wxString GetText() const { return m_text; }
2228
int GetLength() const { return m_length; }
2229
int GetLinesAdded() const { return m_linesAdded; }
2230
int GetLine() const { return m_line; }
2231
int GetFoldLevelNow() const { return m_foldLevelNow; }
2232
int GetFoldLevelPrev() const { return m_foldLevelPrev; }
2233
int GetMargin() const { return m_margin; }
2234
int GetMessage() const { return m_message; }
2235
int GetWParam() const { return m_wParam; }
2236
int GetLParam() const { return m_lParam; }
2237
int GetListType() const { return m_listType; }
2238
int GetX() const { return m_x; }
2239
int GetY() const { return m_y; }
2240
wxString GetDragText() { return m_dragText; }
2241
bool GetDragAllowMove() { return m_dragAllowMove; }
2243
wxDragResult GetDragResult() { return m_dragResult; }
2246
bool GetShift() const;
2247
bool GetControl() const;
2248
bool GetAlt() const;
2250
virtual wxEvent* Clone() const { return new wxStyledTextEvent(*this); }
2254
DECLARE_DYNAMIC_CLASS(wxStyledTextEvent)
2260
int m_modificationType; // wxEVT_STC_MODIFIED
2266
int m_foldLevelPrev;
2268
int m_margin; // wxEVT_STC_MARGINCLICK
2270
int m_message; // wxEVT_STC_MACRORECORD
2278
wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
2279
bool m_dragAllowMove; // wxEVT_STC_START_DRAG
2281
#if wxUSE_DRAG_AND_DROP
2282
wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
2290
BEGIN_DECLARE_EVENT_TYPES()
2291
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, 1650)
2292
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, 1651)
2293
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, 1652)
2294
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, 1653)
2295
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, 1654)
2296
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, 1655)
2297
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_KEY, 1656)
2298
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, 1657)
2299
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, 1658)
2300
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, 1659)
2301
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, 1660)
2302
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, 1661)
2303
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, 1662)
2304
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, 1664)
2305
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, 1665)
2306
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, 1666)
2307
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, 1667)
2308
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, 1668)
2309
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, 1669)
2310
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, 1670)
2311
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, 1671)
2312
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, 1672)
2313
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, 1673)
2314
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, 1674)
2315
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, 1675)
2316
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, 1676)
2317
END_DECLARE_EVENT_TYPES()
2321
wxEVT_STC_STYLENEEDED,
2322
wxEVT_STC_CHARADDED,
2323
wxEVT_STC_SAVEPOINTREACHED,
2324
wxEVT_STC_SAVEPOINTLEFT,
2325
wxEVT_STC_ROMODIFYATTEMPT,
2327
wxEVT_STC_DOUBLECLICK,
2330
wxEVT_STC_MACRORECORD,
2331
wxEVT_STC_MARGINCLICK,
2332
wxEVT_STC_NEEDSHOWN,
2334
wxEVT_STC_USERLISTSELECTION,
2335
wxEVT_STC_URIDROPPED,
2336
wxEVT_STC_DWELLSTART,
2338
wxEVT_STC_START_DRAG,
2339
wxEVT_STC_DRAG_OVER,
2342
wxEVT_STC_HOTSPOT_CLICK,
2343
wxEVT_STC_HOTSPOT_DCLICK,
2344
wxEVT_STC_CALLTIP_CLICK,
2345
wxEVT_STC_AUTOCOMP_SELECTION
2352
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
2354
#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2355
#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2356
#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2357
#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2358
#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2359
#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2360
#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2361
#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2362
#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2363
#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2364
#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2365
#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2366
#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2367
#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2368
#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2369
#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2370
#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2371
#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2372
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2373
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2374
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2375
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2376
#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2377
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2378
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2379
#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
2382
//----------------------------------------------------------------------
2383
// Utility functions used within wxSTC
2388
WXDLLIMPEXP_STC wxString stc2wx(const char* str);
2389
WXDLLIMPEXP_STC wxString stc2wx(const char* str, size_t len);
2390
WXDLLIMPEXP_STC const wxWX2MBbuf wx2stc(const wxString& str);
2392
#else // not UNICODE
2394
inline wxString stc2wx(const char* str) {
2395
return wxString(str);
2397
inline wxString stc2wx(const char* str, size_t len) {
2398
return wxString(str, len);
2400
inline const wxWX2MBbuf wx2stc(const wxString& str) {
2401
return str.mbc_str();
2407
//----------------------------------------------------------------------