<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>ui-mod &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/ui-mod/</link>
	<description>Feed of posts on WordPress.com tagged "ui-mod"</description>
	<pubDate>Wed, 10 Feb 2010 15:41:48 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[A bit of Nifty Lua code]]></title>
<link>http://kaishi.wordpress.com/2008/12/03/a-bit-of-nifty-lua-code/</link>
<pubDate>Wed, 03 Dec 2008 20:28:01 +0000</pubDate>
<dc:creator>kaishi</dc:creator>
<guid>http://kaishi.wordpress.com/2008/12/03/a-bit-of-nifty-lua-code/</guid>
<description><![CDATA[So I was talking with a colleague today about lua, closures, dynamic binding, etc, and it came up th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So I was talking with a colleague today about lua, closures, dynamic binding, etc, and it came up that a bit of code I used in my UI mod is actually pretty nifty, and surprising that it works at all.</p>
<p>Basically I dynamically create a variable number of UI panels (one for each area that has a battle going on). This dynamic UI presents a problem of how to handle mouse interaction events. The mouse events do not include a reference to the UI panel that was interacted with, so I need to essentially store in my mouse event what panel was clicked on. To do this I simply came up with a redirection scheme where I register OnMouseEvent1, OnMouveEvent2, etc. Then call RealOnMouseEvent(1), etc. I could just define a bunch of OnMouseEventX functions, but that&#8217;s boring. So I came up with this gem. Apparently this is *NOT* how any other language behaves.</p>
<p>In the code below the functions retain the value of &#8220;i&#8221; at the time they were defined. So I end up with several functions that call RealOnMsOvr with the values of 1, 2, 3, 4, to g_maxPanels. This would not work in most other languages.</p>
<p>Background:<br />
CoW is my &#8220;class&#8221; where all my functions are declared.<br />
&#8220;i&#8221; is not declared before this statement.<br />
Names in the code have been shortened to fit in this post.</p>
<p><span style="font-size:10pt;color:#0033cc;font-family:&#34;">for</span><span style="font-size:10pt;font-family:&#34;"> i=<span style="color:black;">1</span>,g_maxPanels <span style="color:#0033cc;">do</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        W.Status[i] = {}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        e = W(<strong><span style="color:#cc9933;">&#8220;Blackframe&#8221;</span></strong>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        e:Resize(180, 60)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        e:Alpha(0.7)      </span><span style="font-size:10pt;font-family:&#34;">       </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        <em><span style="color:#669933;">&#8211; Register window events for this panel</span></em></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        CoW[<strong><span style="color:#cc9933;">"OnMsOvr"</span></strong>..<span style="color:#00aaaa;">tostring</span>(i)] = function(&#8230;) CoW.RealOnMsOvr(i) <span style="color:#0033cc;">end</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        CoW[<strong><span style="color:#cc9933;">"OnLBtnUp"</span></strong>..<span style="color:#00aaaa;">tostring</span>(i)] = function(&#8230;) CoW.RealOnLBtnUp(i) <span style="color:#0033cc;">end</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        CoW[<strong><span style="color:#cc9933;">"OnRBtnUp"</span></strong>..<span style="color:#00aaaa;">tostring</span>(i)] = function(&#8230;) CoW.RealOnRBtnUp(i) <span style="color:#0033cc;">end</span>  </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        WinRegCrEvHnd(e.name, <strong><span style="color:#cc9933;">&#8220;OnMsOvr&#8221;</span></strong>, <strong><span style="color:#cc9933;">&#8220;CoW.OnMsOvr&#8221;</span></strong>..<span style="color:#00aaaa;">tostring</span>(i));</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        WinRegCrEvHnd(e.name, <strong><span style="color:#cc9933;">&#8220;OnLBtnUp&#8221;</span></strong>, <strong><span style="color:#cc9933;">&#8220;CoW.OnLBtnUp&#8221;</span></strong>..<span style="color:#00aaaa;">tostring</span>(i));</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        WinRegCrEvHnd(e.name, <strong><span style="color:#cc9933;">&#8220;OnRBtnUp&#8221;</span></strong>, <strong><span style="color:#cc9933;">&#8220;CoW.OnRBtnUp&#8221;</span></strong>..<span style="color:#00aaaa;">tostring</span>(i));</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;"><span style="font-size:10pt;font-family:&#34;"><span style="font-size:10pt;font-family:&#34;">        W.Status[i].Frame = e   </span></span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        <em><span style="color:#669933;">&#8211;More UI code </span></em></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        <em><span style="color:#669933;">&#8211;More UI code</span></em></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&#34;">        <em><span style="color:#669933;">&#8211;More UI code</span></em></span></p>
<h5 class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:#0033cc;font-family:&#34;">end</span></h5>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Modifica la interfaz de Vienna]]></title>
<link>http://lobotenaz.wordpress.com/2007/10/25/modifica-la-interfaz-de-vienna/</link>
<pubDate>Thu, 25 Oct 2007 07:26:46 +0000</pubDate>
<dc:creator>ArDoN</dc:creator>
<guid>http://lobotenaz.wordpress.com/2007/10/25/modifica-la-interfaz-de-vienna/</guid>
<description><![CDATA[Si te cansaste de la interfaz de este lector de feeds gratuito, ahora puedes modificarla sin mayores]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Si te cansaste de la interfaz de este <a href="http://vienna-rss.sourceforge.net/vienna2.php">lector de feeds gratuito</a>, ahora puedes modificarla sin mayores sustos. Tan simple como montar la imagen &#8220;dmg&#8221;, y clicar en el ejecutable. Sólo tiene un pero, y es que funciona nada más con la versión 2.1.2. Y como la que tengo es la 2.2.nosecuantos, no puedo decir si queda mejor o peor, o si da algún tipo de problema (que es de esperar que no).</p>
<p>Si alguno lo prueba, que me lo comente =).</p>
<p><img src="http://godlike.cl/up/im/10/infinisede.png" alt="null" /></p>
<p>Fuente &#124; <a href="http://www.infinisedesign.net/downloads/view/vienna_ui_mod/">Infinise Design</a></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
