?
Solved

Undo Redo

Posted on 2000-01-25
6
Medium Priority
?
324 Views
Last Modified: 2010-04-04
Is there any way to let the user undo and redo more than once?

the code i'm using is: reEdit.Undo, but this let's the user undo only once.

And my last question, how do i get a filename's title.

So if for example d:\juegos\papafrita.htm is the filename papafrita.htm is the title.

thanks.
0
Comment
Question by:pin_plunder
  • 3
  • 2
6 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 60 total points
ID: 2387253
For the file title you can do this:

Title := ExtractFileName(FileName);

TEdits only have a single undo, but memos and reichedits have multiple. You will need to write your own undo handling by doing something like storing all the changes in a stringlist using the OnChange event to get each changed string. Then trap the WM_UNDO message and pop the last item off your stringlist and set it into edit.text.

Cheers,

Raymond.
0
 

Author Comment

by:pin_plunder
ID: 2387492
yeah, but what happens if what changes is the format of the text, how can i undo that?
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2387658
What do you mean by the format of the text?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 

Author Comment

by:pin_plunder
ID: 2389750
If I correct, what you told me to do is to store every change the user makes adding some code to the rich edit's OnChange event.
Thus, you said that storing changes in a string list would be a good idea, but in fact, string lists will only store changes the user made when he/she erased or added some text, but how can i undo a bold, or an underline. (several times)

I mean just like Word, or Excel. You can undo/redo almost everything a thousand times.

understand what i mean?

0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2390225
Oh - you mean a richedit. That has multiple undo already (I am pretty sure...)

Cheers,

Raymond.
0
 
LVL 1

Expert Comment

by:chengjian
ID: 2391676
yeath, I tested the TRichEdit. I think it's the matter of microsoft. they published a dll(fogot the exact name), but now you should have version 2.0, install the latest version of ie is a good choice
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…

589 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