X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e0945dae5f19f51a52f0b14e14d38b1ea7ab095..4bc9acbe167e29b47763a76092931bc9a536581f:/src/stc/stc.h.in diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index f4f6710ed1..2153ed2e14 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////// -// Name: stc.h +// Name: wx/stc/stc.h // Purpose: A wxWidgets implementation of Scintilla. This class is the // one meant to be used directly by wx applications. It does not // derive directly from the Scintilla classes, and in fact there @@ -17,6 +17,17 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +/* + IMPORTANT: include/wx/stc/stc.h is generated by src/stc/gen_iface.py from + src/stc/stc.h.in, don't edit stc.h file as your changes will be + lost after the next regeneration, edit stc.h.in and rerun the + gen_iface.py script instead! + + Parts of this file generated by the script are found in between + the special "{{{" and "}}}" markers, the rest of it is copied + verbatim from src.h.in. + */ + #ifndef _WX_STC_STC_H_ #define _WX_STC_STC_H_ @@ -28,6 +39,11 @@ #include "wx/dnd.h" #include "wx/stopwatch.h" +#include "wx/textentry.h" +#if wxUSE_TEXTCTRL + #include "wx/textctrl.h" +#endif // wxUSE_TEXTCTRL + class WXDLLIMPEXP_FWD_CORE wxScrollBar; // SWIG can't handle "#if" type of conditionals, only "#ifdef" @@ -41,20 +57,19 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; //---------------------------------------------------------------------- -// BEGIN generated section. The following code is automatically generated -// by gen_iface.py. Do not edit this file. Edit stc.h.in instead -// and regenerate +// STC constants generated section {{{ %(VALUES)s +//}}} +//---------------------------------------------------------------------- -//----------------------------------------- -// Commands that can be bound to keystrokes +//---------------------------------------------------------------------- +// Commands that can be bound to keystrokes section {{{ %(CMDS)s - -// END of generated section +//}}} //---------------------------------------------------------------------- class ScintillaWX; // forward declare @@ -62,14 +77,19 @@ class WordList; struct SCNotification; #ifndef SWIG -extern WXDLLIMPEXP_STC const wxChar* wxSTCNameStr; +extern WXDLLIMPEXP_DATA_STC(const char) wxSTCNameStr[]; class WXDLLIMPEXP_FWD_STC wxStyledTextCtrl; class WXDLLIMPEXP_FWD_STC wxStyledTextEvent; #endif //---------------------------------------------------------------------- -class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl +class WXDLLIMPEXP_STC wxStyledTextCtrl : public wxControl, +#if wxUSE_TEXTCTRL + public wxTextCtrlIface +#else // !wxUSE_TEXTCTRL + public wxTextEntryBase +#endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL { public: @@ -99,17 +119,15 @@ public: const wxString& name = wxSTCNameStr); -//---------------------------------------------------------------------- -// BEGIN generated section. The following code is automatically generated -// by gen_iface.py. Do not edit this file. Edit stc.h.in instead -// and regenerate + //---------------------------------------------------------------------- + // Generated method declaration section {{{ %(METHOD_DEFS)s -// END of generated section -//---------------------------------------------------------------------- -// Others... + //}}} + //---------------------------------------------------------------------- + // Manually declared methods // Returns the line number of the line with the caret. int GetCurrentLine(); @@ -153,7 +171,7 @@ public: // Set the font encoding to be used by a style. void StyleSetFontEncoding(int style, wxFontEncoding encoding); - + // Perform one of the operations defined by the wxSTC_CMD_* constants. void CmdKeyExecute(int cmd); @@ -163,13 +181,6 @@ public: void SetMargins(int left, int right); - // Retrieve the start and end positions of the current selection. -#ifdef SWIG - void GetSelection(int* OUTPUT, int* OUTPUT); -#else - void GetSelection(int* startPos, int* endPos); -#endif - // Retrieve the point in the window where a position is displayed. wxPoint PointFromPosition(int pos); @@ -187,7 +198,7 @@ public: // NB: this method is not really const as it can modify the control but it // has to be declared as such as it's called from both const and // non-const methods and we can't distinguish between the two - long SendMsg(int msg, long wp=0, long lp=0) const; + wxIntPtr SendMsg(int msg, wxUIntPtr wp=0, wxIntPtr lp=0) const; // Set the vertical scrollbar to use instead of the ont that's built-in. @@ -201,11 +212,14 @@ public: bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; } void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; } + // if we derive from wxTextAreaBase it already provides these methods +#if !wxUSE_TEXTCTRL // Write the contents of the editor to filename bool SaveFile(const wxString& filename); // Load the contents of filename into the editor bool LoadFile(const wxString& filename); +#endif // !wxUSE_TEXTCTRL #ifdef STC_USE_DND // Allow for simulating a DnD DragOver @@ -224,13 +238,13 @@ public: bool GetUseAntiAliasing(); - + // The following methods are nearly equivallent to their similarly named // cousins above. The difference is that these methods bypass wxString // and always use a char* even if used in a unicode build of wxWidgets. // In that case the character data will be utf-8 encoded since that is // what is used internally by Scintilla in unicode builds. - + // Add text to the document at current position. void AddTextRaw(const char* text); @@ -266,11 +280,172 @@ public: #ifdef SWIG %%pythoncode "_stc_utf8_methods.py" #endif -//---------------------------------------------------------------------- -#ifndef SWIG + // implement wxTextEntryBase pure virtual methods + // ---------------------------------------------- + + virtual void WriteText(const wxString& text) { AddText(text); } + virtual void Remove(long from, long to) + { + Replace(from, to, ""); + } + virtual void Replace(long from, long to, const wxString& text) + { + SetTargetStart(from); + SetTargetEnd(to); + ReplaceTarget(text); + } + + /* + These functions are already declared in the generated section. + + virtual void Copy(); + virtual void Cut(); + virtual void Paste(); + + virtual void Undo(); + virtual void Redo(); + + virtual bool CanUndo() const; + virtual bool CanRedo() const; + + */ + + virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); } + virtual long GetInsertionPoint() const { return GetCurrentPos(); } + virtual long GetLastPosition() const { return GetTextLength(); } + + virtual void SetSelection(long from, long to) + { + if ( from == -1 && to == -1 ) + { + SelectAll(); + } + else + { + SetSelectionStart(from); + SetSelectionEnd(to); + } + } + +#ifdef SWIG + void GetSelection(long* OUTPUT, long* OUTPUT) const; +#else + virtual void GetSelection(long *from, long *to) const + { + if ( from ) + *from = GetSelectionStart(); + if ( to ) + *to = GetSelectionEnd(); + } + + // kept for compatibility only + void GetSelection(int *from, int *to) + { + long f, t; + GetSelection(&f, &t); + if ( from ) + *from = f; + if ( to ) + *to = t; + } +#endif + + virtual bool IsEditable() const { return !GetReadOnly(); } + virtual void SetEditable(bool editable) { SetReadOnly(!editable); } + + // implement wxTextAreaBase pure virtual methods + // --------------------------------------------- + + virtual int GetLineLength(long n) const { return GetLine(n).length(); } + virtual wxString GetLineText(long n) const { return GetLine(n); } + virtual int GetNumberOfLines() const { return GetLineCount(); } + + virtual bool IsModified() const { return GetModify(); } + virtual void MarkDirty() { wxFAIL_MSG("not implemented"); } + virtual void DiscardEdits() { SetSavePoint(); } + + virtual bool SetStyle(long WXUNUSED(start), long WXUNUSED(end), + const wxTextAttr& WXUNUSED(style)) + { + wxFAIL_MSG("not implemented"); + + return false; + } + + virtual bool GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style)) + { + wxFAIL_MSG("not implemented"); + + return false; + } + + virtual bool SetDefaultStyle(const wxTextAttr& WXUNUSED(style)) + { + wxFAIL_MSG("not implemented"); + + return false; + } + + virtual long XYToPosition(long x, long y) const + { + long pos = PositionFromLine(y); + pos += x; + return pos; + } + + virtual bool PositionToXY(long pos, long *x, long *y) const + { + if ( x ) + *x = -1; // TODO + + if ( y ) + { + long l = LineFromPosition(pos); + if ( l == -1 ) + return false; + *y = l; + } + + return true; + } + + virtual void ShowPosition(long pos) { GotoPos(pos); } + + // FIXME-VC6: can't use wxWindow here because of "error C2603: illegal + // access declaration: 'wxWindow' is not a direct base of + // 'wxStyledTextCtrl'" with VC6 + using wxControl::HitTest; + + virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const + { + const long l = PositionFromPoint(pt); + if ( l == -1 ) + return wxTE_HT_BELOW; // we don't really know where it was + + if ( pos ) + *pos = l; + + return wxTE_HT_ON_TEXT; + } + + // just unhide it + virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, + wxTextCoord *col, + wxTextCoord *row) const + { + return wxTextAreaBase::HitTest(pt, col, row); + } + protected: + virtual wxString DoGetValue() const { return GetText(); } + virtual wxWindow *GetEditableWindow() { return this; } + +#ifndef SWIG + virtual bool DoLoadFile(const wxString& file, int fileType); + virtual bool DoSaveFile(const wxString& file, int fileType); + // Event handlers void OnPaint(wxPaintEvent& evt); void OnScrollWin(wxScrollWinEvent& evt); @@ -312,9 +487,13 @@ protected: bool m_lastKeyDownConsumed; + // the timestamp that consists of the last wheel event + // added to the time taken to process that event. + long m_lastWheelTimestamp; + friend class ScintillaWX; friend class Platform; -#endif +#endif // !SWIG }; //---------------------------------------------------------------------- @@ -417,34 +596,34 @@ private: #ifndef SWIG -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CHANGE; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_STYLENEEDED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CHARADDED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_SAVEPOINTREACHED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_SAVEPOINTLEFT; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_ROMODIFYATTEMPT; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_KEY; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DOUBLECLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_UPDATEUI; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MODIFIED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MACRORECORD; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MARGINCLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_NEEDSHOWN; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_PAINTED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_USERLISTSELECTION; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_URIDROPPED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DWELLSTART; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DWELLEND; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_START_DRAG; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DRAG_OVER; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DO_DROP; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_ZOOM; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_HOTSPOT_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_HOTSPOT_DCLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CALLTIP_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_AUTOCOMP_SELECTION; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_RELEASE; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_CLICK, wxStyledTextEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_RELEASE, wxStyledTextEvent ); #else enum { wxEVT_STC_CHANGE, @@ -483,34 +662,37 @@ extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_RELEASE; #ifndef SWIG typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); -#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#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 ), -#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 ), -#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 ), -#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#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 ), -#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 ), -#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 ), -#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_INDICATOR_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_INDICATOR_RELEASE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define wxStyledTextEventHandler( func ) \ + wxEVENT_HANDLER_CAST( wxStyledTextEventFunction, func ) + +#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_CALLTIP_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_INDICATOR_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_INDICATOR_RELEASE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #endif