Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Not Found UNDO in my RichEdit with Syntax Highlighting

Posted on 2003-10-21
2
179 Views
Last Modified: 2013-11-22
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.SyntaxHighlighting;  
var  
      ...  
begin  
      OutStream := TMemoryStream.create;  
      ...  
      ...  
      / / end analysis lines, we take it to the exit  
      OutStream.Position := 0;  
      lines.strings[fila-1] := ConvertStreamString(OutStream);  
      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
0
Comment
Question by:bfgnet
2 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 250 total points
ID: 9590821
seems you have to write your own undo-algorythm

i guess it is disabled, because the changes are done programatical
during each change, which cannot logged by th inbuild undo

meikl ;-)
0
 

Author Comment

by:bfgnet
ID: 9590953
Thank you very much, Kretzschmar.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question