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