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