Undo Redo

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.
pin_plunderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pin_plunderAuthor Commented:
yeah, but what happens if what changes is the format of the text, how can i undo that?
0
rwilson032697Commented:
What do you mean by the format of the text?
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

pin_plunderAuthor Commented:
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
rwilson032697Commented:
Oh - you mean a richedit. That has multiple undo already (I am pretty sure...)

Cheers,

Raymond.
0
chengjianCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.