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