Missing weapon from the PB Arsenal: Undo-Redo

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Missing weapon from the PB Arsenal: Undo-Redo

Post by IdeasVacuum »

It would be fantastic if we could have an easy-to-implement Undo-Redo library for PB.
Since the PB IDE has Undo-Redo, perhaps the job is already done?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Missing weapon from the PB Arsenal: Undo-Redo

Post by luis »

IdeasVacuum wrote:It would be fantastic if we could have an easy-to-implement Undo-Redo library for PB.
I never tried it, but I remember this -> http://www.purebasic.fr/english/viewtop ... 52#p328352 by srod
IdeasVacuum wrote:Since the PB IDE has Undo-Redo, perhaps the job is already done?
I suppose the editor use what provided by Scintilla -> http://www.scintilla.org/ScintillaDoc.html#UndoAndRedo
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Missing weapon from the PB Arsenal: Undo-Redo

Post by STARGÅTE »

Here is a german tutorial, how to manage undo/redo functions:
Verwaltung für Undo-/Redo-Funktionen

A library for PB isn't "easy",
because you have to create anyway callbacks for any Do, Undo and Redo,
depending on the topic: text editor, graphics editor, file management, games
and what should be redo or undo (full versions, only changes)
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Missing weapon from the PB Arsenal: Undo-Redo

Post by IdeasVacuum »

easy-to-implement
Not saying it is easy for Fred/Freak to make the library, but that we would want it to be easy to use.
I did take a look at sRod's effort. At the time it was a Beta and I didn't really understand it well enough to trust my implementation of it -so I wrote my own, specifically for the app I was working on, but not really suitable for different types of apps.

I think you are probably right Luis, current PB IDE is likely to be using the Scintilla Undo Redo.

For C++ there is a lib I only recently heard of: GeMS++. This is used by Kubotek for their CAD file viewer KeyView - an application that has a lot of possible User actions to track for Undo-Redo, so I assume that GeMS++ is the business.
http://sourceforge.net/projects/gems-pp/

Edit
Owch! Google Chrome completely messes-up the code sections of a post if translation is used!

I understand the theory StarGate - nice intro to that in your post, but it seems like the wheel has to be re-invented for each specific app. I don't know, perhaps I wish for too much. It's one of those things where I don't enjoy writing the code - when that is the case I sometimes lack patience.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Missing weapon from the PB Arsenal: Undo-Redo

Post by netmaestro »

BERESHEIT
Post Reply