I was having a problem with users having a readonly RichText and still being able to Cut text from it. I found that the OnBeforeCutText wasn't getting called on a Cut, only on a Copy. Here is my patch, it may not be the approach you want to take, but it does solve the problem.
Tony
Code
procedure TWPCustomRtfEdit.CutToClipboard;
var //ZNC 09/16/2005
DoCut: boolean; //ZNC 09/16/2005
begin
if Assigned(FBeforeCutEvent) then //ZNC 09/16/2005
FBeforeCutEvent(Self, DoCut); //ZNC 09/16/2005
if not DoCut then exit; //ZNC 09/16/2005
FInCutToClipboard := TRUE;
try
CopyToClipboard;
ClearSelection;
finally
FInCutToClipboard := FALSE;
end;
end;
Alles anzeigen
[/code]