Solved

Not Found UNDO in my RichEdit with Syntax Highlighting

Posted on 2003-10-21
2
166 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now