bfgnet
asked on
Not Found UNDO in my RichEdit with Syntax Highlighting
I have created a descending class of TRichEdit for the syntax highlighting. the code of the main procedure is Procedure SyntaxHihglighting; the procedure analyzes a line and it transforms it into format RTF.
class TRichEditPHP = (TRichEdit)
private
...
OutStream : TMemoryStream;
Procedure SyntaxHighlighting;
protected
procedure Change; override;
public
...
published
...
end;
Procedure TRichEditPHP.SyntaxHighlig hting;
var
...
begin
OutStream := TMemoryStream.create;
...
...
/ / end analysis lines, we take it to the exit
OutStream.Position := 0;
lines.strings[fila-1] := ConvertStreamString(OutStr eam);
OutStream.Free;
...
End;
This procedure places it in the event Change.
procedure TRichEditPHP.Change;
begin
if HandleAllocated then
begin
if not ActivaConversion then
begin
UpdateCursorPos;
SyntaxHighlighting;
end;
end;
inherited;
end;
My Problem is when I use my class in a program the procedure UNDO it doesn't work it is disabled while I go writing text in the TRichEditPHP1.
As I can solve it, another alternative exists to UNDO creating another procedure.
Please, downloading my Demo Program whith source code: http://www.malpicasoft.com/english/demo/DemoEnglish.zip
class TRichEditPHP = (TRichEdit)
private
...
OutStream : TMemoryStream;
Procedure SyntaxHighlighting;
protected
procedure Change; override;
public
...
published
...
end;
Procedure TRichEditPHP.SyntaxHighlig
var
...
begin
OutStream := TMemoryStream.create;
...
...
/ / end analysis lines, we take it to the exit
OutStream.Position := 0;
lines.strings[fila-1] := ConvertStreamString(OutStr
OutStream.Free;
...
End;
This procedure places it in the event Change.
procedure TRichEditPHP.Change;
begin
if HandleAllocated then
begin
if not ActivaConversion then
begin
UpdateCursorPos;
SyntaxHighlighting;
end;
end;
inherited;
end;
My Problem is when I use my class in a program the procedure UNDO it doesn't work it is disabled while I go writing text in the TRichEditPHP1.
As I can solve it, another alternative exists to UNDO creating another procedure.
Please, downloading my Demo Program whith source code: http://www.malpicasoft.com/english/demo/DemoEnglish.zip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER