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