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