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