diff --git a/docs/changes.txt b/docs/changes.txt index 88695fde25..4b4fea7d1d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -216,6 +216,7 @@ wxMSW: - wxLongLong formatting with MinGW corrected - wxFileDialog now returns correct filter index for multiple-file dialogs - Fixed a bug in wxSpinCtrl::DoGetBestSize that would make wxSpinCtrl too tall +- Fixed wxTextCtrl::SetMaxLength for rich edit controls wxGTK: diff --git a/docs/latex/wx/text.tex b/docs/latex/wx/text.tex index 94f22b7d16..a213466d52 100644 --- a/docs/latex/wx/text.tex +++ b/docs/latex/wx/text.tex @@ -846,7 +846,7 @@ already is filled up to the maximal length, a (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. +Note that under GTK+, this function may only be used with single line text controls. \wxheading{Compatibility} diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index a0311a97ae..b6f3a8e588 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1247,6 +1247,11 @@ wxString wxTextCtrl::GetLineText(long lineNo) const void wxTextCtrl::SetMaxLength(unsigned long len) { +#if wxUSE_RICHEDIT + if (IsRich()) + ::SendMessage(GetHwnd(), EM_EXLIMITTEXT, 0, (LPARAM) (DWORD) len); + else +#endif ::SendMessage(GetHwnd(), EM_LIMITTEXT, len, 0); }