implemented, tested and documented wxTextCtrl::SetMaxLength()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-08-15 12:45:53 +00:00
parent 2cefcb34d2
commit d7eee191c5
13 changed files with 119 additions and 12 deletions

View File

@@ -15,6 +15,7 @@ All (GUI):
- support for virtual list control added
- wxFindReplaceDialog added (based on work of Markus Greither)
- wxTextCtrl::SetMaxLength() added (wxMSW/wxGTK)
wxHTML:

View File

@@ -39,6 +39,10 @@ which is generated by a wxTextCtrl control.}
which is generated by a wxTextCtrl control. Note that you must use
wxTE\_PROCESS\_ENTER flag when creating the control if you want it to generate
such events.}
\twocolitem{{\bf EVT\_TEXT\_MAXLEN(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_MAXLEN command,
which is generated by a wxTextCtrl control when the user tries to enter more
characters into it than the limit previosuly set with
\helpref{SetMaxLength}{wxtextctrlsetmaxlength}.}
\twocolitem{{\bf EVT\_MENU(id, func)}}{Process a wxEVT\_COMMAND\_MENU\_SELECTED command,
which is generated by a menu item.}
\twocolitem{{\bf EVT\_MENU\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_MENU\_RANGE command,

View File

@@ -514,6 +514,28 @@ Sets the insertion point at the given position.
Sets the insertion point at the end of the text control. This is equivalent
to \helpref{SetInsertionPoint}{wxtextctrlsetinsertionpoint}(\helpref{GetLastPosition}{wxtextctrlgetlastposition}()).
\membersection{wxTextCtrl::SetMaxLength}\label{wxtextctrlsetmaxlength}
\func{virtual void}{SetMaxLength}{\param{unsigned long }{len}}
This function sets the maximum number of characters the user can enter into the
control. In other words, it allows to limit the text value length to {\it len}
not counting the terminating {\tt NUL} character.
If the user tries to enter more characters into the text control when it
already is filled up to the maximal length, a
{\tt wxEVT\_COMMAND\_TEXT\_MAXLEN} event is sent to notify the program about it
(giving it the possibility to show an explanatory message, for example) and the
extra input is discarded.
Note that this function may only be used with single line text controls.
\wxheading{Compatibility}
Only implemented in wxMSW/wxGTK starting with wxWindows 2.3.2.
The {\tt wxEVT\_COMMAND\_TEXT\_MAXLEN} event is only sent by wxMSW.
\membersection{wxTextCtrl::SetSelection}\label{wxtextctrlsetselection}
\func{virtual void}{SetSelection}{\param{long}{ from}, \param{long}{ to}}