[Lazarus] [!! SPAM] Re: Undo for Form Designer

Bogusław Brandys brandys at o2.pl
Mon Jan 4 13:07:13 CET 2010


Juha Manninen pisze:
> On torstai, 31. joulukuuta 2009 17:08:11 Mattias Gaertner wrote:
>> Notes:
>> Changing a property (e.g. Left) changes some other properties too and
>> there is no hook. So for undo you must store the whole form plus the
>> descendant forms plus the referenced forms plus the source changes. This
>> costs much time and memory. For example with some images you easily get
>> a megabyte.
>> So it would be unwise to create an undo step on every change.
> 
> It should be possible to store only the changed properties, thus using less 
> memory. A simple comparison with the previous state reveals the changes.
> 
> Descendant and referenced forms make it more complicated. I think they can't 
> be ignored because the program could end up being broken otherwise.
> 
> Undo would be used mostly for Delete, Move and Size, as noted in other mails 
> in this thread. Including binary images in the undo buffer sounds like an 
> overkill. Such images are always loaded from an external image, they are not 
> edited or created in the Form Designer.
> 
> My thought here were at "abstract" level because I don't know the code enough 
> now to create anything concrete.
> 
> 
> Regards,
> Juha Manninen
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
> 

Maybe it's overload but every state of project (every change to forms or 
config) could be stored in database like sqlite and reversed in one step.

Boguslaw




More information about the Lazarus mailing list