// wxTextCtrl events
// ----------------------------------------------------------------------------
-extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_UPDATED;
-extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_ENTER;
-extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_URL;
-extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_MAXLEN;
+class WXDLLIMPEXP_FWD_CORE wxTextUrlEvent;
+
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent)
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_ENTER, wxCommandEvent)
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_URL, wxTextUrlEvent)
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_MAXLEN, wxCommandEvent)
class WXDLLIMPEXP_CORE wxTextUrlEvent : public wxCommandEvent
{
public:
wxTextUrlEvent(int winid, const wxMouseEvent& evtMouse,
long start, long end)
- : wxCommandEvent(wxEVT_COMMAND_TEXT_URL, winid)
- , m_evtMouse(evtMouse), m_start(start), m_end(end)
+ : wxCommandEvent(wxEVT_COMMAND_TEXT_URL, winid),
+ m_evtMouse(evtMouse), m_start(start), m_end(end)
{ }
+ wxTextUrlEvent(const wxTextUrlEvent& event)
+ : wxCommandEvent(event),
+ m_evtMouse(event.m_evtMouse),
+ m_start(event.m_start),
+ m_end(event.m_end) { }
// get the mouse event which happend over the URL
const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; }
// get the end of the URL
long GetURLEnd() const { return m_end; }
+ virtual wxEvent *Clone() const { return new wxTextUrlEvent(*this); }
+
protected:
// the corresponding mouse event
wxMouseEvent m_evtMouse;
m_end;
private:
- DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextUrlEvent)
+ DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTextUrlEvent)
public:
// for wxWin RTTI only, don't use
#define wxTextEventHandler(func) wxCommandEventHandler(func)
#define wxTextUrlEventHandler(func) \
- (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTextUrlEventFunction, &func)
+ wxEVENT_HANDLER_CAST(wxTextUrlEventFunction, func)
#define wx__DECLARE_TEXTEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_ ## evt, id, wxTextEventHandler(fn))