<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://stlab.adobe.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://stlab.adobe.com/wiki/index.php?title=Eve_definitions_in_Lua&amp;feed=atom&amp;action=history</id>
		<title>Eve definitions in Lua - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://stlab.adobe.com/wiki/index.php?title=Eve_definitions_in_Lua&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://stlab.adobe.com/wiki/index.php?title=Eve_definitions_in_Lua&amp;action=history"/>
		<updated>2013-05-22T19:33:05Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://stlab.adobe.com/wiki/index.php?title=Eve_definitions_in_Lua&amp;diff=1686&amp;oldid=prev</id>
		<title>FosterBrereton: duplicate title removed</title>
		<link rel="alternate" type="text/html" href="http://stlab.adobe.com/wiki/index.php?title=Eve_definitions_in_Lua&amp;diff=1686&amp;oldid=prev"/>
				<updated>2006-09-28T23:14:27Z</updated>
		
		<summary type="html">&lt;p&gt;duplicate title removed&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:14, 28 September 2006&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;== Eve definitions in Lua ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Often many dialogs in an application have very similar Eve definitions. For example, all of the &amp;quot;Properties&amp;quot; dialogs on Windows contain a tab group and &amp;quot;OK/Cancel/Apply&amp;quot; buttons. It would be nice to be able to define functions that return commonly used combinations of widgets.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Often many dialogs in an application have very similar Eve definitions. For example, all of the &amp;quot;Properties&amp;quot; dialogs on Windows contain a tab group and &amp;quot;OK/Cancel/Apply&amp;quot; buttons. It would be nice to be able to define functions that return commonly used combinations of widgets.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>FosterBrereton</name></author>	</entry>

	<entry>
		<id>http://stlab.adobe.com/wiki/index.php?title=Eve_definitions_in_Lua&amp;diff=1676&amp;oldid=prev</id>
		<title>RalphThomas: Eve definitions in Lua</title>
		<link rel="alternate" type="text/html" href="http://stlab.adobe.com/wiki/index.php?title=Eve_definitions_in_Lua&amp;diff=1676&amp;oldid=prev"/>
				<updated>2006-09-25T17:14:19Z</updated>
		
		<summary type="html">&lt;p&gt;Eve definitions in Lua&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Eve definitions in Lua ==&lt;br /&gt;
&lt;br /&gt;
Often many dialogs in an application have very similar Eve definitions. For example, all of the &amp;quot;Properties&amp;quot; dialogs on Windows contain a tab group and &amp;quot;OK/Cancel/Apply&amp;quot; buttons. It would be nice to be able to define functions that return commonly used combinations of widgets.&lt;br /&gt;
&lt;br /&gt;
One solution to this problem is to write the Eve definitions in an embeddable language such as [http://www.lua.org/ Lua].&lt;br /&gt;
&lt;br /&gt;
My current thinking is that a datastructure would be built in Lua that defines all of the views, and that there would be a function exposed that would take this datastructure and build a UI from it. So an Eve definition might look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
view = dialog{ name = &amp;quot;Test&amp;quot; }&lt;br /&gt;
{&lt;br /&gt;
 row{ horizontal = &amp;quot;align_fill&amp;quot;, vertical = &amp;quot;align_fill&amp;quot; }&lt;br /&gt;
 {&lt;br /&gt;
   static_text{ name = &amp;quot;This is a test.&amp;quot; },&lt;br /&gt;
   button{ name = &amp;quot;Click me&amp;quot;, action: cancel }&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
--&lt;br /&gt;
-- Now build it.&lt;br /&gt;
--&lt;br /&gt;
asl_factory(view)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The various view functions (dialog, row, static_text, button, etc) can be defined like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function leaf_factory(name)&lt;br /&gt;
	return function(params)&lt;br /&gt;
		local t = {}&lt;br /&gt;
		t.name = name;&lt;br /&gt;
		t.params = params;&lt;br /&gt;
		return t;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function container_factory(name)&lt;br /&gt;
	return function(params)&lt;br /&gt;
		return function(children)&lt;br /&gt;
			local t = {}&lt;br /&gt;
			t.name = name;&lt;br /&gt;
			t.params = params;&lt;br /&gt;
			t.children = children;&lt;br /&gt;
			return t;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local dialog = container_factory(&amp;quot;dialog&amp;quot;)&lt;br /&gt;
local row = container_factory(&amp;quot;row&amp;quot;)&lt;br /&gt;
local column = container_factory(&amp;quot;column&amp;quot;)&lt;br /&gt;
local static_text = leaf_factory(&amp;quot;static_text&amp;quot;)&lt;br /&gt;
local button = leaf_factory(&amp;quot;button&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>RalphThomas</name></author>	</entry>

	</feed>