Re: [Lazarus] Undo/Redo in Form Designer

2012-12-19 Thread Martin
On 19/12/2012 10:22, Александр С. wrote: What about this architecture: The new system replaces the old (for the code editor) and contains functions for the form designer. Snapshot is composed of code and form, snapshot is retained after each action in the code editor or in the form designer. Snap

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-19 Thread Александр С .
What about this architecture: The new system replaces the old (for the code editor) and contains functions for the form designer. Snapshot is composed of code and form, snapshot is retained after each action in the code editor or in the form designer. Snapshots are stored in an array, which will co

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-17 Thread Mattias Gaertner
"Александр С." hat am 17. Dezember 2012 um 12:08 geschrieben: > > The procedure SetPropVal checks for specific properties (e.g. 'TColor'). It > > must not. > Why? Storing it as a number does not make sense when there is a ColorToString. There are generic functions for this: FindIntToIdent and Fi

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-17 Thread Александр С .
> The procedure SetPropVal checks for specific properties (e.g. 'TColor'). It > must not. Why? Storing it as a number does not make sense when there is a ColorToString. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazar

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Alexander Klenin
On Mon, Dec 17, 2012 at 1:38 AM, Hans-Peter Diettrich wrote: > > IMO an Undo (history) list is the state of the art. E.g. Version Control > Systems are based on differences, but they may add snapshots of the last > file state(s) for better performance. Actually, it is the other way around. Modern

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Martin
On 16/12/2012 15:12, Hans-Peter Diettrich wrote: Martin schrieb: As before, if you set align, it also changes anchors. Changing align back, may *not* restore the anchors. Align is a special property, which ideally should be write-only (a procedure). Every alignment is equivalent to an set of

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Chavoux Luyt
Hi When I click the "Save all" button, don't Lazarus save only the files that have changed since the last save? In that case, a "snapshot" needs only store the information that will be saved when the "Save all" button is clicked (and this information should be known somewhere in Lazarus). AFAIK th

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Hans-Peter Diettrich
Martin schrieb: As before, if you set align, it also changes anchors. Changing align back, may *not* restore the anchors. Align is a special property, which ideally should be write-only (a procedure). Every alignment is equivalent to an set of anchors, but there exist patterns (sets of ancho

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Hans-Peter Diettrich
Alexander Klenin schrieb: 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

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Mattias Gaertner
On Sun, 16 Dec 2012 14:22:31 + Martin wrote: >[...] > - It can be used as a trigger to take snapshots. Maybe snapshots can be > taken on idle. +1 > (That however would mean that some steps would only have > "action undo". And it needs to enssure, that a snapshot is taken at > least every

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Mattias Gaertner
On Sun, 16 Dec 2012 14:08:22 + Martin wrote: > On 16/12/2012 08:51, Juha Manninen wrote: >[...] > 1) Monitor all properties/ property editors. This allows to detect > changes to individual properties, made by the user. Such as name height, > caption, align, options > > This is not comp

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Martin
On 16/12/2012 11:21, Alexander Klenin wrote: 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 m

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Martin
On 16/12/2012 08:51, Juha Manninen 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 recre

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Mattias Gaertner
On Sun, 16 Dec 2012 22:21:26 +1100 Alexander Klenin wrote: >[...] > 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

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Александр С .
>Yes, you need snapshots. Manager of anchors is not supported in the current version. I will decide the issue in the future. Could you describe the current situation? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.fr

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Alexander Klenin
On Sun, Dec 16, 2012 at 8:37 PM, Mattias Gaertner wrote: > On Sun, 16 Dec 2012 10:51:20 +0200 > Juha Manninen 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 i

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Mattias Gaertner
On Sun, 16 Dec 2012 10:51:20 +0200 Juha Manninen 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 wh

Re: [Lazarus] Undo/Redo in Form Designer

2012-12-16 Thread Juha Manninen
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

[Lazarus] Undo/Redo in Form Designer

2012-12-15 Thread Александр С .
Hi ! I'm doing a undo/redo-system for form designer ( bugs.freepascal.org/view.php?id=22584). This is not the final version now. I post the patches, and each next patch contains more features than the previous one. My code is not perfect, but I'm working on it :) Can any of responsible developers t