<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Community pulse: Undo in form designer.</title>
	<atom:link href="http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/feed/" rel="self" type="application/rss+xml" />
	<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/</link>
	<description>...On the Wings of the Software Wind</description>
	<lastBuildDate>Wed, 08 Sep 2010 12:09:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Vitaliy</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-960</link>
		<dc:creator>Vitaliy</dc:creator>
		<pubDate>Mon, 28 Sep 2009 15:27:13 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-960</guid>
		<description>I really believe that today Delphi have no time  to implement brialliant, but hard to make ideas and approaches.
I prefer simple ones that work. Proposed spanshot idea works in all situations and having separate undo stcks is impossible due to simple logic - it can lead correct project to absolutely uncorrect and unknown one one by pressing undo (as you don&#039;t control all dependencies).</description>
		<content:encoded><![CDATA[<p>I really believe that today Delphi have no time  to implement brialliant, but hard to make ideas and approaches.<br />
I prefer simple ones that work. Proposed spanshot idea works in all situations and having separate undo stcks is impossible due to simple logic &#8211; it can lead correct project to absolutely uncorrect and unknown one one by pressing undo (as you don&#8217;t control all dependencies).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wings of Wind</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-958</link>
		<dc:creator>Wings of Wind</dc:creator>
		<pubDate>Mon, 28 Sep 2009 10:28:55 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-958</guid>
		<description>1. I wonder how the Editor&#039;s Undo works in these cases. But, anyway, as you said this isn&#039;t a problem. The problem (perhaps) is...
2. ...so we need also in our &lt;code&gt;TUndoItem&lt;/code&gt; an &lt;em&gt;&#039;Entity: string&#039;&lt;/em&gt; member which will hold the changed entity name (&lt;em&gt;Form1&lt;/em&gt; in your case). I think that in the same way in which is intuitive to change from the Form2 things in the Form1, in the same way we must do our Undo. Imho, we must follow the same logic. But yes, here is a question to make: We need separate Undo stacks / Form isn&#039;t it? And then...</description>
		<content:encoded><![CDATA[<p>1. I wonder how the Editor&#8217;s Undo works in these cases. But, anyway, as you said this isn&#8217;t a problem. The problem (perhaps) is&#8230;<br />
2. &#8230;so we need also in our <code>TUndoItem</code> an <em>&#8216;Entity: string&#8217;</em> member which will hold the changed entity name (<em>Form1</em> in your case). I think that in the same way in which is intuitive to change from the Form2 things in the Form1, in the same way we must do our Undo. Imho, we must follow the same logic. But yes, here is a question to make: We need separate Undo stacks / Form isn&#8217;t it? And then&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wings of Wind</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-957</link>
		<dc:creator>Wings of Wind</dc:creator>
		<pubDate>Mon, 28 Sep 2009 10:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-957</guid>
		<description>&lt;em&gt;&quot;But I do NOT want the code changes I made at #6 and #7 to be undone.

Or maybe sometimes I do.&quot;
&lt;/em&gt;

Then DON&#039;T press Undo, depending on your intent. :-)

Your solution is more restrictive than what I proposed without giving any advantage. Why reset the buffer? If you don&#039;t want to &#039;undo&#039; also the code, copy it or don&#039;t press the &#039;Undo&#039; button. As you know, we must to keep in sync the Dfm and Pas. Also, another option would be at the step in which one presses the &#039;Undo&#039; in a different context, perhaps a Don&#039;t-Show-Again dialog would say &#039;We revert a change from &quot; (ie. Form / Code)</description>
		<content:encoded><![CDATA[<p><em>&#8220;But I do NOT want the code changes I made at #6 and #7 to be undone.</p>
<p>Or maybe sometimes I do.&#8221;<br />
</em></p>
<p>Then DON&#8217;T press Undo, depending on your intent. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Your solution is more restrictive than what I proposed without giving any advantage. Why reset the buffer? If you don&#8217;t want to &#8216;undo&#8217; also the code, copy it or don&#8217;t press the &#8216;Undo&#8217; button. As you know, we must to keep in sync the Dfm and Pas. Also, another option would be at the step in which one presses the &#8216;Undo&#8217; in a different context, perhaps a Don&#8217;t-Show-Again dialog would say &#8216;We revert a change from &#8221; (ie. Form / Code)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wings of Wind</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-956</link>
		<dc:creator>Wings of Wind</dc:creator>
		<pubDate>Mon, 28 Sep 2009 10:07:55 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-956</guid>
		<description>To undo the changes from DFM &lt;strong&gt;only&lt;/strong&gt; requires AI in order to keep the things &quot;safe&quot; (ie. to have always in sync the DFM and PAS). :-) This is the main problem. Jolyon proposal can be extended to &lt;em&gt;&#039;reset the Form&#039;s Undo buffer at the first &quot;manual&quot; change in the editor&#039;&lt;/em&gt;. Deleting the buffer by just switching is way to much. But also this proposal while is more relaxed than Jolyon&#039;s doesn&#039;t give any advantage over my proposal.

Also I rather see a single Undo Stack / DFM+PAS entity. But the items in this stack have different types. Hence the structure will be something like (not optimized, just an example):
[sourcecode language=&quot;Delphi&quot;]
type

TUndoItemType = (uitDFMPASSnapshot, uitEditor);

TUndoItem = record
  Kind: TUndoItemType;
  GeneralSnapshotData: //whatever...
  EditorUndoData: //the undo structure which we have now
  //...etc.
end;

[/sourcecode]</description>
		<content:encoded><![CDATA[<p>To undo the changes from DFM <strong>only</strong> requires AI in order to keep the things &#8220;safe&#8221; (ie. to have always in sync the DFM and PAS). <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  This is the main problem. Jolyon proposal can be extended to <em>&#8216;reset the Form&#8217;s Undo buffer at the first &#8220;manual&#8221; change in the editor&#8217;</em>. Deleting the buffer by just switching is way to much. But also this proposal while is more relaxed than Jolyon&#8217;s doesn&#8217;t give any advantage over my proposal.</p>
<p>Also I rather see a single Undo Stack / DFM+PAS entity. But the items in this stack have different types. Hence the structure will be something like (not optimized, just an example):</p>
<pre class="brush: delphi;">
type

TUndoItemType = (uitDFMPASSnapshot, uitEditor);

TUndoItem = record
  Kind: TUndoItemType;
  GeneralSnapshotData: //whatever...
  EditorUndoData: //the undo structure which we have now
  //...etc.
end;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksey Timohin</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-955</link>
		<dc:creator>Aleksey Timohin</dc:creator>
		<pubDate>Mon, 28 Sep 2009 06:40:02 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-955</guid>
		<description>Indeed, there are more ways to change DFM:
1) Experts can change properties of DFM. F.e. Gexperts expert - &quot;Replace component&quot;, CnPack expert - &quot;Autocorrect properties&quot; and many others.
2) The other thing, which is more complicate (imho) is changing components&#039; properties from another form. 
F.e. 
a) form TForm1 contains component ClientDataset1
b) form TForm2 contains components: DbGrid1 and DataSource1. DbGrid1 is linked to DataSource1, but DataSource1 is linked to TForm1 ClientDataset1. 

It is possible to change any property of TForm1.ClientDataset1 while TForm1 is  not opened in designer. One should open TForm2 and expand DataSource1&#039;s property Dataset.</description>
		<content:encoded><![CDATA[<p>Indeed, there are more ways to change DFM:<br />
1) Experts can change properties of DFM. F.e. Gexperts expert &#8211; &#8220;Replace component&#8221;, CnPack expert &#8211; &#8220;Autocorrect properties&#8221; and many others.<br />
2) The other thing, which is more complicate (imho) is changing components&#8217; properties from another form.<br />
F.e.<br />
a) form TForm1 contains component ClientDataset1<br />
b) form TForm2 contains components: DbGrid1 and DataSource1. DbGrid1 is linked to DataSource1, but DataSource1 is linked to TForm1 ClientDataset1. </p>
<p>It is possible to change any property of TForm1.ClientDataset1 while TForm1 is  not opened in designer. One should open TForm2 and expand DataSource1&#8242;s property Dataset.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Sullivan</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-953</link>
		<dc:creator>Nick Sullivan</dc:creator>
		<pubDate>Sun, 27 Sep 2009 22:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-953</guid>
		<description>I agree with commenter Jolyon Smith that a shared undo stack for the form designer and the code editor might be difficult to manage elegantly, but the essential problem he describes can already occur in the code editor alone, which is simply that after performing tasks A, B and C one might wish to undo only task B.

However, whereas in the code editor one would probably work around the problem by caching the code affected by task A in the clipboard or an auxiliary edit buffer before undoing, such techniques are more difficult and error-prone if both code and UI changes are involved. This makes it tempting to resort to Jolyon&#039;s dodge of providing undo only during an uninterrupted session in the form designer (or better, until manual changes are made in the code editor).

Perhaps in the short term that&#039;s the best that could be hoped for, but a system that allows undoing out of sequence where possible should be the eventual goal. Ideally, you could work freely within the undo history of an entire project across multiple sessions.</description>
		<content:encoded><![CDATA[<p>I agree with commenter Jolyon Smith that a shared undo stack for the form designer and the code editor might be difficult to manage elegantly, but the essential problem he describes can already occur in the code editor alone, which is simply that after performing tasks A, B and C one might wish to undo only task B.</p>
<p>However, whereas in the code editor one would probably work around the problem by caching the code affected by task A in the clipboard or an auxiliary edit buffer before undoing, such techniques are more difficult and error-prone if both code and UI changes are involved. This makes it tempting to resort to Jolyon&#8217;s dodge of providing undo only during an uninterrupted session in the form designer (or better, until manual changes are made in the code editor).</p>
<p>Perhaps in the short term that&#8217;s the best that could be hoped for, but a system that allows undoing out of sequence where possible should be the eventual goal. Ideally, you could work freely within the undo history of an entire project across multiple sessions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vitaliy</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-952</link>
		<dc:creator>Vitaliy</dc:creator>
		<pubDate>Sun, 27 Sep 2009 20:42:38 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-952</guid>
		<description>In fact, your solution have common sense. 
But I propose simpler solution. After each operation system performs snapshot, even for pas files only. 
But this snapshots are differential one. 
Good differential compressed snapshots could weight even less then raw changes only. And yes, they are fast as I made detailed review of such techniques some time ago.

So, here is practical implementation:
1) Change occured (button moved, for example)
2) DFM file is in memory. 
3) Undo engine always have previous DFM file, before the change.
4) Engine make reverse differential compression (original - current file, new -  file before change). And leaves it in memory.
5) As soon as changes become too numerous all old changes could be dumped to disk using FIFO principle.
6) One undo requires only one simple decompression. And you must note that normal text edit operations could be implemented inside compression scheme (as it uses insert and delete operations already) to speed up things.

