+// ----------------------------------------------------------------------------
+// wxTextCtrl events
+// ----------------------------------------------------------------------------
+
+#if !WXWIN_COMPATIBILITY_EVENT_TYPES
+
+BEGIN_DECLARE_EVENT_TYPES()
+ DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7)
+ DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8)
+ DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13)
+ DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN, 14)
+END_DECLARE_EVENT_TYPES()
+
+#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES
+
+class WXDLLEXPORT wxTextUrlEvent : public wxCommandEvent
+{
+public:
+ wxTextUrlEvent(int id, const wxMouseEvent& evtMouse,
+ long start, long end)
+ : wxCommandEvent(wxEVT_COMMAND_TEXT_URL, id),
+ m_evtMouse(evtMouse)
+ { m_start = start; m_end = end; }
+
+ // get the mouse event which happend over the URL
+ const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; }
+
+ // get the start of the URL
+ long GetURLStart() const { return m_start; }
+
+ // get the end of the URL
+ long GetURLEnd() const { return m_end; }
+
+protected:
+ // the corresponding mouse event
+ wxMouseEvent m_evtMouse;
+
+ // the start and end indices of the URL in the text control
+ long m_start,
+ m_end;
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxTextUrlEvent)
+
+public:
+ // for wxWin RTTI only, don't use
+ wxTextUrlEvent() { }
+};
+
+typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&);
+
+#define EVT_TEXT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_TEXT_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_TEXT_URL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_URL, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxTextUrlEventFunction) & fn, (wxObject *) NULL ),
+#define EVT_TEXT_MAXLEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_MAXLEN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
+
+#endif // wxUSE_TEXTCTRL
+