]> git.saurik.com Git - wxWidgets.git/blob - src/stc/stc.h.in
Add wxStyledTextCtrl::SelectNone() to the template header file too.
[wxWidgets.git] / src / stc / stc.h.in
1 ////////////////////////////////////////////////////////////////////////////
2 // Name: wx/stc/stc.h
3 // Purpose: A wxWidgets 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 licence
18 /////////////////////////////////////////////////////////////////////////////
19
20 /*
21 IMPORTANT: include/wx/stc/stc.h is generated by src/stc/gen_iface.py from
22 src/stc/stc.h.in, don't edit stc.h file as your changes will be
23 lost after the next regeneration, edit stc.h.in and rerun the
24 gen_iface.py script instead!
25
26 Parts of this file generated by the script are found in between
27 the special "{{{" and "}}}" markers, the rest of it is copied
28 verbatim from src.h.in.
29 */
30
31 #ifndef _WX_STC_STC_H_
32 #define _WX_STC_STC_H_
33
34 #include "wx/defs.h"
35
36 #if wxUSE_STC
37
38 #include "wx/control.h"
39 #include "wx/dnd.h"
40 #include "wx/stopwatch.h"
41 #include "wx/versioninfo.h"
42
43 #include "wx/textentry.h"
44 #if wxUSE_TEXTCTRL
45 #include "wx/textctrl.h"
46 #endif // wxUSE_TEXTCTRL
47
48 class WXDLLIMPEXP_FWD_CORE wxScrollBar;
49
50 // SWIG can't handle "#if" type of conditionals, only "#ifdef"
51 #ifdef SWIG
52 #define STC_USE_DND 1
53 #else
54 #if wxUSE_DRAG_AND_DROP
55 #define STC_USE_DND 1
56 #endif
57 #endif
58
59 //----------------------------------------------------------------------
60 // STC constants generated section {{{
61
62 %(VALUES)s
63
64 //}}}
65 //----------------------------------------------------------------------
66
67 //----------------------------------------------------------------------
68 // Commands that can be bound to keystrokes section {{{
69
70 %(CMDS)s
71
72 //}}}
73 //----------------------------------------------------------------------
74
75 class ScintillaWX; // forward declare
76 class WordList;
77 struct SCNotification;
78
79 #ifndef SWIG
80 extern WXDLLIMPEXP_DATA_STC(const char) wxSTCNameStr[];
81 class WXDLLIMPEXP_FWD_STC wxStyledTextCtrl;
82 class WXDLLIMPEXP_FWD_STC wxStyledTextEvent;
83 #endif
84
85 //----------------------------------------------------------------------
86
87 class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl,
88 #if wxUSE_TEXTCTRL
89 public wxTextCtrlIface
90 #else // !wxUSE_TEXTCTRL
91 public wxTextEntryBase
92 #endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL
93 {
94 public:
95
96 #ifdef SWIG
97 %%pythonAppend wxStyledTextCtrl "self._setOORInfo(self)"
98 %%pythonAppend wxStyledTextCtrl() ""
99
100 wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
101 const wxPoint& pos = wxDefaultPosition,
102 const wxSize& size = wxDefaultSize, long style = 0,
103 const wxString& name = wxPySTCNameStr);
104 %%RenameCtor(PreStyledTextCtrl, wxStyledTextCtrl());
105
106 #else
107 wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
108 const wxPoint& pos = wxDefaultPosition,
109 const wxSize& size = wxDefaultSize, long style = 0,
110 const wxString& name = wxSTCNameStr);
111 wxStyledTextCtrl() { m_swx = NULL; }
112 ~wxStyledTextCtrl();
113
114 #endif
115
116 bool Create(wxWindow *parent, wxWindowID id=wxID_ANY,
117 const wxPoint& pos = wxDefaultPosition,
118 const wxSize& size = wxDefaultSize, long style = 0,
119 const wxString& name = wxSTCNameStr);
120
121
122 //----------------------------------------------------------------------
123 // Generated method declaration section {{{
124
125 %(METHOD_DEFS)s
126
127 //}}}
128 //----------------------------------------------------------------------
129
130 // Manually declared methods
131
132 // Returns the line number of the line with the caret.
133 int GetCurrentLine();
134
135 // Extract style settings from a spec-string which is composed of one or
136 // more of the following comma separated elements:
137 //
138 // bold turns on bold
139 // italic turns on italics
140 // fore:[name or #RRGGBB] sets the foreground colour
141 // back:[name or #RRGGBB] sets the background colour
142 // face:[facename] sets the font face name to use
143 // size:[num] sets the font size in points
144 // eol turns on eol filling
145 // underline turns on underlining
146 //
147 void StyleSetSpec(int styleNum, const wxString& spec);
148
149
150 // Get the font of a style.
151 wxFont StyleGetFont(int style);
152
153
154 // Set style size, face, bold, italic, and underline attributes from
155 // a wxFont's attributes.
156 void StyleSetFont(int styleNum, wxFont& font);
157
158
159
160 // Set all font style attributes at once.
161 void StyleSetFontAttr(int styleNum, int size,
162 const wxString& faceName,
163 bool bold, bool italic,
164 bool underline,
165 wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
166
167
168 // Set the character set of the font in a style. Converts the Scintilla
169 // character set values to a wxFontEncoding.
170 void StyleSetCharacterSet(int style, int characterSet);
171
172 // Set the font encoding to be used by a style.
173 void StyleSetFontEncoding(int style, wxFontEncoding encoding);
174
175
176 // Perform one of the operations defined by the wxSTC_CMD_* constants.
177 void CmdKeyExecute(int cmd);
178
179
180 // Set the left and right margin in the edit area, measured in pixels.
181 void SetMargins(int left, int right);
182
183
184 // Retrieve the point in the window where a position is displayed.
185 wxPoint PointFromPosition(int pos);
186
187
188 // Scroll enough to make the given line visible
189 void ScrollToLine(int line);
190
191
192 // Scroll enough to make the given column visible
193 void ScrollToColumn(int column);
194
195
196 // Send a message to Scintilla
197 //
198 // NB: this method is not really const as it can modify the control but it
199 // has to be declared as such as it's called from both const and
200 // non-const methods and we can't distinguish between the two
201 wxIntPtr SendMsg(int msg, wxUIntPtr wp=0, wxIntPtr lp=0) const;
202
203
204 // Set the vertical scrollbar to use instead of the ont that's built-in.
205 void SetVScrollBar(wxScrollBar* bar);
206
207
208 // Set the horizontal scrollbar to use instead of the ont that's built-in.
209 void SetHScrollBar(wxScrollBar* bar);
210
211 // Can be used to prevent the EVT_CHAR handler from adding the char
212 bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; }
213 void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; }
214
215 // if we derive from wxTextAreaBase it already provides these methods
216 #if !wxUSE_TEXTCTRL
217 // Write the contents of the editor to filename
218 bool SaveFile(const wxString& filename);
219
220 // Load the contents of filename into the editor
221 bool LoadFile(const wxString& filename);
222 #endif // !wxUSE_TEXTCTRL
223
224 #ifdef STC_USE_DND
225 // Allow for simulating a DnD DragOver
226 wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
227
228 // Allow for simulating a DnD DropText
229 bool DoDropText(long x, long y, const wxString& data);
230 #endif
231
232 // Specify whether anti-aliased fonts should be used. Will have no effect
233 // on some platforms, but on some (wxMac for example) can greatly improve
234 // performance.
235 void SetUseAntiAliasing(bool useAA);
236
237 // Returns the current UseAntiAliasing setting.
238 bool GetUseAntiAliasing();
239
240
241
242 // The following methods are nearly equivalent to their similarly named
243 // cousins above. The difference is that these methods bypass wxString
244 // and always use a char* even if used in a unicode build of wxWidgets.
245 // In that case the character data will be utf-8 encoded since that is
246 // what is used internally by Scintilla in unicode builds.
247
248 // Add text to the document at current position.
249 void AddTextRaw(const char* text, int length=-1);
250
251 // Insert string at a position.
252 void InsertTextRaw(int pos, const char* text);
253
254 // Retrieve the text of the line containing the caret.
255 // Returns the index of the caret on the line.
256 #ifdef SWIG
257 wxCharBuffer GetCurLineRaw(int* OUTPUT);
258 #else
259 wxCharBuffer GetCurLineRaw(int* linePos=NULL);
260 #endif
261
262 // Retrieve the contents of a line.
263 wxCharBuffer GetLineRaw(int line);
264
265 // Retrieve the selected text.
266 wxCharBuffer GetSelectedTextRaw();
267
268 // Retrieve a range of text.
269 wxCharBuffer GetTextRangeRaw(int startPos, int endPos);
270
271 // Replace the contents of the document with the argument text.
272 void SetTextRaw(const char* text);
273
274 // Retrieve all the text in the document.
275 wxCharBuffer GetTextRaw();
276
277 // Append a string to the end of the document without changing the selection.
278 void AppendTextRaw(const char* text, int length=-1);
279
280 #ifdef SWIG
281 %%pythoncode "_stc_utf8_methods.py"
282 #endif
283
284
285 // implement wxTextEntryBase pure virtual methods
286 // ----------------------------------------------
287
288 virtual void WriteText(const wxString& text) { AddText(text); }
289 virtual void Remove(long from, long to)
290 {
291 Replace(from, to, "");
292 }
293 virtual void Replace(long from, long to, const wxString& text)
294 {
295 SetTargetStart(from);
296 SetTargetEnd(to);
297 ReplaceTarget(text);
298 }
299
300 /*
301 These functions are already declared in the generated section.
302
303 virtual void Copy();
304 virtual void Cut();
305 virtual void Paste();
306
307 virtual void Undo();
308 virtual void Redo();
309
310 virtual bool CanUndo() const;
311 virtual bool CanRedo() const;
312
313 */
314
315 virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); }
316 virtual long GetInsertionPoint() const { return GetCurrentPos(); }
317 virtual long GetLastPosition() const { return GetTextLength(); }
318
319 virtual void SetSelection(long from, long to)
320 {
321 if ( from == -1 && to == -1 )
322 {
323 SelectAll();
324 }
325 else
326 {
327 SetSelectionStart(from);
328 SetSelectionEnd(to);
329 }
330 }
331
332 virtual void SelectNone()
333 {
334 ClearSelections();
335 }
336
337 #ifdef SWIG
338 void GetSelection(long* OUTPUT, long* OUTPUT) const;
339 #else
340 virtual void GetSelection(long *from, long *to) const
341 {
342 if ( from )
343 *from = GetSelectionStart();
344 if ( to )
345 *to = GetSelectionEnd();
346 }
347
348 // kept for compatibility only
349 void GetSelection(int *from, int *to)
350 {
351 long f, t;
352 GetSelection(&f, &t);
353 if ( from )
354 *from = f;
355 if ( to )
356 *to = t;
357 }
358 #endif
359
360 virtual bool IsEditable() const { return !GetReadOnly(); }
361 virtual void SetEditable(bool editable) { SetReadOnly(!editable); }
362
363 // implement wxTextAreaBase pure virtual methods
364 // ---------------------------------------------
365
366 virtual int GetLineLength(long n) const { return GetLine(n).length(); }
367 virtual wxString GetLineText(long n) const { return GetLine(n); }
368 virtual int GetNumberOfLines() const { return GetLineCount(); }
369
370 virtual bool IsModified() const { return GetModify(); }
371 virtual void MarkDirty() { wxFAIL_MSG("not implemented"); }
372 virtual void DiscardEdits() { SetSavePoint(); }
373
374 virtual bool SetStyle(long WXUNUSED(start), long WXUNUSED(end),
375 const wxTextAttr& WXUNUSED(style))
376 {
377 wxFAIL_MSG("not implemented");
378
379 return false;
380 }
381
382 virtual bool GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style))
383 {
384 wxFAIL_MSG("not implemented");
385
386 return false;
387 }
388
389 virtual bool SetDefaultStyle(const wxTextAttr& WXUNUSED(style))
390 {
391 wxFAIL_MSG("not implemented");
392
393 return false;
394 }
395
396 virtual long XYToPosition(long x, long y) const
397 {
398 long pos = PositionFromLine(y);
399 pos += x;
400 return pos;
401 }
402
403 virtual bool PositionToXY(long pos, long *x, long *y) const
404 {
405 long l = LineFromPosition(pos);
406 if ( l == -1 )
407 return false;
408
409 if ( x )
410 *x = pos - PositionFromLine(l);
411
412 if ( y )
413 *y = l;
414
415 return true;
416 }
417
418 virtual void ShowPosition(long pos) { GotoPos(pos); }
419
420 // FIXME-VC6: can't use wxWindow here because of "error C2603: illegal
421 // access declaration: 'wxWindow' is not a direct base of
422 // 'wxStyledTextCtrl'" with VC6
423 using wxControl::HitTest;
424
425 virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const
426 {
427 const long l = PositionFromPoint(pt);
428 if ( l == -1 )
429 return wxTE_HT_BELOW; // we don't really know where it was
430
431 if ( pos )
432 *pos = l;
433
434 return wxTE_HT_ON_TEXT;
435 }
436
437 // just unhide it
438 virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
439 wxTextCoord *col,
440 wxTextCoord *row) const
441 {
442 return wxTextAreaBase::HitTest(pt, col, row);
443 }
444
445 static wxVersionInfo GetLibraryVersionInfo();
446
447 protected:
448 virtual wxString DoGetValue() const { return GetText(); }
449 virtual wxWindow *GetEditableWindow() { return this; }
450
451 #ifndef SWIG
452 virtual bool DoLoadFile(const wxString& file, int fileType);
453 virtual bool DoSaveFile(const wxString& file, int fileType);
454
455 // Event handlers
456 void OnPaint(wxPaintEvent& evt);
457 void OnScrollWin(wxScrollWinEvent& evt);
458 void OnScroll(wxScrollEvent& evt);
459 void OnSize(wxSizeEvent& evt);
460 void OnMouseLeftDown(wxMouseEvent& evt);
461 void OnMouseMove(wxMouseEvent& evt);
462 void OnMouseLeftUp(wxMouseEvent& evt);
463 void OnMouseRightUp(wxMouseEvent& evt);
464 void OnMouseMiddleUp(wxMouseEvent& evt);
465 void OnContextMenu(wxContextMenuEvent& evt);
466 void OnMouseWheel(wxMouseEvent& evt);
467 void OnChar(wxKeyEvent& evt);
468 void OnKeyDown(wxKeyEvent& evt);
469 void OnLoseFocus(wxFocusEvent& evt);
470 void OnGainFocus(wxFocusEvent& evt);
471 void OnSysColourChanged(wxSysColourChangedEvent& evt);
472 void OnEraseBackground(wxEraseEvent& evt);
473 void OnMenu(wxCommandEvent& evt);
474 void OnListBox(wxCommandEvent& evt);
475 void OnIdle(wxIdleEvent& evt);
476
477 virtual wxSize DoGetBestSize() const;
478
479 // Turn notifications from Scintilla into events
480 void NotifyChange();
481 void NotifyParent(SCNotification* scn);
482
483 private:
484 DECLARE_EVENT_TABLE()
485 DECLARE_DYNAMIC_CLASS(wxStyledTextCtrl)
486
487 protected:
488
489 ScintillaWX* m_swx;
490 wxStopWatch m_stopWatch;
491 wxScrollBar* m_vScrollBar;
492 wxScrollBar* m_hScrollBar;
493
494 bool m_lastKeyDownConsumed;
495
496 friend class ScintillaWX;
497 friend class Platform;
498 #endif // !SWIG
499 };
500
501 //----------------------------------------------------------------------
502
503 class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent {
504 public:
505 wxStyledTextEvent(wxEventType commandType=0, int id=0);
506 #ifndef SWIG
507 wxStyledTextEvent(const wxStyledTextEvent& event);
508 #endif
509 ~wxStyledTextEvent() {}
510
511 void SetPosition(int pos) { m_position = pos; }
512 void SetKey(int k) { m_key = k; }
513 void SetModifiers(int m) { m_modifiers = m; }
514 void SetModificationType(int t) { m_modificationType = t; }
515 void SetText(const wxString& t) { m_text = t; }
516 void SetLength(int len) { m_length = len; }
517 void SetLinesAdded(int num) { m_linesAdded = num; }
518 void SetLine(int val) { m_line = val; }
519 void SetFoldLevelNow(int val) { m_foldLevelNow = val; }
520 void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; }
521 void SetMargin(int val) { m_margin = val; }
522 void SetMessage(int val) { m_message = val; }
523 void SetWParam(int val) { m_wParam = val; }
524 void SetLParam(int val) { m_lParam = val; }
525 void SetListType(int val) { m_listType = val; }
526 void SetX(int val) { m_x = val; }
527 void SetY(int val) { m_y = val; }
528 void SetToken(int val) { m_token = val; }
529 void SetAnnotationLinesAdded(int val) { m_annotationLinesAdded = val; }
530 void SetUpdated(int val) { m_updated = val; }
531 #ifdef STC_USE_DND
532 void SetDragText(const wxString& val) { m_dragText = val; }
533 void SetDragFlags(int flags) { m_dragFlags = flags; }
534 void SetDragResult(wxDragResult val) { m_dragResult = val; }
535
536 // This method is kept mainly for backwards compatibility, use
537 // SetDragFlags() in the new code.
538 void SetDragAllowMove(bool allow)
539 {
540 if ( allow )
541 m_dragFlags |= wxDrag_AllowMove;
542 else
543 m_dragFlags &= ~(wxDrag_AllowMove | wxDrag_DefaultMove);
544 }
545 #endif
546
547 int GetPosition() const { return m_position; }
548 int GetKey() const { return m_key; }
549 int GetModifiers() const { return m_modifiers; }
550 int GetModificationType() const { return m_modificationType; }
551 wxString GetText() const { return m_text; }
552 int GetLength() const { return m_length; }
553 int GetLinesAdded() const { return m_linesAdded; }
554 int GetLine() const { return m_line; }
555 int GetFoldLevelNow() const { return m_foldLevelNow; }
556 int GetFoldLevelPrev() const { return m_foldLevelPrev; }
557 int GetMargin() const { return m_margin; }
558 int GetMessage() const { return m_message; }
559 int GetWParam() const { return m_wParam; }
560 int GetLParam() const { return m_lParam; }
561 int GetListType() const { return m_listType; }
562 int GetX() const { return m_x; }
563 int GetY() const { return m_y; }
564 int GetToken() const { return m_token; }
565 int GetAnnotationsLinesAdded() const { return m_annotationLinesAdded; }
566 int GetUpdated() const { return m_updated; }
567
568 #ifdef STC_USE_DND
569 wxString GetDragText() { return m_dragText; }
570 int GetDragFlags() { return m_dragFlags; }
571 wxDragResult GetDragResult() { return m_dragResult; }
572
573 bool GetDragAllowMove() { return (GetDragFlags() & wxDrag_AllowMove) != 0; }
574 #endif
575
576 bool GetShift() const;
577 bool GetControl() const;
578 bool GetAlt() const;
579
580 virtual wxEvent* Clone() const { return new wxStyledTextEvent(*this); }
581
582 #ifndef SWIG
583 private:
584 DECLARE_DYNAMIC_CLASS(wxStyledTextEvent)
585
586 int m_position;
587 int m_key;
588 int m_modifiers;
589
590 int m_modificationType; // wxEVT_STC_MODIFIED
591 wxString m_text;
592 int m_length;
593 int m_linesAdded;
594 int m_line;
595 int m_foldLevelNow;
596 int m_foldLevelPrev;
597
598 int m_margin; // wxEVT_STC_MARGINCLICK
599
600 int m_message; // wxEVT_STC_MACRORECORD
601 int m_wParam;
602 int m_lParam;
603
604 int m_listType;
605 int m_x;
606 int m_y;
607
608 int m_token; // wxEVT_STC__MODIFIED with SC_MOD_CONTAINER
609 int m_annotationLinesAdded; // wxEVT_STC_MODIFIED with SC_MOD_CHANGEANNOTATION
610 int m_updated; // wxEVT_STC_UPDATEUI
611
612
613 #if wxUSE_DRAG_AND_DROP
614 wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
615 int m_dragFlags; // wxEVT_STC_START_DRAG
616 wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
617 #endif
618 #endif
619 };
620
621
622
623 #ifndef SWIG
624 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, wxStyledTextEvent );
625 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, wxStyledTextEvent );
626 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, wxStyledTextEvent );
627 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent );
628 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent );
629 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent );
630 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent );
631 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, wxStyledTextEvent );
632 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, wxStyledTextEvent );
633 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, wxStyledTextEvent );
634 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, wxStyledTextEvent );
635 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, wxStyledTextEvent );
636 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, wxStyledTextEvent );
637 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, wxStyledTextEvent );
638 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent );
639 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent );
640 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, wxStyledTextEvent );
641 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, wxStyledTextEvent );
642 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, wxStyledTextEvent );
643 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, wxStyledTextEvent );
644 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, wxStyledTextEvent );
645 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, wxStyledTextEvent );
646 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEvent );
647 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEvent );
648 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, wxStyledTextEvent );
649 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, wxStyledTextEvent );
650 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_CLICK, wxStyledTextEvent );
651 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_RELEASE, wxStyledTextEvent );
652 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_CANCELLED, wxStyledTextEvent );
653 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_CHAR_DELETED, wxStyledTextEvent );
654 wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_RELEASE_CLICK, wxStyledTextEvent );
655 #else
656 enum {
657 wxEVT_STC_CHANGE,
658 wxEVT_STC_STYLENEEDED,
659 wxEVT_STC_CHARADDED,
660 wxEVT_STC_SAVEPOINTREACHED,
661 wxEVT_STC_SAVEPOINTLEFT,
662 wxEVT_STC_ROMODIFYATTEMPT,
663 wxEVT_STC_KEY,
664 wxEVT_STC_DOUBLECLICK,
665 wxEVT_STC_UPDATEUI,
666 wxEVT_STC_MODIFIED,
667 wxEVT_STC_MACRORECORD,
668 wxEVT_STC_MARGINCLICK,
669 wxEVT_STC_NEEDSHOWN,
670 wxEVT_STC_PAINTED,
671 wxEVT_STC_USERLISTSELECTION,
672 wxEVT_STC_URIDROPPED,
673 wxEVT_STC_DWELLSTART,
674 wxEVT_STC_DWELLEND,
675 wxEVT_STC_START_DRAG,
676 wxEVT_STC_DRAG_OVER,
677 wxEVT_STC_DO_DROP,
678 wxEVT_STC_ZOOM,
679 wxEVT_STC_HOTSPOT_CLICK,
680 wxEVT_STC_HOTSPOT_DCLICK,
681 wxEVT_STC_CALLTIP_CLICK,
682 wxEVT_STC_AUTOCOMP_SELECTION,
683 wxEVT_STC_INDICATOR_CLICK,
684 wxEVT_STC_INDICATOR_RELEASE,
685 wxEVT_STC_AUTOCOMP_CANCELLED,
686 wxEVT_STC_AUTOCOMP_CHAR_DELETED,
687 wxEVT_STC_HOTSPOT_RELEASE_CLICK
688 };
689 #endif
690
691
692
693 #ifndef SWIG
694 typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
695
696 #define wxStyledTextEventHandler( func ) \
697 wxEVENT_HANDLER_CAST( wxStyledTextEventFunction, func )
698
699 #define EVT_STC_CHANGE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
700 #define EVT_STC_STYLENEEDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
701 #define EVT_STC_CHARADDED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
702 #define EVT_STC_SAVEPOINTREACHED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
703 #define EVT_STC_SAVEPOINTLEFT(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
704 #define EVT_STC_ROMODIFYATTEMPT(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
705 #define EVT_STC_KEY(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
706 #define EVT_STC_DOUBLECLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
707 #define EVT_STC_UPDATEUI(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
708 #define EVT_STC_MODIFIED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
709 #define EVT_STC_MACRORECORD(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
710 #define EVT_STC_MARGINCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
711 #define EVT_STC_NEEDSHOWN(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
712 #define EVT_STC_PAINTED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
713 #define EVT_STC_USERLISTSELECTION(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
714 #define EVT_STC_URIDROPPED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
715 #define EVT_STC_DWELLSTART(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
716 #define EVT_STC_DWELLEND(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
717 #define EVT_STC_START_DRAG(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
718 #define EVT_STC_DRAG_OVER(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
719 #define EVT_STC_DO_DROP(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
720 #define EVT_STC_ZOOM(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
721 #define EVT_STC_HOTSPOT_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
722 #define EVT_STC_HOTSPOT_DCLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
723 #define EVT_STC_CALLTIP_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
724 #define EVT_STC_AUTOCOMP_SELECTION(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
725 #define EVT_STC_INDICATOR_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
726 #define EVT_STC_INDICATOR_RELEASE(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
727 #define EVT_STC_AUTOCOMP_CANCELLED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_CANCELLED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
728 #define EVT_STC_AUTOCOMP_CHAR_DELETED(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_CHAR_DELETED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
729 #define EVT_STC_HOTSPOT_RELEASE_CLICK(id, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_RELEASE_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ),
730
731 #endif
732
733 #endif // wxUSE_STC
734
735 #endif // _WX_STC_STC_H_