Is it hard to implement? No, it is not.
It is not as facinating as playing with various properties changes and similar things. I know young boys, they like that :-)

And, btw, this post also shows biggest mistake made by Delphi developers - separating DFM and PAS files (and later making DFM binaries). ALl DFM data must be included within form class declaration and must be contained in same PAS file. So, we could return to elegant units concention as opposed to idiotic project conception.</description>
		<content:encoded><![CDATA[<p>In fact, your solution have common sense.<br />
But I propose simpler solution. After each operation system performs snapshot, even for pas files only.<br />
But this snapshots are differential one.<br />
Good differential compressed snapshots could weight even less then raw changes only. And yes, they are fast as I made detailed review of such techniques some time ago.</p>
<p>So, here is practical implementation:<br />
1) Change occured (button moved, for example)<br />
2) DFM file is in memory.<br />
3) Undo engine always have previous DFM file, before the change.<br />
4) Engine make reverse differential compression (original &#8211; current file, new &#8211;  file before change). And leaves it in memory.<br />
5) As soon as changes become too numerous all old changes could be dumped to disk using FIFO principle.<br />
6) One undo requires only one simple decompression. And you must note that normal text edit operations could be implemented inside compression scheme (as it uses insert and delete operations already) to speed up things.</p>
<p>Is it hard to implement? No, it is not.<br />
It is not as facinating as playing with various properties changes and similar things. I know young boys, they like that <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>And, btw, this post also shows biggest mistake made by Delphi developers &#8211; separating DFM and PAS files (and later making DFM binaries). ALl DFM data must be included within form class declaration and must be contained in same PAS file. So, we could return to elegant units concention as opposed to idiotic project conception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jolyon Smith</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-951</link>
		<dc:creator>Jolyon Smith</dc:creator>
		<pubDate>Sun, 27 Sep 2009 19:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-951</guid>
		<description>I don&#039;t think you&#039;ve addresses the problem that *form* design and *code* editing are two different contexts within the common environment.

