|
Reported by Björn Lindell; checked by Jordan Russell
If pasting text into TRichEdit, and the pasted text would give
a total
text amount larger than the "MaxLength" of TRichEdit, the text fitting
within MaxLength
is pasted, but no "OnChange" event is fired.
If MaxLength is, say 255 chars, and the TRichEdit has a
text of 240 chars,
and one pastes a 100 char text into the TRichEdit, only the first 15 chars
are added
(which is correct), but no OnChange event is fired. If one pastes a text of
exactly
15 chars or less, the OnChange is fired.
I had "PlainText" set to True and MaxLength set to a custom value, but
otherwise
I had not changed any properties. Debugging into the VCL, I found that
"TCustomEdit.CNCommand" in "stdctrls.pas" is called in both the erroneous
case (more text than can fit) and the working case (all pasted text fits).
In the erroneous case the "Message.NotifyCode" has the value 1281 (meaning
EN_MAXTEXT) and in the working case it has the code 768 (meaning
EN_CHANGE). The procedure is written to only call "Change" if the notify
code is EN_CHANGE.
This project reproduces the problem.
Note from checker:
I could reproduce this on Windows 98, Me, and NT 4.0 SP6. But on Windows 2000, OnChange was fired. So it appears that this is OS- or riched32.dll-version dependent. |