textctrl.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/textctrl.h
  3. // Purpose: wxTextAttr and wxTextCtrlBase class - the interface of wxTextCtrl
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 13.07.99
  7. // Copyright: (c) Vadim Zeitlin
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_TEXTCTRL_H_BASE_
  11. #define _WX_TEXTCTRL_H_BASE_
  12. // ----------------------------------------------------------------------------
  13. // headers
  14. // ----------------------------------------------------------------------------
  15. #include "wx/defs.h"
  16. #if wxUSE_TEXTCTRL
  17. #include "wx/control.h" // the base class
  18. #include "wx/textentry.h" // single-line text entry interface
  19. #include "wx/dynarray.h" // wxArrayInt
  20. #include "wx/gdicmn.h" // wxPoint
  21. // some compilers don't have standard compliant rdbuf() (and MSVC has it only
  22. // in its new iostream library, not in the old one used with iostream.h)
  23. #if defined(__WATCOMC__) || \
  24. ((defined(__VISUALC5__) || defined(__VISUALC6__)) && wxUSE_IOSTREAMH)
  25. #define wxHAS_TEXT_WINDOW_STREAM 0
  26. #elif wxUSE_STD_IOSTREAM
  27. #include "wx/ioswrap.h"
  28. #define wxHAS_TEXT_WINDOW_STREAM 1
  29. #else
  30. #define wxHAS_TEXT_WINDOW_STREAM 0
  31. #endif
  32. class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
  33. class WXDLLIMPEXP_FWD_CORE wxTextCtrlBase;
  34. // ----------------------------------------------------------------------------
  35. // wxTextCtrl types
  36. // ----------------------------------------------------------------------------
  37. // wxTextCoord is the line or row number (which should have been unsigned but
  38. // is long for backwards compatibility)
  39. typedef long wxTextCoord;
  40. // ----------------------------------------------------------------------------
  41. // constants
  42. // ----------------------------------------------------------------------------
  43. extern WXDLLIMPEXP_DATA_CORE(const char) wxTextCtrlNameStr[];
  44. // this is intentionally not enum to avoid warning fixes with
  45. // typecasting from enum type to wxTextCoord
  46. const wxTextCoord wxOutOfRangeTextCoord = -1;
  47. const wxTextCoord wxInvalidTextCoord = -2;
  48. // ----------------------------------------------------------------------------
  49. // wxTextCtrl style flags
  50. // ----------------------------------------------------------------------------
  51. #define wxTE_NO_VSCROLL 0x0002
  52. #define wxTE_READONLY 0x0010
  53. #define wxTE_MULTILINE 0x0020
  54. #define wxTE_PROCESS_TAB 0x0040
  55. // alignment flags
  56. #define wxTE_LEFT 0x0000 // 0x0000
  57. #define wxTE_CENTER wxALIGN_CENTER_HORIZONTAL // 0x0100
  58. #define wxTE_RIGHT wxALIGN_RIGHT // 0x0200
  59. #define wxTE_CENTRE wxTE_CENTER
  60. // this style means to use RICHEDIT control and does something only under wxMSW
  61. // and Win32 and is silently ignored under all other platforms
  62. #define wxTE_RICH 0x0080
  63. #define wxTE_PROCESS_ENTER 0x0400
  64. #define wxTE_PASSWORD 0x0800
  65. // automatically detect the URLs and generate the events when mouse is
  66. // moved/clicked over an URL
  67. //
  68. // this is for Win32 richedit and wxGTK2 multiline controls only so far
  69. #define wxTE_AUTO_URL 0x1000
  70. // by default, the Windows text control doesn't show the selection when it
  71. // doesn't have focus - use this style to force it to always show it
  72. #define wxTE_NOHIDESEL 0x2000
  73. // use wxHSCROLL to not wrap text at all, wxTE_CHARWRAP to wrap it at any
  74. // position and wxTE_WORDWRAP to wrap at words boundary
  75. //
  76. // if no wrapping style is given at all, the control wraps at word boundary
  77. #define wxTE_DONTWRAP wxHSCROLL
  78. #define wxTE_CHARWRAP 0x4000 // wrap at any position
  79. #define wxTE_WORDWRAP 0x0001 // wrap only at words boundaries
  80. #define wxTE_BESTWRAP 0x0000 // this is the default
  81. #if WXWIN_COMPATIBILITY_2_6
  82. // obsolete synonym
  83. #define wxTE_LINEWRAP wxTE_CHARWRAP
  84. #endif // WXWIN_COMPATIBILITY_2_6
  85. #if WXWIN_COMPATIBILITY_2_8
  86. // this style is (or at least should be) on by default now, don't use it
  87. #define wxTE_AUTO_SCROLL 0
  88. #endif // WXWIN_COMPATIBILITY_2_8
  89. // force using RichEdit version 2.0 or 3.0 instead of 1.0 (default) for
  90. // wxTE_RICH controls - can be used together with or instead of wxTE_RICH
  91. #define wxTE_RICH2 0x8000
  92. // reuse wxTE_RICH2's value for CAPEDIT control on Windows CE
  93. #if defined(__SMARTPHONE__) || defined(__POCKETPC__)
  94. #define wxTE_CAPITALIZE wxTE_RICH2
  95. #else
  96. #define wxTE_CAPITALIZE 0
  97. #endif
  98. // ----------------------------------------------------------------------------
  99. // wxTextCtrl file types
  100. // ----------------------------------------------------------------------------
  101. #define wxTEXT_TYPE_ANY 0
  102. // ----------------------------------------------------------------------------
  103. // wxTextCtrl::HitTest return values
  104. // ----------------------------------------------------------------------------
  105. // the point asked is ...
  106. enum wxTextCtrlHitTestResult
  107. {
  108. wxTE_HT_UNKNOWN = -2, // this means HitTest() is simply not implemented
  109. wxTE_HT_BEFORE, // either to the left or upper
  110. wxTE_HT_ON_TEXT, // directly on
  111. wxTE_HT_BELOW, // below [the last line]
  112. wxTE_HT_BEYOND // after [the end of line]
  113. };
  114. // ... the character returned
  115. // ----------------------------------------------------------------------------
  116. // Types for wxTextAttr
  117. // ----------------------------------------------------------------------------
  118. // Alignment
  119. enum wxTextAttrAlignment
  120. {
  121. wxTEXT_ALIGNMENT_DEFAULT,
  122. wxTEXT_ALIGNMENT_LEFT,
  123. wxTEXT_ALIGNMENT_CENTRE,
  124. wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
  125. wxTEXT_ALIGNMENT_RIGHT,
  126. wxTEXT_ALIGNMENT_JUSTIFIED
  127. };
  128. // Flags to indicate which attributes are being applied
  129. enum wxTextAttrFlags
  130. {
  131. wxTEXT_ATTR_TEXT_COLOUR = 0x00000001,
  132. wxTEXT_ATTR_BACKGROUND_COLOUR = 0x00000002,
  133. wxTEXT_ATTR_FONT_FACE = 0x00000004,
  134. wxTEXT_ATTR_FONT_POINT_SIZE = 0x00000008,
  135. wxTEXT_ATTR_FONT_PIXEL_SIZE = 0x10000000,
  136. wxTEXT_ATTR_FONT_WEIGHT = 0x00000010,
  137. wxTEXT_ATTR_FONT_ITALIC = 0x00000020,
  138. wxTEXT_ATTR_FONT_UNDERLINE = 0x00000040,
  139. wxTEXT_ATTR_FONT_STRIKETHROUGH = 0x08000000,
  140. wxTEXT_ATTR_FONT_ENCODING = 0x02000000,
  141. wxTEXT_ATTR_FONT_FAMILY = 0x04000000,
  142. wxTEXT_ATTR_FONT_SIZE = \
  143. ( wxTEXT_ATTR_FONT_POINT_SIZE | wxTEXT_ATTR_FONT_PIXEL_SIZE ),
  144. wxTEXT_ATTR_FONT = \
  145. ( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
  146. wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_STRIKETHROUGH | wxTEXT_ATTR_FONT_ENCODING | wxTEXT_ATTR_FONT_FAMILY ),
  147. wxTEXT_ATTR_ALIGNMENT = 0x00000080,
  148. wxTEXT_ATTR_LEFT_INDENT = 0x00000100,
  149. wxTEXT_ATTR_RIGHT_INDENT = 0x00000200,
  150. wxTEXT_ATTR_TABS = 0x00000400,
  151. wxTEXT_ATTR_PARA_SPACING_AFTER = 0x00000800,
  152. wxTEXT_ATTR_PARA_SPACING_BEFORE = 0x00001000,
  153. wxTEXT_ATTR_LINE_SPACING = 0x00002000,
  154. wxTEXT_ATTR_CHARACTER_STYLE_NAME = 0x00004000,
  155. wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000,
  156. wxTEXT_ATTR_LIST_STYLE_NAME = 0x00010000,
  157. wxTEXT_ATTR_BULLET_STYLE = 0x00020000,
  158. wxTEXT_ATTR_BULLET_NUMBER = 0x00040000,
  159. wxTEXT_ATTR_BULLET_TEXT = 0x00080000,
  160. wxTEXT_ATTR_BULLET_NAME = 0x00100000,
  161. wxTEXT_ATTR_BULLET = \
  162. ( wxTEXT_ATTR_BULLET_STYLE | wxTEXT_ATTR_BULLET_NUMBER | wxTEXT_ATTR_BULLET_TEXT | \
  163. wxTEXT_ATTR_BULLET_NAME ),
  164. wxTEXT_ATTR_URL = 0x00200000,
  165. wxTEXT_ATTR_PAGE_BREAK = 0x00400000,
  166. wxTEXT_ATTR_EFFECTS = 0x00800000,
  167. wxTEXT_ATTR_OUTLINE_LEVEL = 0x01000000,
  168. /*!
  169. * Character and paragraph combined styles
  170. */
  171. wxTEXT_ATTR_CHARACTER = \
  172. (wxTEXT_ATTR_FONT|wxTEXT_ATTR_EFFECTS| \
  173. wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL),
  174. wxTEXT_ATTR_PARAGRAPH = \
  175. (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
  176. wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
  177. wxTEXT_ATTR_BULLET|wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL|wxTEXT_ATTR_PAGE_BREAK),
  178. wxTEXT_ATTR_ALL = (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH)
  179. };
  180. /*!
  181. * Styles for wxTextAttr::SetBulletStyle
  182. */
  183. enum wxTextAttrBulletStyle
  184. {
  185. wxTEXT_ATTR_BULLET_STYLE_NONE = 0x00000000,
  186. wxTEXT_ATTR_BULLET_STYLE_ARABIC = 0x00000001,
  187. wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER = 0x00000002,
  188. wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER = 0x00000004,
  189. wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER = 0x00000008,
  190. wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER = 0x00000010,
  191. wxTEXT_ATTR_BULLET_STYLE_SYMBOL = 0x00000020,
  192. wxTEXT_ATTR_BULLET_STYLE_BITMAP = 0x00000040,
  193. wxTEXT_ATTR_BULLET_STYLE_PARENTHESES = 0x00000080,
  194. wxTEXT_ATTR_BULLET_STYLE_PERIOD = 0x00000100,
  195. wxTEXT_ATTR_BULLET_STYLE_STANDARD = 0x00000200,
  196. wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS = 0x00000400,
  197. wxTEXT_ATTR_BULLET_STYLE_OUTLINE = 0x00000800,
  198. wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT = 0x00000000,
  199. wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT = 0x00001000,
  200. wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE = 0x00002000,
  201. wxTEXT_ATTR_BULLET_STYLE_CONTINUATION = 0x00004000
  202. };
  203. /*!
  204. * Styles for wxTextAttr::SetTextEffects
  205. */
  206. enum wxTextAttrEffects
  207. {
  208. wxTEXT_ATTR_EFFECT_NONE = 0x00000000,
  209. wxTEXT_ATTR_EFFECT_CAPITALS = 0x00000001,
  210. wxTEXT_ATTR_EFFECT_SMALL_CAPITALS = 0x00000002,
  211. wxTEXT_ATTR_EFFECT_STRIKETHROUGH = 0x00000004,
  212. wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH = 0x00000008,
  213. wxTEXT_ATTR_EFFECT_SHADOW = 0x00000010,
  214. wxTEXT_ATTR_EFFECT_EMBOSS = 0x00000020,
  215. wxTEXT_ATTR_EFFECT_OUTLINE = 0x00000040,
  216. wxTEXT_ATTR_EFFECT_ENGRAVE = 0x00000080,
  217. wxTEXT_ATTR_EFFECT_SUPERSCRIPT = 0x00000100,
  218. wxTEXT_ATTR_EFFECT_SUBSCRIPT = 0x00000200
  219. };
  220. /*!
  221. * Line spacing values
  222. */
  223. enum wxTextAttrLineSpacing
  224. {
  225. wxTEXT_ATTR_LINE_SPACING_NORMAL = 10,
  226. wxTEXT_ATTR_LINE_SPACING_HALF = 15,
  227. wxTEXT_ATTR_LINE_SPACING_TWICE = 20
  228. };
  229. // ----------------------------------------------------------------------------
  230. // wxTextAttr: a structure containing the visual attributes of a text
  231. // ----------------------------------------------------------------------------
  232. class WXDLLIMPEXP_CORE wxTextAttr
  233. {
  234. public:
  235. // ctors
  236. wxTextAttr() { Init(); }
  237. wxTextAttr(const wxTextAttr& attr) { Init(); Copy(attr); }
  238. wxTextAttr(const wxColour& colText,
  239. const wxColour& colBack = wxNullColour,
  240. const wxFont& font = wxNullFont,
  241. wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT);
  242. // Initialise this object.
  243. void Init();
  244. // Copy
  245. void Copy(const wxTextAttr& attr);
  246. // Assignment
  247. void operator= (const wxTextAttr& attr);
  248. // Equality test
  249. bool operator== (const wxTextAttr& attr) const;
  250. // Partial equality test. If @a weakTest is @true, attributes of this object do not
  251. // have to be present if those attributes of @a attr are present. If @a weakTest is
  252. // @false, the function will fail if an attribute is present in @a attr but not
  253. // in this object.
  254. bool EqPartial(const wxTextAttr& attr, bool weakTest = true) const;
  255. // Get attributes from font.
  256. bool GetFontAttributes(const wxFont& font, int flags = wxTEXT_ATTR_FONT);
  257. // setters
  258. void SetTextColour(const wxColour& colText) { m_colText = colText; m_flags |= wxTEXT_ATTR_TEXT_COLOUR; }
  259. void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; }
  260. void SetAlignment(wxTextAttrAlignment alignment) { m_textAlignment = alignment; m_flags |= wxTEXT_ATTR_ALIGNMENT; }
  261. void SetTabs(const wxArrayInt& tabs) { m_tabs = tabs; m_flags |= wxTEXT_ATTR_TABS; }
  262. void SetLeftIndent(int indent, int subIndent = 0) { m_leftIndent = indent; m_leftSubIndent = subIndent; m_flags |= wxTEXT_ATTR_LEFT_INDENT; }
  263. void SetRightIndent(int indent) { m_rightIndent = indent; m_flags |= wxTEXT_ATTR_RIGHT_INDENT; }
  264. void SetFontSize(int pointSize) { m_fontSize = pointSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_POINT_SIZE; }
  265. void SetFontPointSize(int pointSize) { m_fontSize = pointSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_POINT_SIZE; }
  266. void SetFontPixelSize(int pixelSize) { m_fontSize = pixelSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_PIXEL_SIZE; }
  267. void SetFontStyle(wxFontStyle fontStyle) { m_fontStyle = fontStyle; m_flags |= wxTEXT_ATTR_FONT_ITALIC; }
  268. void SetFontWeight(wxFontWeight fontWeight) { m_fontWeight = fontWeight; m_flags |= wxTEXT_ATTR_FONT_WEIGHT; }
  269. void SetFontFaceName(const wxString& faceName) { m_fontFaceName = faceName; m_flags |= wxTEXT_ATTR_FONT_FACE; }
  270. void SetFontUnderlined(bool underlined) { m_fontUnderlined = underlined; m_flags |= wxTEXT_ATTR_FONT_UNDERLINE; }
  271. void SetFontStrikethrough(bool strikethrough) { m_fontStrikethrough = strikethrough; m_flags |= wxTEXT_ATTR_FONT_STRIKETHROUGH; }
  272. void SetFontEncoding(wxFontEncoding encoding) { m_fontEncoding = encoding; m_flags |= wxTEXT_ATTR_FONT_ENCODING; }
  273. void SetFontFamily(wxFontFamily family) { m_fontFamily = family; m_flags |= wxTEXT_ATTR_FONT_FAMILY; }
  274. // Set font
  275. void SetFont(const wxFont& font, int flags = (wxTEXT_ATTR_FONT & ~wxTEXT_ATTR_FONT_PIXEL_SIZE)) { GetFontAttributes(font, flags); }
  276. void SetFlags(long flags) { m_flags = flags; }
  277. void SetCharacterStyleName(const wxString& name) { m_characterStyleName = name; m_flags |= wxTEXT_ATTR_CHARACTER_STYLE_NAME; }
  278. void SetParagraphStyleName(const wxString& name) { m_paragraphStyleName = name; m_flags |= wxTEXT_ATTR_PARAGRAPH_STYLE_NAME; }
  279. void SetListStyleName(const wxString& name) { m_listStyleName = name; SetFlags(GetFlags() | wxTEXT_ATTR_LIST_STYLE_NAME); }
  280. void SetParagraphSpacingAfter(int spacing) { m_paragraphSpacingAfter = spacing; m_flags |= wxTEXT_ATTR_PARA_SPACING_AFTER; }
  281. void SetParagraphSpacingBefore(int spacing) { m_paragraphSpacingBefore = spacing; m_flags |= wxTEXT_ATTR_PARA_SPACING_BEFORE; }
  282. void SetLineSpacing(int spacing) { m_lineSpacing = spacing; m_flags |= wxTEXT_ATTR_LINE_SPACING; }
  283. void SetBulletStyle(int style) { m_bulletStyle = style; m_flags |= wxTEXT_ATTR_BULLET_STYLE; }
  284. void SetBulletNumber(int n) { m_bulletNumber = n; m_flags |= wxTEXT_ATTR_BULLET_NUMBER; }
  285. void SetBulletText(const wxString& text) { m_bulletText = text; m_flags |= wxTEXT_ATTR_BULLET_TEXT; }
  286. void SetBulletFont(const wxString& bulletFont) { m_bulletFont = bulletFont; }
  287. void SetBulletName(const wxString& name) { m_bulletName = name; m_flags |= wxTEXT_ATTR_BULLET_NAME; }
  288. void SetURL(const wxString& url) { m_urlTarget = url; m_flags |= wxTEXT_ATTR_URL; }
  289. void SetPageBreak(bool pageBreak = true) { SetFlags(pageBreak ? (GetFlags() | wxTEXT_ATTR_PAGE_BREAK) : (GetFlags() & ~wxTEXT_ATTR_PAGE_BREAK)); }
  290. void SetTextEffects(int effects) { m_textEffects = effects; SetFlags(GetFlags() | wxTEXT_ATTR_EFFECTS); }
  291. void SetTextEffectFlags(int effects) { m_textEffectFlags = effects; }
  292. void SetOutlineLevel(int level) { m_outlineLevel = level; SetFlags(GetFlags() | wxTEXT_ATTR_OUTLINE_LEVEL); }
  293. const wxColour& GetTextColour() const { return m_colText; }
  294. const wxColour& GetBackgroundColour() const { return m_colBack; }
  295. wxTextAttrAlignment GetAlignment() const { return m_textAlignment; }
  296. const wxArrayInt& GetTabs() const { return m_tabs; }
  297. long GetLeftIndent() const { return m_leftIndent; }
  298. long GetLeftSubIndent() const { return m_leftSubIndent; }
  299. long GetRightIndent() const { return m_rightIndent; }
  300. long GetFlags() const { return m_flags; }
  301. int GetFontSize() const { return m_fontSize; }
  302. wxFontStyle GetFontStyle() const { return m_fontStyle; }
  303. wxFontWeight GetFontWeight() const { return m_fontWeight; }
  304. bool GetFontUnderlined() const { return m_fontUnderlined; }
  305. bool GetFontStrikethrough() const { return m_fontStrikethrough; }
  306. const wxString& GetFontFaceName() const { return m_fontFaceName; }
  307. wxFontEncoding GetFontEncoding() const { return m_fontEncoding; }
  308. wxFontFamily GetFontFamily() const { return m_fontFamily; }
  309. wxFont GetFont() const;
  310. const wxString& GetCharacterStyleName() const { return m_characterStyleName; }
  311. const wxString& GetParagraphStyleName() const { return m_paragraphStyleName; }
  312. const wxString& GetListStyleName() const { return m_listStyleName; }
  313. int GetParagraphSpacingAfter() const { return m_paragraphSpacingAfter; }
  314. int GetParagraphSpacingBefore() const { return m_paragraphSpacingBefore; }
  315. int GetLineSpacing() const { return m_lineSpacing; }
  316. int GetBulletStyle() const { return m_bulletStyle; }
  317. int GetBulletNumber() const { return m_bulletNumber; }
  318. const wxString& GetBulletText() const { return m_bulletText; }
  319. const wxString& GetBulletFont() const { return m_bulletFont; }
  320. const wxString& GetBulletName() const { return m_bulletName; }
  321. const wxString& GetURL() const { return m_urlTarget; }
  322. int GetTextEffects() const { return m_textEffects; }
  323. int GetTextEffectFlags() const { return m_textEffectFlags; }
  324. int GetOutlineLevel() const { return m_outlineLevel; }
  325. // accessors
  326. bool HasTextColour() const { return m_colText.IsOk() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; }
  327. bool HasBackgroundColour() const { return m_colBack.IsOk() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; }
  328. bool HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && HasFlag(wxTEXT_ATTR_ALIGNMENT) ; }
  329. bool HasTabs() const { return HasFlag(wxTEXT_ATTR_TABS) ; }
  330. bool HasLeftIndent() const { return HasFlag(wxTEXT_ATTR_LEFT_INDENT); }
  331. bool HasRightIndent() const { return HasFlag(wxTEXT_ATTR_RIGHT_INDENT); }
  332. bool HasFontWeight() const { return HasFlag(wxTEXT_ATTR_FONT_WEIGHT); }
  333. bool HasFontSize() const { return HasFlag(wxTEXT_ATTR_FONT_SIZE); }
  334. bool HasFontPointSize() const { return HasFlag(wxTEXT_ATTR_FONT_POINT_SIZE); }
  335. bool HasFontPixelSize() const { return HasFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE); }
  336. bool HasFontItalic() const { return HasFlag(wxTEXT_ATTR_FONT_ITALIC); }
  337. bool HasFontUnderlined() const { return HasFlag(wxTEXT_ATTR_FONT_UNDERLINE); }
  338. bool HasFontStrikethrough() const { return HasFlag(wxTEXT_ATTR_FONT_STRIKETHROUGH); }
  339. bool HasFontFaceName() const { return HasFlag(wxTEXT_ATTR_FONT_FACE); }
  340. bool HasFontEncoding() const { return HasFlag(wxTEXT_ATTR_FONT_ENCODING); }
  341. bool HasFontFamily() const { return HasFlag(wxTEXT_ATTR_FONT_FAMILY); }
  342. bool HasFont() const { return HasFlag(wxTEXT_ATTR_FONT); }
  343. bool HasParagraphSpacingAfter() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_AFTER); }
  344. bool HasParagraphSpacingBefore() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_BEFORE); }
  345. bool HasLineSpacing() const { return HasFlag(wxTEXT_ATTR_LINE_SPACING); }
  346. bool HasCharacterStyleName() const { return HasFlag(wxTEXT_ATTR_CHARACTER_STYLE_NAME) && !m_characterStyleName.IsEmpty(); }
  347. bool HasParagraphStyleName() const { return HasFlag(wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) && !m_paragraphStyleName.IsEmpty(); }
  348. bool HasListStyleName() const { return HasFlag(wxTEXT_ATTR_LIST_STYLE_NAME) || !m_listStyleName.IsEmpty(); }
  349. bool HasBulletStyle() const { return HasFlag(wxTEXT_ATTR_BULLET_STYLE); }
  350. bool HasBulletNumber() const { return HasFlag(wxTEXT_ATTR_BULLET_NUMBER); }
  351. bool HasBulletText() const { return HasFlag(wxTEXT_ATTR_BULLET_TEXT); }
  352. bool HasBulletName() const { return HasFlag(wxTEXT_ATTR_BULLET_NAME); }
  353. bool HasURL() const { return HasFlag(wxTEXT_ATTR_URL); }
  354. bool HasPageBreak() const { return HasFlag(wxTEXT_ATTR_PAGE_BREAK); }
  355. bool HasTextEffects() const { return HasFlag(wxTEXT_ATTR_EFFECTS); }
  356. bool HasTextEffect(int effect) const { return HasFlag(wxTEXT_ATTR_EFFECTS) && ((GetTextEffectFlags() & effect) != 0); }
  357. bool HasOutlineLevel() const { return HasFlag(wxTEXT_ATTR_OUTLINE_LEVEL); }
  358. bool HasFlag(long flag) const { return (m_flags & flag) != 0; }
  359. void RemoveFlag(long flag) { m_flags &= ~flag; }
  360. void AddFlag(long flag) { m_flags |= flag; }
  361. // Is this a character style?
  362. bool IsCharacterStyle() const { return HasFlag(wxTEXT_ATTR_CHARACTER); }
  363. bool IsParagraphStyle() const { return HasFlag(wxTEXT_ATTR_PARAGRAPH); }
  364. // returns false if we have any attributes set, true otherwise
  365. bool IsDefault() const
  366. {
  367. return GetFlags() == 0;
  368. }
  369. // Merges the given attributes. If compareWith
  370. // is non-NULL, then it will be used to mask out those attributes that are the same in style
  371. // and compareWith, for situations where we don't want to explicitly set inherited attributes.
  372. bool Apply(const wxTextAttr& style, const wxTextAttr* compareWith = NULL);
  373. // merges the attributes of the base and the overlay objects and returns
  374. // the result; the parameter attributes take precedence
  375. //
  376. // WARNING: the order of arguments is the opposite of Combine()
  377. static wxTextAttr Merge(const wxTextAttr& base, const wxTextAttr& overlay)
  378. {
  379. return Combine(overlay, base, NULL);
  380. }
  381. // merges the attributes of this object and overlay
  382. void Merge(const wxTextAttr& overlay)
  383. {
  384. *this = Merge(*this, overlay);
  385. }
  386. // return the attribute having the valid font and colours: it uses the
  387. // attributes set in attr and falls back first to attrDefault and then to
  388. // the text control font/colours for those attributes which are not set
  389. static wxTextAttr Combine(const wxTextAttr& attr,
  390. const wxTextAttr& attrDef,
  391. const wxTextCtrlBase *text);
  392. // Compare tabs
  393. static bool TabsEq(const wxArrayInt& tabs1, const wxArrayInt& tabs2);
  394. // Remove attributes
  395. static bool RemoveStyle(wxTextAttr& destStyle, const wxTextAttr& style);
  396. // Combine two bitlists, specifying the bits of interest with separate flags.
  397. static bool CombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB);
  398. // Compare two bitlists
  399. static bool BitlistsEqPartial(int valueA, int valueB, int flags);
  400. // Split into paragraph and character styles
  401. static bool SplitParaCharStyles(const wxTextAttr& style, wxTextAttr& parStyle, wxTextAttr& charStyle);
  402. private:
  403. long m_flags;
  404. // Paragraph styles
  405. wxArrayInt m_tabs; // array of int: tab stops in 1/10 mm
  406. int m_leftIndent; // left indent in 1/10 mm
  407. int m_leftSubIndent; // left indent for all but the first
  408. // line in a paragraph relative to the
  409. // first line, in 1/10 mm
  410. int m_rightIndent; // right indent in 1/10 mm
  411. wxTextAttrAlignment m_textAlignment;
  412. int m_paragraphSpacingAfter;
  413. int m_paragraphSpacingBefore;
  414. int m_lineSpacing;
  415. int m_bulletStyle;
  416. int m_bulletNumber;
  417. int m_textEffects;
  418. int m_textEffectFlags;
  419. int m_outlineLevel;
  420. wxString m_bulletText;
  421. wxString m_bulletFont;
  422. wxString m_bulletName;
  423. wxString m_urlTarget;
  424. wxFontEncoding m_fontEncoding;
  425. // Character styles
  426. wxColour m_colText,
  427. m_colBack;
  428. int m_fontSize;
  429. wxFontStyle m_fontStyle;
  430. wxFontWeight m_fontWeight;
  431. wxFontFamily m_fontFamily;
  432. bool m_fontUnderlined;
  433. bool m_fontStrikethrough;
  434. wxString m_fontFaceName;
  435. // Character style
  436. wxString m_characterStyleName;
  437. // Paragraph style
  438. wxString m_paragraphStyleName;
  439. // List style
  440. wxString m_listStyleName;
  441. };
  442. // ----------------------------------------------------------------------------
  443. // wxTextAreaBase: multiline text control specific methods
  444. // ----------------------------------------------------------------------------
  445. class WXDLLIMPEXP_CORE wxTextAreaBase
  446. {
  447. public:
  448. wxTextAreaBase() { }
  449. virtual ~wxTextAreaBase() { }
  450. // lines access
  451. // ------------
  452. virtual int GetLineLength(long lineNo) const = 0;
  453. virtual wxString GetLineText(long lineNo) const = 0;
  454. virtual int GetNumberOfLines() const = 0;
  455. // file IO
  456. // -------
  457. bool LoadFile(const wxString& file, int fileType = wxTEXT_TYPE_ANY)
  458. { return DoLoadFile(file, fileType); }
  459. bool SaveFile(const wxString& file = wxEmptyString,
  460. int fileType = wxTEXT_TYPE_ANY);
  461. // dirty flag handling
  462. // -------------------
  463. virtual bool IsModified() const = 0;
  464. virtual void MarkDirty() = 0;
  465. virtual void DiscardEdits() = 0;
  466. void SetModified(bool modified)
  467. {
  468. if ( modified )
  469. MarkDirty();
  470. else
  471. DiscardEdits();
  472. }
  473. // styles handling
  474. // ---------------
  475. // text control under some platforms supports the text styles: these
  476. // methods allow to apply the given text style to the given selection or to
  477. // set/get the style which will be used for all appended text
  478. virtual bool SetStyle(long start, long end, const wxTextAttr& style) = 0;
  479. virtual bool GetStyle(long position, wxTextAttr& style) = 0;
  480. virtual bool SetDefaultStyle(const wxTextAttr& style) = 0;
  481. virtual const wxTextAttr& GetDefaultStyle() const { return m_defaultStyle; }
  482. // coordinates translation
  483. // -----------------------
  484. // translate between the position (which is just an index in the text ctrl
  485. // considering all its contents as a single strings) and (x, y) coordinates
  486. // which represent column and line.
  487. virtual long XYToPosition(long x, long y) const = 0;
  488. virtual bool PositionToXY(long pos, long *x, long *y) const = 0;
  489. // translate the given position (which is just an index in the text control)
  490. // to client coordinates
  491. wxPoint PositionToCoords(long pos) const;
  492. virtual void ShowPosition(long pos) = 0;
  493. // find the character at position given in pixels
  494. //
  495. // NB: pt is in device coords (not adjusted for the client area origin nor
  496. // scrolling)
  497. virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const;
  498. virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
  499. wxTextCoord *col,
  500. wxTextCoord *row) const;
  501. virtual wxString GetValue() const = 0;
  502. virtual void SetValue(const wxString& value) = 0;
  503. protected:
  504. // implementation of loading/saving
  505. virtual bool DoLoadFile(const wxString& file, int fileType);
  506. virtual bool DoSaveFile(const wxString& file, int fileType);
  507. // Return true if the given position is valid, i.e. positive and less than
  508. // the last position.
  509. virtual bool IsValidPosition(long pos) const = 0;
  510. // Default stub implementation of PositionToCoords() always returns
  511. // wxDefaultPosition.
  512. virtual wxPoint DoPositionToCoords(long pos) const;
  513. // the name of the last file loaded with LoadFile() which will be used by
  514. // SaveFile() by default
  515. wxString m_filename;
  516. // the text style which will be used for any new text added to the control
  517. wxTextAttr m_defaultStyle;
  518. wxDECLARE_NO_COPY_CLASS(wxTextAreaBase);
  519. };
  520. // this class defines wxTextCtrl interface, wxTextCtrlBase actually implements
  521. // too much things because it derives from wxTextEntry and not wxTextEntryBase
  522. // and so any classes which "look like" wxTextCtrl (such as wxRichTextCtrl)
  523. // but don't need the (native) implementation bits from wxTextEntry should
  524. // actually derive from this one and not wxTextCtrlBase
  525. class WXDLLIMPEXP_CORE wxTextCtrlIface : public wxTextAreaBase,
  526. public wxTextEntryBase
  527. {
  528. public:
  529. wxTextCtrlIface() { }
  530. // wxTextAreaBase overrides
  531. virtual wxString GetValue() const
  532. {
  533. return wxTextEntryBase::GetValue();
  534. }
  535. virtual void SetValue(const wxString& value)
  536. {
  537. wxTextEntryBase::SetValue(value);
  538. }
  539. protected:
  540. virtual bool IsValidPosition(long pos) const
  541. {
  542. return pos >= 0 && pos <= GetLastPosition();
  543. }
  544. private:
  545. wxDECLARE_NO_COPY_CLASS(wxTextCtrlIface);
  546. };
  547. // ----------------------------------------------------------------------------
  548. // wxTextCtrl: a single or multiple line text zone where user can edit text
  549. // ----------------------------------------------------------------------------
  550. class WXDLLIMPEXP_CORE wxTextCtrlBase : public wxControl,
  551. #if wxHAS_TEXT_WINDOW_STREAM
  552. public wxSTD streambuf,
  553. #endif
  554. public wxTextAreaBase,
  555. public wxTextEntry
  556. {
  557. public:
  558. // creation
  559. // --------
  560. wxTextCtrlBase() { }
  561. virtual ~wxTextCtrlBase() { }
  562. // more readable flag testing methods
  563. bool IsSingleLine() const { return !HasFlag(wxTE_MULTILINE); }
  564. bool IsMultiLine() const { return !IsSingleLine(); }
  565. // stream-like insertion operators: these are always available, whether we
  566. // were, or not, compiled with streambuf support
  567. wxTextCtrl& operator<<(const wxString& s);
  568. wxTextCtrl& operator<<(int i);
  569. wxTextCtrl& operator<<(long i);
  570. wxTextCtrl& operator<<(float f) { return *this << double(f); }
  571. wxTextCtrl& operator<<(double d);
  572. wxTextCtrl& operator<<(char c) { return *this << wxString(c); }
  573. wxTextCtrl& operator<<(wchar_t c) { return *this << wxString(c); }
  574. // insert the character which would have resulted from this key event,
  575. // return true if anything has been inserted
  576. virtual bool EmulateKeyPress(const wxKeyEvent& event);
  577. // do the window-specific processing after processing the update event
  578. virtual void DoUpdateWindowUI(wxUpdateUIEvent& event);
  579. virtual bool ShouldInheritColours() const { return false; }
  580. // work around the problem with having HitTest() both in wxControl and
  581. // wxTextAreaBase base classes
  582. virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const
  583. {
  584. return wxTextAreaBase::HitTest(pt, pos);
  585. }
  586. virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
  587. wxTextCoord *col,
  588. wxTextCoord *row) const
  589. {
  590. return wxTextAreaBase::HitTest(pt, col, row);
  591. }
  592. // we provide stubs for these functions as not all platforms have styles
  593. // support, but we really should leave them pure virtual here
  594. virtual bool SetStyle(long start, long end, const wxTextAttr& style);
  595. virtual bool GetStyle(long position, wxTextAttr& style);
  596. virtual bool SetDefaultStyle(const wxTextAttr& style);
  597. // wxTextAreaBase overrides
  598. virtual wxString GetValue() const
  599. {
  600. return wxTextEntry::GetValue();
  601. }
  602. virtual void SetValue(const wxString& value)
  603. {
  604. wxTextEntry::SetValue(value);
  605. }
  606. // wxTextEntry overrides
  607. virtual bool SetHint(const wxString& hint);
  608. // wxWindow overrides
  609. virtual wxVisualAttributes GetDefaultAttributes() const
  610. {
  611. return GetClassDefaultAttributes(GetWindowVariant());
  612. }
  613. static wxVisualAttributes
  614. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL)
  615. {
  616. return GetCompositeControlsDefaultAttributes(variant);
  617. }
  618. protected:
  619. // override streambuf method
  620. #if wxHAS_TEXT_WINDOW_STREAM
  621. int overflow(int i);
  622. #endif // wxHAS_TEXT_WINDOW_STREAM
  623. // Another wxTextAreaBase override.
  624. virtual bool IsValidPosition(long pos) const
  625. {
  626. return pos >= 0 && pos <= GetLastPosition();
  627. }
  628. // implement the wxTextEntry pure virtual method
  629. virtual wxWindow *GetEditableWindow() { return this; }
  630. wxDECLARE_NO_COPY_CLASS(wxTextCtrlBase);
  631. DECLARE_ABSTRACT_CLASS(wxTextCtrlBase)
  632. };
  633. // ----------------------------------------------------------------------------
  634. // include the platform-dependent class definition
  635. // ----------------------------------------------------------------------------
  636. #if defined(__WXX11__)
  637. #include "wx/x11/textctrl.h"
  638. #elif defined(__WXUNIVERSAL__)
  639. #include "wx/univ/textctrl.h"
  640. #elif defined(__SMARTPHONE__) && defined(__WXWINCE__)
  641. #include "wx/msw/wince/textctrlce.h"
  642. #elif defined(__WXMSW__)
  643. #include "wx/msw/textctrl.h"
  644. #elif defined(__WXMOTIF__)
  645. #include "wx/motif/textctrl.h"
  646. #elif defined(__WXGTK20__)
  647. #include "wx/gtk/textctrl.h"
  648. #elif defined(__WXGTK__)
  649. #include "wx/gtk1/textctrl.h"
  650. #elif defined(__WXMAC__)
  651. #include "wx/osx/textctrl.h"
  652. #elif defined(__WXCOCOA__)
  653. #include "wx/cocoa/textctrl.h"
  654. #elif defined(__WXPM__)
  655. #include "wx/os2/textctrl.h"
  656. #endif
  657. // ----------------------------------------------------------------------------
  658. // wxTextCtrl events
  659. // ----------------------------------------------------------------------------
  660. class WXDLLIMPEXP_FWD_CORE wxTextUrlEvent;
  661. wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT, wxCommandEvent);
  662. wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_ENTER, wxCommandEvent);
  663. wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_URL, wxTextUrlEvent);
  664. wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_MAXLEN, wxCommandEvent);
  665. class WXDLLIMPEXP_CORE wxTextUrlEvent : public wxCommandEvent
  666. {
  667. public:
  668. wxTextUrlEvent(int winid, const wxMouseEvent& evtMouse,
  669. long start, long end)
  670. : wxCommandEvent(wxEVT_TEXT_URL, winid),
  671. m_evtMouse(evtMouse), m_start(start), m_end(end)
  672. { }
  673. wxTextUrlEvent(const wxTextUrlEvent& event)
  674. : wxCommandEvent(event),
  675. m_evtMouse(event.m_evtMouse),
  676. m_start(event.m_start),
  677. m_end(event.m_end) { }
  678. // get the mouse event which happened over the URL
  679. const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; }
  680. // get the start of the URL
  681. long GetURLStart() const { return m_start; }
  682. // get the end of the URL
  683. long GetURLEnd() const { return m_end; }
  684. virtual wxEvent *Clone() const { return new wxTextUrlEvent(*this); }
  685. protected:
  686. // the corresponding mouse event
  687. wxMouseEvent m_evtMouse;
  688. // the start and end indices of the URL in the text control
  689. long m_start,
  690. m_end;
  691. private:
  692. DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTextUrlEvent)
  693. public:
  694. // for wxWin RTTI only, don't use
  695. wxTextUrlEvent() : m_evtMouse(), m_start(0), m_end(0) { }
  696. };
  697. typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&);
  698. #define wxTextEventHandler(func) wxCommandEventHandler(func)
  699. #define wxTextUrlEventHandler(func) \
  700. wxEVENT_HANDLER_CAST(wxTextUrlEventFunction, func)
  701. #define wx__DECLARE_TEXTEVT(evt, id, fn) \
  702. wx__DECLARE_EVT1(wxEVT_TEXT_ ## evt, id, wxTextEventHandler(fn))
  703. #define wx__DECLARE_TEXTURLEVT(evt, id, fn) \
  704. wx__DECLARE_EVT1(wxEVT_TEXT_ ## evt, id, wxTextUrlEventHandler(fn))
  705. #define EVT_TEXT(id, fn) wx__DECLARE_EVT1(wxEVT_TEXT, id, wxTextEventHandler(fn))
  706. #define EVT_TEXT_ENTER(id, fn) wx__DECLARE_TEXTEVT(ENTER, id, fn)
  707. #define EVT_TEXT_URL(id, fn) wx__DECLARE_TEXTURLEVT(URL, id, fn)
  708. #define EVT_TEXT_MAXLEN(id, fn) wx__DECLARE_TEXTEVT(MAXLEN, id, fn)
  709. #if wxHAS_TEXT_WINDOW_STREAM
  710. // ----------------------------------------------------------------------------
  711. // wxStreamToTextRedirector: this class redirects all data sent to the given
  712. // C++ stream to the wxTextCtrl given to its ctor during its lifetime.
  713. // ----------------------------------------------------------------------------
  714. class WXDLLIMPEXP_CORE wxStreamToTextRedirector
  715. {
  716. private:
  717. void Init(wxTextCtrl *text)
  718. {
  719. m_sbufOld = m_ostr.rdbuf();
  720. m_ostr.rdbuf(text);
  721. }
  722. public:
  723. wxStreamToTextRedirector(wxTextCtrl *text)
  724. : m_ostr(wxSTD cout)
  725. {
  726. Init(text);
  727. }
  728. wxStreamToTextRedirector(wxTextCtrl *text, wxSTD ostream *ostr)
  729. : m_ostr(*ostr)
  730. {
  731. Init(text);
  732. }
  733. ~wxStreamToTextRedirector()
  734. {
  735. m_ostr.rdbuf(m_sbufOld);
  736. }
  737. private:
  738. // the stream we're redirecting
  739. wxSTD ostream& m_ostr;
  740. // the old streambuf (before we changed it)
  741. wxSTD streambuf *m_sbufOld;
  742. };
  743. #endif // wxHAS_TEXT_WINDOW_STREAM
  744. // old wxEVT_COMMAND_* constants
  745. #define wxEVT_COMMAND_TEXT_UPDATED wxEVT_TEXT
  746. #define wxEVT_COMMAND_TEXT_ENTER wxEVT_TEXT_ENTER
  747. #define wxEVT_COMMAND_TEXT_URL wxEVT_TEXT_URL
  748. #define wxEVT_COMMAND_TEXT_MAXLEN wxEVT_TEXT_MAXLEN
  749. #endif // wxUSE_TEXTCTRL
  750. #endif
  751. // _WX_TEXTCTRL_H_BASE_