PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Text Undo/Redo for your Powerbasic FF3 projects  (Read 90 times)

David Kenny

  • Senior Member
  • ***
  • Posts: 461
  • Windows 7 & 10
Text Undo/Redo for your Powerbasic FF3 projects
« on: July 20, 2020, 10:49:25 PM »

I'm not sure if anybody would be interested in it but I thought I'd throw it out there.  FF's Undo/Redo used to drive me crazy.  I kept hoping Paul would get around to replacing it, but finally decided to try one myself. My plan was to present it to Paul in the hopes he would include it in FF4 or at least give him some ideas that might inspire him to write a new one. He discontinued FF right before I finished it.  Last timestamp on the source files was in September of 2014.

It's implemented as a class so it could be easily added to any project with an edit control.  There is very little that you need to add to your project to get it going. It should be easy to figure out what you need to add by looking at my code in the MainFrm.  It's got some nice features as well, but it would be easier for you to try it than for me to explain them all.

I can't remember how complete it is.  I'm pretty sure it was about done, but might have a bug or two. But not any that crash or hang the program.  You can paste some text into the editor to start, but if you drop a file on the program to launch it, or load a file using the "File Open" menu, it saves a copy in a variable.  Then when you are finished making your test edits, you can undo all the way back to the start.  When there are no more edits to undo, the saved copy is compared to the current text and will let you know if it's not the same.  The lack of a popup means the saved and current text are the same.

The executable is in the 'release' folder and can be run without compiling it if you just want to see how it works.  As compiled last, it expects the ztrace.dll to be in the same folder, so it will fail if you copy it out and don't also copy the dll.

I would be more than happy to help, if you have questions about how to use, or incorporate it into a project.

BTW, I don't have any problems with Undo/Redo in WinFBE as Paul is again using Scintilla.

David

Edit:  I found that I used hard coded references to the edit control and a couple test controls in the Class.  I will clean that up and create a property to pass the the edit control's handle to the class if someone would like me to.  Then the class will not need to be modified to work in other projects.
« Last Edit: July 21, 2020, 07:56:02 AM by David Kenny »
Logged