If I make a mixture of code changes and form design &quot;tweaks&quot;, when I &quot;undo&quot; a form design change I do not (always) want any intervening code changes undone:

1. Place a control
2. Add some code
3. Move the control
4. Add another control
5. Move the control placed at #1 above
6. Add some more code
7. Re-arrange code (I have a preference for how methods are organised in a unit that doesn&#039;t always agree with the IDE default placement of the code)
8. Review my form design (i.e. return to form design view)

So now imagine I&#039;m sitting looking at my FORM design and decide that I didn&#039;t want to move that control (at step #5) after all.

So I &quot;Undo&quot;.

But I do NOT want the code changes I made at #6 and #7 to be undone.

Or maybe sometimes I do.

I think the only way a form design Undo could work would be for a given Form DEsign activity context.  That is, for as long as I am working in the form designer I can undo any changes I make.  But as soon as I switch to a code editor view my form design undo buffer is reset.

Now that might work.

It might not be perfect, but it&#039;s better than nothing and avoids the problem of trying to handle undo across separate and not always related edit contexts (code + form design).</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think you&#8217;ve addresses the problem that *form* design and *code* editing are two different contexts within the common environment.</p>
<p>If I make a mixture of code changes and form design &#8220;tweaks&#8221;, when I &#8220;undo&#8221; a form design change I do not (always) want any intervening code changes undone:</p>
<p>1. Place a control<br />
2. Add some code<br />
3. Move the control<br />
4. Add another control<br />
5. Move the control placed at #1 above<br />
6. Add some more code<br />
7. Re-arrange code (I have a preference for how methods are organised in a unit that doesn&#8217;t always agree with the IDE default placement of the code)<br />
8. Review my form design (i.e. return to form design view)</p>
<p>So now imagine I&#8217;m sitting looking at my FORM design and decide that I didn&#8217;t want to move that control (at step #5) after all.</p>
<p>So I &#8220;Undo&#8221;.</p>
<p>But I do NOT want the code changes I made at #6 and #7 to be undone.</p>
<p>Or maybe sometimes I do.</p>
<p>I think the only way a form design Undo could work would be for a given Form DEsign activity context.  That is, for as long as I am working in the form designer I can undo any changes I make.  But as soon as I switch to a code editor view my form design undo buffer is reset.</p>
<p>Now that might work.</p>
<p>It might not be perfect, but it&#8217;s better than nothing and avoids the problem of trying to handle undo across separate and not always related edit contexts (code + form design).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Champion</title>
		<link>http://windwings.wordpress.com/2009/09/27/community-pulse-undo-in-form-designer/comment-page-1/#comment-950</link>
		<dc:creator>David Champion</dc:creator>
		<pubDate>Sun, 27 Sep 2009 18:00:01 +0000</pubDate>
		<guid isPermaLink="false">http://wings-of-wind.com/?p=330#comment-950</guid>
		<description>Wouldn&#039;t the background compiler in D2010 need to take a snapshot before the  user could continue with the Form Designer and Editor. Perhaps this mechanism could be overloaded to implement the Undo/Redo.</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t the background compiler in D2010 need to take a snapshot before the  user could continue with the Form Designer and Editor. Perhaps this mechanism could be overloaded to implement the Undo/Redo.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
