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