[Lazarus] Undo/Redo in Form Designer

Alexander Klenin klenin at gmail.com
Sun Dec 16 12:21:26 CET 2012


On Sun, Dec 16, 2012 at 8:37 PM, Mattias Gaertner
<nc-gaertnma at netcologne.de> wrote:
> On Sun, 16 Dec 2012 10:51:20 +0200
> Juha Manninen <juha.manninen62 at gmail.com> wrote:
>
>> I am still thinking of the most important case: undo for delete operation.
>> It is also the most difficult one. Anchors and alignment depend on the
>> order of creation. It is not enough to just insert a deleted control
>> back. Maybe the whole form must be recreated. Maybe there must be a
>> snapshot history of the form.
>
> Yes, you need snapshots.

I'd like to note that Alexander Strokach is my student, and I have
given him this
task as a course work assignment (which is a kind of lighter version
of bachelor's thesis).

We had quite a lot of discussion with him about the implementation method.
I favored storing a series of snapshots too, while he preferred a
"list of reversible actions" design.

Main arguments were: storing snapshots is much simpler to implement
and more reliable,
while using a list of actions requires less memory and is similar to
what SynEdit does, so should
integrate better.
(I am of the opinion that the IDE should have a common undo history
for form designer and code editor).

He went on and implemented his approach as a proof of concept, and
after several iterations
the code is working for some cases, but the complexity is indeed rather high.
We have now reached a point where expert opinion is needed: is
Alexander's approach viable,
or should he abandon it and start from scratch?

Also, please give the opinion on the code quality and architecture of
his patch --
he is nearing mid-term evaluation :)

--
Alexander S. Klenin




More information about the Lazarus mailing list