add maxline restriction in single line mode textCtrl. let textctrl will fire wxEVT_TEXT_MAXLEN and not recive the chars when the text length beyond the maxlength

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77819 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-23 17:42:12 +00:00
parent db0d7e67a9
commit fe733e34c2
4 changed files with 40 additions and 3 deletions

View File

@@ -110,6 +110,7 @@ public:
virtual bool IsModified() const wxOVERRIDE;
virtual bool IsEditable() const wxOVERRIDE;
virtual void SetMaxLength(unsigned long len) wxOVERRIDE;
// If the return values from and to are the same, there is no selection.
virtual void GetSelection(wxTextPos* from, wxTextPos* to) const wxOVERRIDE;
@@ -489,6 +490,11 @@ private:
// last position (only used by GetLastPosition())
wxTextPos m_posLast;
// max text line length
long m_maxLength;
// current text line length
long m_textLength;
// selection
wxTextPos m_selAnchor,
m_selStart,