]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/stc/stc.h.in
6999efae4ee851fde5a43049eee124bb71f7f698
[wxWidgets.git] / contrib / src / stc / stc.h.in
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 #include <wx/dnd.h>
26
27 #ifndef SWIG
28 #ifdef WXMAKINGDLL_STC
29 #define WXDLLIMPEXP_STC WXEXPORT
30 #elif defined(WXUSINGDLL)
31 #define WXDLLIMPEXP_STC WXIMPORT
32 #else // not making nor using DLL
33 #define WXDLLIMPEXP_STC
34 #endif
35 #endif // SWIG
36
37
38 //----------------------------------------------------------------------
39
40 // Should a wxPopupWindow be used for the call tips and autocomplete windows?
41 #ifndef wxSTC_USE_POPUP
42 #define wxSTC_USE_POPUP 1
43 #endif
44
45 //----------------------------------------------------------------------
46 // BEGIN generated section. The following code is automatically generated
47 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
48 // and regenerate
49
50 %(VALUES)s
51
52
53 //-----------------------------------------
54 // Commands that can be bound to keystrokes
55
56 %(CMDS)s
57
58
59 // END of generated section
60 //----------------------------------------------------------------------
61
62 class ScintillaWX; // forward declare
63 class WordList;
64 struct SCNotification;
65
66 #ifndef SWIG
67 extern WXDLLIMPEXP_STC const wxChar* wxSTCNameStr;
68 class WXDLLIMPEXP_STC wxStyledTextCtrl;
69 class WXDLLIMPEXP_STC wxStyledTextEvent;
70 #endif
71
72 //----------------------------------------------------------------------
73
74 #ifndef SWIG
75 class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl {
76 #else
77 class wxStyledTextCtrl : public wxControl {
78 #endif
79 public:
80
81 #ifdef SWIG
82 wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
83 const wxPoint& pos = wxDefaultPosition,
84 const wxSize& size = wxDefaultSize, long style = 0,
85 const wxString& name = wxPySTCNameStr);
86 %%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
87
88 #else
89 wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
90 const wxPoint& pos = wxDefaultPosition,
91 const wxSize& size = wxDefaultSize, long style = 0,
92 const wxString& name = wxSTCNameStr);
93 #endif
94
95
96 #ifndef SWIG
97 ~wxStyledTextCtrl();
98 #endif
99
100 //----------------------------------------------------------------------
101 // BEGIN generated section. The following code is automatically generated
102 // by gen_iface.py. Do not edit this file. Edit stc.h.in instead
103 // and regenerate
104
105 %(METHOD_DEFS)s
106
107 // END of generated section
108 //----------------------------------------------------------------------
109 // Others...
110
111
112 // Returns the line number of the line with the caret.
113 int GetCurrentLine();
114
115 // Extract style settings from a spec-string which is composed of one or
116 // more of the following comma separated elements:
117 //
118 // bold turns on bold
119 // italic turns on italics
120 // fore:#RRGGBB sets the foreground colour
121 // back:#RRGGBB sets the background colour
122 // face:[facename] sets the font face name to use
123 // size:[num] sets the font size in points
124 // eol turns on eol filling
125 // underline turns on underlining
126 //
127 void StyleSetSpec(int styleNum, const wxString& spec);
128
129
130
131 // Set style size, face, bold, italic, and underline attributes from
132 // a wxFont's attributes.
133 void StyleSetFont(int styleNum, wxFont& font);
134
135
136
137 // Set all font style attributes at once.
138 void StyleSetFontAttr(int styleNum, int size,
139 const wxString& faceName,
140 bool bold, bool italic,
141 bool underline);
142
143
144
145 // Perform one of the operations defined by the wxSTC_CMD_* constants.
146 void CmdKeyExecute(int cmd);
147
148
149
150 // Set the left and right margin in the edit area, measured in pixels.
151 void SetMargins(int left, int right);
152
153
154 // Retrieve the start and end positions of the current selection.
155 #ifdef SWIG
156 void GetSelection(int* OUTPUT, int* OUTPUT);
157 #else
158 void GetSelection(int* startPos, int* endPos);
159 #endif
160
161 // Retrieve the point in the window where a position is displayed.
162 wxPoint PointFromPosition(int pos);
163
164
165 // Scroll enough to make the given line visible
166 void ScrollToLine(int line);
167
168
169 // Scroll enough to make the given column visible
170 void ScrollToColumn(int column);
171
172
173 // Send a message to Scintilla
174 long SendMsg(int msg, long wp=0, long lp=0);
175
176
177 // Set the vertical scrollbar to use instead of the ont that's built-in.
178 void SetVScrollBar(wxScrollBar* bar) { m_vScrollBar = bar; }
179
180
181 // Set the horizontal scrollbar to use instead of the ont that's built-in.
182 void SetHScrollBar(wxScrollBar* bar) { m_hScrollBar = bar; }
183
184 // Can be used to prevent the EVT_CHAR handler from adding the char
185 bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; }
186 void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; }
187
188 // Write the contents of the editor to filename
189 bool SaveFile(const wxString& filename);
190
191 // Load the contents of filename into the editor
192 bool LoadFile(const wxString& filename);
193
194 // Allow for simulating a DnD DragOver
195 wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
196
197 // Allow for simulating a DnD DropText
198 bool DoDropText(long x, long y, const wxString& data);
199
200
201
202 //----------------------------------------------------------------------
203
204
205 #ifndef SWIG
206 private:
207 // Event handlers
208 void OnPaint(wxPaintEvent& evt);
209 void OnScrollWin(wxScrollWinEvent& evt);
210 void OnScroll(wxScrollEvent& evt);
211 void OnSize(wxSizeEvent& evt);
212 void OnMouseLeftDown(wxMouseEvent& evt);
213 void OnMouseMove(wxMouseEvent& evt);
214 void OnMouseLeftUp(wxMouseEvent& evt);
215 void OnMouseRightUp(wxMouseEvent& evt);
216 void OnMouseMiddleUp(wxMouseEvent& evt);
217 void OnContextMenu(wxContextMenuEvent& evt);
218 void OnMouseWheel(wxMouseEvent& evt);
219 void OnChar(wxKeyEvent& evt);
220 void OnKeyDown(wxKeyEvent& evt);
221 void OnLoseFocus(wxFocusEvent& evt);
222 void OnGainFocus(wxFocusEvent& evt);
223 void OnSysColourChanged(wxSysColourChangedEvent& evt);
224 void OnEraseBackground(wxEraseEvent& evt);
225 void OnMenu(wxCommandEvent& evt);
226 void OnListBox(wxCommandEvent& evt);
227
228
229 // Turn notifications from Scintilla into events
230 void NotifyChange();
231 void NotifyParent(SCNotification* scn);
232
233 DECLARE_EVENT_TABLE()
234 DECLARE_DYNAMIC_CLASS(wxStyledTextCtrl)
235
236 protected:
237
238 ScintillaWX* m_swx;
239 wxStopWatch m_stopWatch;
240 wxScrollBar* m_vScrollBar;
241 wxScrollBar* m_hScrollBar;
242
243 bool m_lastKeyDownConsumed;
244
245 friend class ScintillaWX;
246 friend class Platform;
247 #endif
248 };
249
250 //----------------------------------------------------------------------
251
252 // SWIG can't handle "#if" type of conditionals, only "#ifdef"
253 #ifdef SWIG
254 #define STC_USE_DND 1
255 #else
256 #if wxUSE_DRAG_AND_DROP
257 #define STC_USE_DND 1
258 #endif
259 #endif
260
261 #ifndef SWIG
262 class WXDLLIMPEXP_STC wxStyledTextEvent : public wxCommandEvent {
263 #else
264 class wxStyledTextEvent : public wxCommandEvent {
265 #endif
266 public:
267 wxStyledTextEvent(wxEventType commandType=0, int id=0);
268 #ifndef SWIG
269 wxStyledTextEvent(const wxStyledTextEvent& event);
270 #endif
271 ~wxStyledTextEvent() {}
272
273 void SetPosition(int pos) { m_position = pos; }
274 void SetKey(int k) { m_key = k; }
275 void SetModifiers(int m) { m_modifiers = m; }
276 void SetModificationType(int t) { m_modificationType = t; }
277 void SetText(const wxString& t) { m_text = t; }
278 void SetLength(int len) { m_length = len; }
279 void SetLinesAdded(int num) { m_linesAdded = num; }
280 void SetLine(int val) { m_line = val; }
281 void SetFoldLevelNow(int val) { m_foldLevelNow = val; }
282 void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; }
283 void SetMargin(int val) { m_margin = val; }
284 void SetMessage(int val) { m_message = val; }
285 void SetWParam(int val) { m_wParam = val; }
286 void SetLParam(int val) { m_lParam = val; }
287 void SetListType(int val) { m_listType = val; }
288 void SetX(int val) { m_x = val; }
289 void SetY(int val) { m_y = val; }
290 void SetDragText(const wxString& val) { m_dragText = val; }
291 void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
292 #ifdef STC_USE_DND
293 void SetDragResult(wxDragResult val) { m_dragResult = val; }
294 #endif
295
296 int GetPosition() const { return m_position; }
297 int GetKey() const { return m_key; }
298 int GetModifiers() const { return m_modifiers; }
299 int GetModificationType() const { return m_modificationType; }
300 wxString GetText() const { return m_text; }
301 int GetLength() const { return m_length; }
302 int GetLinesAdded() const { return m_linesAdded; }
303 int GetLine() const { return m_line; }
304 int GetFoldLevelNow() const { return m_foldLevelNow; }
305 int GetFoldLevelPrev() const { return m_foldLevelPrev; }
306 int GetMargin() const { return m_margin; }
307 int GetMessage() const { return m_message; }
308 int GetWParam() const { return m_wParam; }
309 int GetLParam() const { return m_lParam; }
310 int GetListType() const { return m_listType; }
311 int GetX() const { return m_x; }
312 int GetY() const { return m_y; }
313 wxString GetDragText() { return m_dragText; }
314 bool GetDragAllowMove() { return m_dragAllowMove; }
315 #ifdef STC_USE_DND
316 wxDragResult GetDragResult() { return m_dragResult; }
317 #endif
318
319 bool GetShift() const;
320 bool GetControl() const;
321 bool GetAlt() const;
322
323 virtual wxEvent* Clone() const { return new wxStyledTextEvent(*this); }
324
325 #ifndef SWIG
326 private:
327 DECLARE_DYNAMIC_CLASS(wxStyledTextEvent)
328
329 int m_position;
330 int m_key;
331 int m_modifiers;
332
333 int m_modificationType; // wxEVT_STC_MODIFIED
334 wxString m_text;
335 int m_length;
336 int m_linesAdded;
337 int m_line;
338 int m_foldLevelNow;
339 int m_foldLevelPrev;
340
341 int m_margin; // wxEVT_STC_MARGINCLICK
342
343 int m_message; // wxEVT_STC_MACRORECORD
344 int m_wParam;
345 int m_lParam;
346
347 int m_listType;
348 int m_x;
349 int m_y;
350
351 wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
352 bool m_dragAllowMove; // wxEVT_STC_START_DRAG
353
354 #if wxUSE_DRAG_AND_DROP
355 wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
356 #endif
357 #endif
358 };
359
360
361
362 #ifndef SWIG
363 BEGIN_DECLARE_EVENT_TYPES()
364 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, 1650)
365 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, 1651)
366 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, 1652)
367 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, 1653)
368 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, 1654)
369 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, 1655)
370 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_KEY, 1656)
371 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, 1657)
372 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, 1658)
373 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, 1659)
374 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, 1660)
375 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, 1661)
376 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, 1662)
377 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_POSCHANGED, 1663)
378 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, 1664)
379 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, 1665)
380 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, 1666)
381 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, 1667)
382 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, 1668)
383 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, 1669)
384 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, 1670)
385 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, 1671)
386 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, 1672)
387 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, 1673)
388 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, 1674)
389 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, 1675)
390 END_DECLARE_EVENT_TYPES()
391 #else
392 enum {
393 wxEVT_STC_CHANGE,
394 wxEVT_STC_STYLENEEDED,
395 wxEVT_STC_CHARADDED,
396 wxEVT_STC_SAVEPOINTREACHED,
397 wxEVT_STC_SAVEPOINTLEFT,
398 wxEVT_STC_ROMODIFYATTEMPT,
399 wxEVT_STC_KEY,
400 wxEVT_STC_DOUBLECLICK,
401 wxEVT_STC_UPDATEUI,
402 wxEVT_STC_MODIFIED,
403 wxEVT_STC_MACRORECORD,
404 wxEVT_STC_MARGINCLICK,
405 wxEVT_STC_NEEDSHOWN,
406 wxEVT_STC_POSCHANGED,
407 wxEVT_STC_PAINTED,
408 wxEVT_STC_USERLISTSELECTION,
409 wxEVT_STC_URIDROPPED,
410 wxEVT_STC_DWELLSTART,
411 wxEVT_STC_DWELLEND,
412 wxEVT_STC_START_DRAG,
413 wxEVT_STC_DRAG_OVER,
414 wxEVT_STC_DO_DROP,
415 wxEVT_STC_ZOOM,
416 wxEVT_STC_HOTSPOT_CLICK,
417 wxEVT_STC_HOTSPOT_DCLICK,
418 wxEVT_STC_CALLTIP_CLICK
419 };
420 #endif
421
422
423
424 #ifndef SWIG
425 typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
426
427 #define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
428 #define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
429 #define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
430 #define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
431 #define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
432 #define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
433 #define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
434 #define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
435 #define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
436 #define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
437 #define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
438 #define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
439 #define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
440 #define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
441 #define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
442 #define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
443 #define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
444 #define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
445 #define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
446 #define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
447 #define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
448 #define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
449 #define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
450 #define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
451 #define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
452 #define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
453
454 #endif
455
456 //----------------------------------------------------------------------
457 // Utility functions used within wxSTC
458
459 #ifndef SWIG
460
461 inline wxString stc2wx(const char* str) {
462 #if wxUSE_UNICODE
463 return wxString(str, wxConvUTF8);
464 #else
465 return wxString(str);
466 #endif
467 }
468
469 #if wxUSE_UNICODE
470 wxString stc2wx(const char* str, size_t len);
471 #else
472 inline wxString stc2wx(const char* str, size_t len) {
473 return wxString(str, len);
474 }
475 #endif
476
477
478 #if wxUSE_UNICODE
479 inline const wxWX2MBbuf wx2stc(const wxString& str) {
480 return str.mb_str(wxConvUTF8);
481 }
482 #else
483 inline const wxWX2MBbuf wx2stc(const wxString& str) {
484 return str.mbc_str();
485 }
486 #endif
487
488 #endif
489
490
491 //----------------------------------------------------------------------
492 #endif
493
494