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