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