Re: Multi-level Undo?

2016-07-23 Thread Richmond
This is really the same sort of thing as being unable to hit 
command/control Z


when one accidently deletes something.


R.


On 23.07.2016 10:57, Peter Reid wrote:

Is there any way of supporting multi-level undo in LiveCode?

My current project provides support for the user to manipulate objects (grouped 
vector objects).  The user can grab objects, move them around the window, 
group/ungroup, align, cut, copy, paste and undo.  However the undo is single 
level only.

Can anyone suggest a way of providing multi-level undo, even if only 3 levels?

Thanks.

Peter
--
Peter Reid
Loughborough, UK


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Multi-level Undo?

2016-07-23 Thread Matt Maier
I looked into it a while back. A few basic options are:
- rationalize all of the user's actions into a list of named actions, keep
track of the actions in order, and then have the engine execute the list.
if the user uses undo, just move a marker one item backwards in the list,
so that the engine only gets up to the marker. If they use redo, move the
marker ahead one item
- save a complete copy of the working file after every change. use up as
much space as you want and start overwriting the oldest version. if a user
uses undo, load an older version. if they use redo, load a newer version.
- carefully control your engine's options so that they are all perfectly
undoable, with no remainders or side effects. if the user uses undo, just
execute the exact opposite of the last operation. if they use redo, just
execute the exact same operation again.

You can mix and match among these options. I used the first one there and
my files never got anywhere close to big enough that you'd notice they were
being regenerated from scratch after every change. That depends on your
task, though; mine was text and some simple vectors.

On Sat, Jul 23, 2016 at 10:57 AM, Peter Reid <pr...@reidit.co.uk> wrote:

> Is there any way of supporting multi-level undo in LiveCode?
>
> My current project provides support for the user to manipulate objects
> (grouped vector objects).  The user can grab objects, move them around the
> window, group/ungroup, align, cut, copy, paste and undo.  However the undo
> is single level only.
>
> Can anyone suggest a way of providing multi-level undo, even if only 3
> levels?
>
> Thanks.
>
> Peter
> --
> Peter Reid
> Loughborough, UK
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Multi-level Undo?

2016-07-23 Thread Peter Reid
Is there any way of supporting multi-level undo in LiveCode?

My current project provides support for the user to manipulate objects (grouped 
vector objects).  The user can grab objects, move them around the window, 
group/ungroup, align, cut, copy, paste and undo.  However the undo is single 
level only.

Can anyone suggest a way of providing multi-level undo, even if only 3 levels?

Thanks.

Peter
--
Peter Reid
Loughborough, UK


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode