// constants
// ----------------------------------------------------------------------------
-WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr;
+extern WXDLLEXPORT_DATA(const wxChar*) wxTextCtrlNameStr;
+
+// this is intentionally not enum to avoid warning fixes with
+// typecasting from enum type to wxTextCoord
+const wxTextCoord wxOutOfRangeTextCoord = -1;
+const wxTextCoord wxInvalidTextCoord = -2;
// ----------------------------------------------------------------------------
// wxTextCtrl style flags
// automatically detect the URLs and generate the events when mouse is
// moved/clicked over an URL
//
-// this is for Win32 richedit controls only so far
+// this is for Win32 richedit and wxGTK2 multiline controls only so far
#define wxTE_AUTO_URL 0x1000
// by default, the Windows text control doesn't show the selection when it
virtual void SetInsertionPoint(long pos) = 0;
virtual void SetInsertionPointEnd() = 0;
virtual long GetInsertionPoint() const = 0;
- virtual long GetLastPosition() const = 0;
+ virtual wxTextPos GetLastPosition() const = 0;
virtual void SetSelection(long from, long to) = 0;
virtual void SelectAll();
typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&);
-#define EVT_TEXT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_UPDATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
-#define EVT_TEXT_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_ENTER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
-#define EVT_TEXT_URL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_URL, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) wxStaticCastEvent( wxTextUrlEventFunction, & fn ), (wxObject *) NULL ),
-#define EVT_TEXT_MAXLEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_MAXLEN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, & fn ), (wxObject *) NULL ),
+#define wxTextEventHandler(func) wxCommandEventHandler(func)
+#define wxTextUrlEventHandler(func) \
+ (wxObjectEventFunction)wxStaticCastEvent(wxTextUrlEventFunction, &func)
+
+#define wx__DECLARE_TEXTEVT(evt, id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_ ## evt, id, wxTextEventHandler(fn))
+
+#define wx__DECLARE_TEXTURLEVT(evt, id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_ ## evt, id, wxTextUrlEventHandler(fn))
+
+#define EVT_TEXT(id, fn) wx__DECLARE_TEXTEVT(UPDATED, id, fn)
+#define EVT_TEXT_ENTER(id, fn) wx__DECLARE_TEXTEVT(ENTER, id, fn)
+#define EVT_TEXT_URL(id, fn) wx__DECLARE_TEXTURLEVT(URL, id, fn)
+#define EVT_TEXT_MAXLEN(id, fn) wx__DECLARE_TEXTEVT(MAXLEN, id, fn)
#ifndef NO_TEXT_WINDOW_STREAM